Ask Your Question

AsparaJoe's profile - activity

2018-12-16 12:39:23 -0600 received badge  Student (source)
2017-07-19 09:13:56 -0600 commented question Opencv textdetector false positives

Unfortunately not yet

2017-01-29 05:23:18 -0600 answered a question How do I support c++11 in Opencv 3 Android NDK

I had the same error on imwrite and changing APP_STL := gnustl_static to APP_STL := c++_shared (or APP_STL := c++_static) in my Application.mk does the trick for me

2016-09-06 18:21:55 -0600 asked a question Opencv textdetector false positives

Hello you all, I'm a bit surprised about the Opencv text detector module results. This is what I get using the standard textdetection sample code:

image description

image description

image description

As you can see there are many false positives. Furthermore the algorythm runs very slow and if you try to scale down pictures the number of false positives increases.

All I would to know is if someone else have made a try with the textdetection sample code and gets same results or I'm getting something wrong.. I've run the tests with mac osx build if it matters.

Thanks.

2016-06-10 04:39:48 -0600 received badge  Editor (source)
2016-06-10 04:39:37 -0600 answered a question Find the number of white pixels in contour

If contourArea doesn't give you expected result, you can follow this approach:

  1. Copy the contour in a new empty Mat
  2. Apply countNonZero applied on the new submatrix and you will get the number of non-black pixel

        //1. Copy the contour in a new empty Mat
        Rect cRect = boundingRect(*it); //it is an iterator for your contours vector
        Mat subImg = dilatedImg(cRect);
        double cArea = countNonZero(subImg);
    

Note: if you doesn't have a binary image, you may need to threshold it before to count only the right pixels.

2015-10-09 07:39:59 -0600 received badge  Enthusiast
2015-10-04 23:43:48 -0600 asked a question Shape detection, why try several threshold levels?

I would like simply to know why in most of the shape detection algorythm the approach is search the contours by applying several threshold levels of binarization.

I'm referring in particular to this snippet of code extacted by the Squares.cpp sample:

...
// try several threshold levels
    for( int l = 0; l < N; l++ )
    {
        // hack: use Canny instead of zero threshold level.
        // Canny helps to catch squares with gradient shading
        if( l == 0 )
        {
            // apply Canny. Take the upper threshold from slider
            // and set the lower to 0 (which forces edges merging)
            Canny(gray0, gray, 0, thresh, 5);
            // dilate canny output to remove potential
            // holes between edge segments
            dilate(gray, gray, Mat(), Point(-1,-1));
        }
        else
        {
            // apply threshold if l!=0:
            //     tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0
            gray = gray0 >= (l+1)*255/N;
        }
        ...
 }

I understood the reason to use Canny when N is 0, but I can't say the same for the several threshold attempts. Any help will be very appreciated. Thanks.

2015-09-29 05:28:38 -0600 received badge  Supporter (source)
2015-09-27 18:23:52 -0600 asked a question Process JPG and PNG formats with Opencv for iOS platform

Hello, I need to read and process JPG and PNG images (in other words obtain the Mat representation) with the OpenCV iOS version. I can't use specific system API to do this (e.g. using UIImage with iOS), instead I needo to accomplish it just with std C++ and OpenCV API. I made many attempts with imread() function but the returning Mat data is always NULL. Instead with bmp images all works fine.

Googling around I found somebody having the same problem with JPG and PNG formats. In addition to this when I run:

cout << cv::getBuildInformation() << endl;

In the output I found a lot of information among which there was the following:

Media I/O: 
ZLib:                        build (ver 1.2.8)
JPEG:                        build (ver 90)
WEBP:                        NO
PNG:                         build (ver 1.5.12)
TIFF:                        NO
JPEG 2000:                   NO
OpenEXR:                     NO
GDAL:                        NO

I suppose it may refer to the issue I have mentioned above. Hope somebody can confirm and more important suggest me a way to process JPG, PNG images with just OpenCV API.

Thanks