Ask Your Question

Revision history [back]

Why does createsamples make images that are partially transparent

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).