Let's get a fault. Two image subtraction other good implementations? Beauty Finding fault

Source: Internet
Author: User

http://blog.csdn.net/merlin_q/article/details/7024798

Let 's get a fault. Two image subtraction other good implementations? Tags: imageinclude2011-11-29 20:29 4701 People read Comments (2) favorite reports Classification:OPENCV Study (+)C + + (+)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace CV;
int main ()
{
Mat IMG1 = Imread ("d:\\image\\img1.jpg");
Mat Img2 = Imread ("d:\\image\\img2.jpg");//Two images must be of the same size
Mat img_result1, IMG_RESULT2, Img_result;
Subtract (Img1,img2, IMG_RESULT1);
Subtract (IMG2,IMG1, IMG_RESULT2);
Add (IMG_RESULT1, IMG_RESULT2, IMG_RESULT1);
Imwrite ("D:\\image\\result.jpg", IMG_RESULT1);
Imshow ("result", IMG_RESULT1);
Waitkey ();
return 0;
}

can also be used Img_result = 2*abs (IMG1-IMG2);

Multiply by 2 to make the difference a bit more obvious.

The result is the third picture, where the 3,5,6,7,12 is five different places. What better and more robust way to do without the image size exactly the same?

Let's get a fault. Two image subtraction other good implementations? Beauty Finding fault

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.