How can I subtract one image from another using openCV?
Ps.: I coudn't use the python implementation because I'll have to do it in C++
How can I subtract one image from another using openCV?
Ps.: I coudn't use the python implementation because I'll have to do it in C++
Use LoadImage
to load your images into memory, then use the Sub method.
This link contains some example code, if that will help: http://permalink.gmane.org/gmane.comp.lib.opencv/36167
#include <cv.h>
#include <highgui.h>
using namespace cv;
Mat im = imread("cameraman.tif");
Mat im2 = imread("lena.tif");
Mat diff_im = im - im2;
Change the image names. Also make sure they have the same size.