Class CensusTransform


  • public class CensusTransform
    extends java.lang.Object

    The Census Transform [1] computes a bit mask for each pixel in the image. If a neighboring pixel is greater than the center pixel in a region that bit is set to 1. A 3x3 region 9radius=1) is encoded in 8-bits and a 5x5 region (radius=2) in 24-bits. To compute the error between two pixels simply compute the hamming distance. The hamming distance for an input can be computed using DescriptorDistance.hamming().

    DEVELOPMENT NOTE: See if this can be speed up by only comparing each pixel with another once. Code will be complex

    [1] Zabih, Ramin, and John Woodfill. "Non-parametric local transforms for computing visual correspondence." European conference on computer vision. Springer, Berlin, Heidelberg, 1994.

    • Constructor Summary

      Constructors 
      Constructor Description
      CensusTransform()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createBlockSamples​(int radius)  
      static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createBlockSamples​(int radiusX, int radiusY)  
      static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createCircleSamples()  
      static void dense3x3​(boofcv.struct.image.GrayF32 input, boofcv.struct.image.GrayU8 output, boofcv.struct.border.ImageBorder_F32 border)
      Census transform for local 3x3 region around each pixel.
      static void dense3x3​(boofcv.struct.image.GrayU16 input, boofcv.struct.image.GrayU8 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border)
      Census transform for local 3x3 region around each pixel.
      static void dense3x3​(boofcv.struct.image.GrayU8 input, boofcv.struct.image.GrayU8 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border)
      Census transform for local 3x3 region around each pixel.
      static void dense5x5​(boofcv.struct.image.GrayF32 input, boofcv.struct.image.GrayS32 output, boofcv.struct.border.ImageBorder_F32 border)
      Census transform for local 5x5 region around each pixel.
      static void dense5x5​(boofcv.struct.image.GrayU16 input, boofcv.struct.image.GrayS32 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border)
      Census transform for local 5x5 region around each pixel.
      static void dense5x5​(boofcv.struct.image.GrayU8 input, boofcv.struct.image.GrayS32 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border)
      Census transform for local 5x5 region around each pixel.
      static void sample_IU16​(boofcv.struct.image.GrayF32 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.InterleavedU16 output, boofcv.struct.border.ImageBorder_F32 border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      static void sample_IU16​(boofcv.struct.image.GrayU16 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.InterleavedU16 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      static void sample_IU16​(boofcv.struct.image.GrayU8 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.InterleavedU16 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      static void sample_S64​(boofcv.struct.image.GrayF32 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.GrayS64 output, boofcv.struct.border.ImageBorder_F32 border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      static void sample_S64​(boofcv.struct.image.GrayU16 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.GrayS64 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      static void sample_S64​(boofcv.struct.image.GrayU8 input, org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample, boofcv.struct.image.GrayS64 output, boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border, org.ddogleg.struct.GrowQueue_I32 workSpace)
      Census transform for an arbitrary region specified by the provided sample points
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CensusTransform

        public CensusTransform()
    • Method Detail

      • createBlockSamples

        public static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createBlockSamples​(int radius)
      • createBlockSamples

        public static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createBlockSamples​(int radiusX,
                                                                                                              int radiusY)
      • createCircleSamples

        public static org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> createCircleSamples()
      • dense3x3

        public static void dense3x3​(boofcv.struct.image.GrayU8 input,
                                    boofcv.struct.image.GrayU8 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border)
        Census transform for local 3x3 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • dense3x3

        public static void dense3x3​(boofcv.struct.image.GrayU16 input,
                                    boofcv.struct.image.GrayU8 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border)
        Census transform for local 3x3 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • dense3x3

        public static void dense3x3​(boofcv.struct.image.GrayF32 input,
                                    boofcv.struct.image.GrayU8 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_F32 border)
        Census transform for local 3x3 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • dense5x5

        public static void dense5x5​(boofcv.struct.image.GrayU8 input,
                                    boofcv.struct.image.GrayS32 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border)
        Census transform for local 5x5 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • dense5x5

        public static void dense5x5​(boofcv.struct.image.GrayU16 input,
                                    boofcv.struct.image.GrayS32 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border)
        Census transform for local 5x5 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • dense5x5

        public static void dense5x5​(boofcv.struct.image.GrayF32 input,
                                    boofcv.struct.image.GrayS32 output,
                                    @Nullable
                                    boofcv.struct.border.ImageBorder_F32 border)
        Census transform for local 5x5 region around each pixel.
        Parameters:
        input - Input image
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_S64

        public static void sample_S64​(boofcv.struct.image.GrayU8 input,
                                      org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                      boofcv.struct.image.GrayS64 output,
                                      @Nullable
                                      boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border,
                                      @Nullable
                                      org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_S64

        public static void sample_S64​(boofcv.struct.image.GrayU16 input,
                                      org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                      boofcv.struct.image.GrayS64 output,
                                      @Nullable
                                      boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border,
                                      @Nullable
                                      org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_S64

        public static void sample_S64​(boofcv.struct.image.GrayF32 input,
                                      org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                      boofcv.struct.image.GrayS64 output,
                                      @Nullable
                                      boofcv.struct.border.ImageBorder_F32 border,
                                      @Nullable
                                      org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_IU16

        public static void sample_IU16​(boofcv.struct.image.GrayU8 input,
                                       org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                       boofcv.struct.image.InterleavedU16 output,
                                       @Nullable
                                       boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU8> border,
                                       @Nullable
                                       org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_IU16

        public static void sample_IU16​(boofcv.struct.image.GrayU16 input,
                                       org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                       boofcv.struct.image.InterleavedU16 output,
                                       @Nullable
                                       boofcv.struct.border.ImageBorder_S32<boofcv.struct.image.GrayU16> border,
                                       @Nullable
                                       org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled
      • sample_IU16

        public static void sample_IU16​(boofcv.struct.image.GrayF32 input,
                                       org.ddogleg.struct.FastAccess<georegression.struct.point.Point2D_I32> sample,
                                       boofcv.struct.image.InterleavedU16 output,
                                       @Nullable
                                       boofcv.struct.border.ImageBorder_F32 border,
                                       @Nullable
                                       org.ddogleg.struct.GrowQueue_I32 workSpace)
        Census transform for an arbitrary region specified by the provided sample points
        Parameters:
        input - Input image
        sample - Relative coordinates that are sampled when computing the
        output - Census transformed output image
        border - (Nullable) How the border is handled