docstr: Compute the earthmovers distance between two sets of objects
  
  src_objects - move pixels from these objects
  
  dest_objects - move pixels to these objects
  
  returns the earth mover's distance
docstr_tok: ["Compute","the","earthmovers","distance","between","two","sets","of","objects","src_objects","-","move","pixels","from","these","objects","dest_objects","-","move","pixels","to","these","objects","returns","the","earth","mover","'s","distance"]
code: def compute_emd(self, src_objects, dest_objects):
      """Compute the earthmovers distance between two sets of objects
  
      src_objects - move pixels from these objects
  
      dest_objects - move pixels to these objects
  
      returns the earth mover's distance
      """
      #
      # if either foreground set is empty, the emd is the penalty.
      #
      for angels, demons in (
          (src_objects, dest_objects),
          (dest_objects, src_objects),
      ):
          if angels.count == 0:
              if self.penalize_missing:
                  return (
                      numpy.sum(demons.areas) * self.max_distance.value
                  )
              else:
                  return 0
      if self.decimation_method == DM_KMEANS:
          isrc, jsrc = self.get_kmeans_points(src_objects, dest_objects)
          idest, jdest = isrc, jsrc
      else:
          isrc, jsrc = self.get_skeleton_points(src_objects)
          idest, jdest = self.get_skeleton_points(dest_objects)
      src_weights, dest_weights = [
          self.get_weights(i, j, self.get_labels_mask(objects))
          for i, j, objects in (
              (isrc, jsrc, src_objects),
              (idest, jdest, dest_objects),
          )
      ]
      ioff, joff = [
          src[:, numpy.newaxis] - dest[numpy.newaxis, :]
          for src, dest in ((isrc, idest), (jsrc, jdest))
      ]
      c = numpy.sqrt(ioff * ioff + joff * joff).astype(numpy.int32)
      c[c > self.max_distance.value] = self.max_distance.value
      extra_mass_penalty = (
          self.max_distance.value if self.penalize_missing else 0
      )
      return centrosome.fastemd.emd_hat_int32(
          src_weights.astype(numpy.int32),
          dest_weights.astype(numpy.int32),
          c,
          extra_mass_penalty=extra_mass_penalty,
      )
  
imports: from functools import reduce
  import centrosome.cpmorphology
  import centrosome.fastemd
  import centrosome.filter
  import centrosome.index
  import centrosome.propagate
  import numpy
  import scipy.ndimage
  import scipy.sparse
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Integer
  from cellprofiler.modules import _help
label_desc: Use image node_id 6 for calling the MeasureObjectOverlap obj's underlying member method code with example usage: obj.compute_emd(src_objects, dest_objects) and returns: centrosome, unknown, int