Why does createsamples make images that are partially transparent

asked 2017-10-29 07:07:11 -0600

I'm 100% a rookie on this, so it might be a stupid question.

I've been following alone with this tutorial;

Creating your own Haar Cascade OpenCV Python Tutorial

All is well (except that it stops after stage 5... but it's a complex problem so should run further - not my question at the moment though). I pretty much copied the tutorial line for line and I don't understand why when using create samples it doesn't place the sample image over the background images, it kinda merges them. This is the single example used in the tutorial;

image description

And here is an example of one of the created sample;

image description

Now, you can just about see the outline of the watch face at the bottom left of the image (just below the leftmost person). But this is clearly not a simple paste over the background image with the positive sample. I assume this is intended behaviour but I don't know why. Can someone please explain why this is done (and if possible how it chooses which part of the positive image should be made transparent).

edit retag flag offensive close merge delete

Comments

that is not really a good tutorial. opencv's is here

if you expect any variation in the objects you want to detect later, you should not use synthetically generated images from a single positive, but LOTS of real positive images, and an info.txt file (with filenames and bounding boxes), probably from the opencv_annotation tool

berak gravatar imageberak ( 2017-10-29 07:30:03 -0600 )edit