711712713714715716717718719720721
Core.absdiff(getCurrentMat(), imgMat, dst); } else { Core.absdiff(getCurrentMat(), OpenCV.gray(imgMat), dst); } dst.assignTo(getCurrentMat()); } /** * A helper function that diffs two Mats using absdiff. * Places the result back into mat1
726727728729730731732733734735736
* The Mat to diff against */ public static void diff(Mat mat1, Mat mat2){ Mat dst = imitate(mat1); Core.absdiff(mat1, mat2, dst); dst.assignTo(mat1); } /** * Apply a global threshold to an image. Produces a binary image * with white pixels where the original image was above the threshold