Substract one image from another
img = sub(img1, img2[, mask[, dtype]])
Image (Mat).
Optional mask image (Mat).
Optional depth of the output image.
Output image (Mat).
sub computes the difference of two images pixel per pixel.
sub
scicv_Init(); img1 = imread(getSampleImage("lena.jpg")); img2 = new_Mat(size(img1, 'c'), size(img1, 'r'), CV_8UC3, 40); img_out = subtract(img1, img2); matplot(img_out); delete_Mat(img1); delete_Mat(img2); delete_Mat(img_out);