IplImage* img = cvLoadImage(\"something.jpg\"); IplImage* src = cvLoadImage(\"src.jpg\"); cvSub(src, img, img);
But the size of the source image is
You can use cvResize. Or better use c++ interface (eg cv::Mat instead of IplImage and cv::imread instead of cvLoadImage) and then use cv::resize which handles memory allocation and deallocation itself.
cv::Mat
IplImage
cv::imread
cvLoadImage
cv::resize