docstr: Find adjacent pairs of points in the same mask
  img - binary image to be 8-connected
  offset - where to start numbering
  count - number of foreground points in image
  first, second - prior collection of points
  
  returns augmented collection of points
docstr_tok: ["Find","adjacent","pairs","of","points","in","the","same","mask","img","-","binary","image","to","be","8-connected","offset","-","where","to","start","numbering","count","-","number","of","foreground","points","in","image","first",",","second","-","prior","collection","of","points","returns","augmented","collection","of","points"]
code: def find_adjacent_same(img, offset, count, first, second):
      """Find adjacent pairs of points in the same mask
      img - binary image to be 8-connected
      offset - where to start numbering
      count - number of foreground points in image
      first, second - prior collection of points
  
      returns augmented collection of points
      """
      numbering = numpy.zeros(img.shape, int)
      numbering[img] = numpy.arange(count) + offset
      f = numpy.zeros(0, int)
      s = numpy.zeros(0, int)
      for oi in (0, 1):
          for oj in (0, 1):
              f1, s1 = IdentifyDeadWorms.find_adjacent_one(
                  img, numbering, img, numbering, oi, oj
              )
              f = numpy.hstack((f, f1))
              s = numpy.hstack((s, s1))
      return numpy.hstack((first, f)), numpy.hstack((second, s))
  
imports: import matplotlib.cm
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_NUMBER_OBJECT_NUMBER, FF_COUNT, COLTYPE_FLOAT, IMAGE, C_COUNT, C_LOCATION, C_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects, ObjectSet
  from cellprofiler_core.preferences import get_default_colormap
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import LabelName, Integer, Float
  from centrosome.cpmorphology import all_connected_components
  from centrosome.cpmorphology import fixup_scipy_ndimage_result
  from centrosome.cpmorphology import get_line_pts
  from scipy.ndimage import binary_erosion, binary_fill_holes
  from scipy.ndimage import mean
label_desc: Use image node_id 8 for calling the IdentifyDeadWorms obj's underlying member method code with example usage: obj.find_adjacent_same(img, offset, count, first, second) and returns: numpy,  numpy