Ask Your Question

BigC's profile - activity

2020-10-01 02:16:34 -0600 received badge  Notable Question (source)
2020-02-22 10:52:28 -0600 received badge  Popular Question (source)
2017-02-19 04:13:24 -0600 received badge  Editor (source)
2017-02-19 04:10:21 -0600 asked a question How to find small difference between 2 images

Hello. I would like to compare 2 images and find differences between them even if the difference is very small. I have 2 images ( banana ). The first picture has my reference object which is banana. at second picture, banana is rotated and I put some small marks on it. I would like to find reference banana object at second image and I would like to compare them and try to find small differences .

all suggestions are appreciated.

first image which is my reference image.

image description

Second image which I will try to find banana and compare differences.

image description

2017-02-18 11:53:16 -0600 received badge  Supporter (source)
2017-02-18 11:53:13 -0600 commented answer Showing gray image in picturebox in Visual studio c++

It is done. I used cv_gray2bgr , it worked thanks

2017-02-18 11:52:48 -0600 received badge  Scholar (source)
2017-02-16 07:01:53 -0600 commented answer Showing gray image in picturebox in Visual studio c++

I tried your suggestion but it gives expection.

as you said, when try to do something in clr, I always face to new troubles . I am new to c++ and opencv. Therefore I always research everything on forms to learn,I also searched about gui but I couldn't decide which one should I use. which kind of gui do you suggest?

2017-02-16 06:08:08 -0600 commented question Showing gray image in picturebox in Visual studio c++

I tried all pixel format. If I use Format24bppRgb, I get gray image but I see 3 images in a pixturebox,

2017-02-16 04:32:51 -0600 commented question Showing gray image in picturebox in Visual studio c++

when I load manually the saved gray image in the picturebox, Format8bppIndexed is show as pixel format. so what is the solution to show grayscale in picturebox?

2017-02-16 04:25:07 -0600 asked a question Showing gray image in picturebox in Visual studio c++

Hi all, I am trying to do some gui to show original image, gray, blur, and other things with visual studio c++ WinForms. I wanted to show the mat images in picturebox and I found some examples to do it. I can show images in picturebox now. However when I try to shown gray scale image in picture box, I get different color additional to gray image. I see different colors. I also open gray image with imshow, There is no problem with image. I think conversion keeps other 2 channels. I have searched very long time but I could not find any answers for my problem.

I tried to add a link which shows result of my gui. However my karma is not enough to share link

all Suggestions are appreciated.

System::Drawing::Image^ OpencvReadPicture() {
    cv::Mat originalImage ;
    originalImage = cv::imread("banana.jpg", cv::ImreadModes::IMREAD_COLOR);
    cv::imshow("OriginalImage",originalImage);      
    System::Drawing::Bitmap^ bitmap = gcnew System::Drawing::Bitmap(originalImage.cols, originalImage.rows, originalImage.step, System::Drawing::Imaging::PixelFormat::Format24bppRgb, System::IntPtr::IntPtr(originalImage.data));
    System::Drawing::Image^  image = static_cast<System::Drawing::Bitmap^>(bitmap);     
    return image ;
};
System::Drawing::Image^ OpencvGrayPicture() {
    cv::Mat grayImage;      
    cv::cvtColor(originalImage, grayImage, CV_BGR2GRAY,1);      
    cv::imshow("GrayImage", grayImage);     
    System::Drawing::Bitmap^ bitmapGray = gcnew System::Drawing::Bitmap(grayImage.cols, grayImage.rows, grayImage.step, System::Drawing::Imaging::PixelFormat::Format8bppIndexed, System::IntPtr::IntPtr(grayImage.data));
    System::Drawing::Image^  imageGray = static_cast<System::Drawing::Bitmap^>(bitmapGray);
    return imageGray;
};
pBoxOriginalImage->Image =OpencvReadPicture();// showing original image in the picture box.
pBoxGrayImage->Image = OpencvGrayPicture();// showing gray image in the picturebox.