Ask Your Question

Kailash's profile - activity

2018-08-28 11:45:45 -0600 received badge  Nice Question (source)
2018-04-26 03:12:15 -0600 asked a question Extract text and bounding-box using OpenCV

Extract text and bounding-box using OpenCV I am trying to find the bounding boxes (rectangles) of text in an image. So,

2018-04-26 03:12:10 -0600 asked a question Extract text and bounding-box using OpenCV

Extract text and bounding-box using OpenCV I am trying to find the bounding boxes (rectangles) of text in an image. So,

2018-04-26 03:11:09 -0600 asked a question Extract text and bounding-box using OpenCV

Extract text and bounding-box using OpenCV I am trying to find the bounding boxes (rectangles) of text in an image. So,

2018-04-26 03:11:01 -0600 asked a question Extract text and bounding-box using OpenCV

Extract text and bounding-box using OpenCV I am trying to find the bounding boxes (rectangles) of text in an image. So,

2018-03-23 06:34:59 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Great work till date. I tested the on bunch of 22 samples and each sample is further have 2 images at 25% zoom out and z

2018-03-22 02:04:32 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Thanks Laurent, it is working on given image. But on some images its not working, in which earlier working. I can share

2018-03-21 09:47:19 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

output - 20180321.2011 - C:\fakepath\BergersAlgo.PNG I tried the recent code posted here. Target was not found, I atta

2018-03-21 09:45:53 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

output - 20180321.2011 - C:\fakepath\BergersAlgo.PNG I tried the recent code posted here. Target was not found, I atta

2018-03-21 09:45:33 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-21 08:49:44 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

yes I am linking release lib in debug.

2018-03-21 06:45:58 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Same error - Exception thrown at 0x02B00F73 (opencv_core341.dll) in Automation.ImageAlgorithmEXE.exe: 0xC0000005: Acce

2018-03-21 06:45:43 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Same error - Exception thrown at 0x02B00F73 (opencv_core341.dll) in Automation.ImageAlgorithmEXE.exe: 0xC0000005: Acce

2018-03-21 06:45:04 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Same error - Exception thrown at 0x02B00F73 (opencv_core341.dll) in Automation.ImageAlgorithmEXE.exe: 0xC0000005: Acce

2018-03-21 06:42:35 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Same error - Exception thrown at 0x02B00F73 (opencv_core341.dll) in Automation.ImageAlgorithmEXE.exe: 0xC0000005: Acce

2018-03-21 06:41:42 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Same error Exception thrown at 0x02B00F73 (opencv_core341.dll) in Automation.ImageAlgorithmEXE.exe: 0xC0000005: Access

2018-03-21 01:13:48 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

crashing on using vector on this line (cv::split(pen, tplPlane);) If changed to Mat array, it works. Error - Exception

2018-03-21 01:13:00 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

crashing on using vector on this line (cv::split(pen, tplPlane);) If changed to Mat array, it works. Error - Exception t

2018-03-21 00:17:01 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

crashing on using vector on this line (cv::split(pen, tplPlane);) If changed to Mat array, it works.

2018-03-20 10:00:58 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

I tried this code, also updates. Running on Case 2, but not able to find the target images. also cv::split function is c

2018-03-20 10:00:40 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

I tried this code, also updates. Running on Case 2, but not able to find the target images. also cv::split function is c

2018-03-20 05:53:36 -0600 marked best answer Why OpenCV matchTemplate API not detect all occurrence of image?

I am not able detect all occurrence of template image from source image. Please look attache below file and code for the same.

source Image: C:\fakepath\source.JPG

Template Image: C:\fakepath\target.jpg

In the source image there are 3 occurrence of template but matchTemplate API give only two( first and third). The second occurrence not found with 0.98 threshold. I can found the second occurrence with 0.8 threshold.

Can you help me what the wrong with below code?

How detect with all 3 occurrence with 0.98 threshold?

    cv::Mat ref = cv::imread("source.JPG");
    cv::Mat tpl = cv::imread("template.jpg")

    cv::Mat gref, gtpl;
    cv::cvtColor(ref, gref, CV_BGR2GRAY);
    cv::cvtColor(tpl, gtpl, CV_BGR2GRAY);

    cv::Mat res(ref.rows - tpl.rows + 1, ref.cols - tpl.cols + 1, CV_32FC1);
    cv::matchTemplate(gref, gtpl, res, CV_TM_CCOEFF_NORMED);    

    double THRESHOLD = 0.98;

    while (true)
    {
        double minval, maxval;
        cv::Point minloc, maxloc;
        cv::minMaxLoc(res, &minval, &maxval, &minloc, &maxloc);

        if (maxval >= THRESHOLD)
        {
            cv::rectangle(ref,maxloc,cv::Point(maxloc.x + tpl.cols, maxloc.y + tpl.rows),CV_RGB(0, 255, 0), 2);
            cv::floodFill(res, maxloc, cv::Scalar(0), 0, cv::Scalar(.1), cv::Scalar(1.));               
        }
        else
            break;
    }

    cv::imshow("result", ref);
    cv::waitKey();
  • Thanks

Case 1- I am using method CV_TM_CCORR_NORMED, which is working fine with most of the examples. But not working in few. using match-percentage/threshold 99%. see below screen, finding folder img, but it also gives false images.

source img - C:\fakepath\Capture.PNG target img - C:\fakepath\target.png output - C:\fakepath\folderSearch.JPG

Case 2-

Not finding the target img if source img is 75% of original img. using CV_TM_CCORR_NORMED, img open mode is IMREAD_COLOR. code using same that i posted, threshold is 95%.

source img - C:\fakepath\inflow75.PNG target img - C:\fakepath\target.png

output - 20180321.2011 - C:\fakepath\BergersAlgo.PNG

I tried the recent code posted here. Target was not found, I attached the screen.

2018-03-20 02:43:59 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-20 02:43:40 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

Thanks Laurent, One case I found in which target img not found. please find "Case 2", I posted in question block.

2018-03-20 02:40:46 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-19 09:57:27 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-19 08:53:27 -0600 commented answer Why OpenCV matchTemplate API not detect all occurrence of image?

I update the question at end, Pls suggest on Folder img search example.

2018-03-19 08:52:11 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-19 02:43:05 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f

2018-03-19 02:40:53 -0600 edited question Why OpenCV matchTemplate API not detect all occurrence of image?

Why OpenCV matchTemplate API not detect all occurrence of image? I am not able detect all occurrence of template image f