Ask Your Question
0

ANPR Algorithm example using OpenCV

asked 2014-03-20 16:06:20 -0600

Safari gravatar image

updated 2014-03-20 18:00:41 -0600

Hi all,

I followed this example/tutorial about ANPR algorithm using OpenCV.

I downloaded c++ example code and I ported this code on iOS app.

Using some example photos, this code work well.

Now, I would to use the iPhone camera to take the photo to pass to the ANPR algorithm but oft I obtain an error (so also a crash). The error is this:

int area = floodFill(input, mask, seed, Scalar(255,0,0), &ccomp, Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDiff, upDiff), flags);

OpenCV Error: Unsupported format or combination of formats () in cvFloodFill, file /src/floodfill.cpp, line 621

floodFill function is used in this context:

Mat mask;
        mask.create(input.rows + 2, input.cols + 2, CV_8UC1);
        mask= Scalar::all(0);
        int loDiff = 30;
        int upDiff = 30;
        int connectivity = 4;
        int newMaskVal = 255;
        int NumSeeds = 10;
        cv::Rect ccomp;
        int flags = connectivity + (newMaskVal << 8 ) +  CV_FLOODFILL_FIXED_RANGE + CV_FLOODFILL_MASK_ONLY;
        for(int j=0; j<NumSeeds; j++){
            cv::Point seed;
            seed.x=rects[i].center.x+rand()%(int)minSize-(minSize/2);
            seed.y=rects[i].center.y+rand()%(int)minSize-(minSize/2);
            circle(result, seed, 1, Scalar(0,255,255), -1);
            int area = cv::floodFill(input, mask, seed, Scalar(255,0,0), &ccomp,

Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDiff, upDiff), flags);
            printf("%d",area);
        }

some suggestions?

edit retag flag offensive close merge delete

Comments

you should probably add the error msg, or whatever you get there

berak gravatar imageberak ( 2014-03-20 16:28:46 -0600 )edit

The error that I reported in the text question is this: Error: Unsupported format or combination of formats () in cvFloodFill,

Safari gravatar imageSafari ( 2014-03-20 18:02:33 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-02 18:38:20 -0600

You left out a )

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-20 16:06:20 -0600

Seen: 3,837 times

Last updated: Mar 20 '14