Ask Your Question

Revision history [back]

Hello,

I had the same issue and found a solution.

The problem occurs when the image you're trying to create positive samples for is not a square.

Wrap your image into a black square and make the black color transparent when using opencv_createsamples (put parameter -bgcolor to 0). Also if you specify width and height parameters make sure they are the same to fit your squared image.

Fixed it for me, I guess the rotations applied by opencv_createsamples turns a square containing your object into a square containing your object but doesn't turn a rectangle containing your object into another rectangle containing your object.

Hope this helps :-)

Hugo