IplImage* img = cvLoadImage("something.jpg"); IplImage* src = cvLoadImage("src.jpg"); cvSub(src, img, img);
But the size of the source image is different from img
.
Is there any opencv function to resize it to the img
size?
According to the API documentation of cv2. resize, your 640x480 matrix is being interpolated from whatever numbers are available in the data matrix you passed in. Unless you need your original 80x60 data "blown up" to some specific format, you should be able to skip this line/step without loss of information.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With