opencv_createsamples makes a square white background around image

asked 2019-03-27 03:36:05 -0500

pedro_bb7 gravatar image

I have the following image that I want to detect: image description

After running following command:

opencv_createsamples -img banana.png -bg bg.txt -info info/info.txt -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950

It creates the image:

image description

As it can be seen there is a white background around banana. Does anybody knows how to remove it?

edit retag flag offensive close merge delete


forget the idea of "synthesizing" positive images, entilrey, it never works in the real world.

you need a few hundred real world images of your object. (also "real world" negatives).

then, the whole idea of training cascades is somewhat deprecated (use deep learning instead), and current opencv does no more come with tools to train that.

oh, and opencv NEVER respects transparency in images. avoid those for computer-vision, as good as you can !

berak gravatar imageberak ( 2019-03-27 03:48:22 -0500 )edit