Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Of course you can subtract two images using OpenCV. Something like this should work:

cv::Mat1f img1 = cv::imread("image1.png", cv::LOAD_IMAGE_GRAYSCALE);
cv::Mat1f img2 = cv::imread("image2.png", cv::LOAD_IMAGE_GRAYSCALE);

cv::Mat1f sub = img1 - img2; // Now all pixels != 0 are different pixels

From here on you can proceed further, some possible involved steps: