Unexpected point coordinates when creating mask (it has EXTREME coords)

asked 2019-09-11 05:06:25 -0500

Hi. While using opencv to create mask and predict where the fish actually is on the image, sometimes Im getting a quite unexpected output.

As visible on the photo, one of the points has extreme coordinates (x: 18 000 000, y: 0). It doesnt happen really often, but unfortunately it does which is really annoying.

What's more - its strange since im passing width and height of image when creating the mask:

let mask = new cv.Mat(image.height, image.width, cv.CV_8UC1, cv.Scalar.all(2));

Anyone would have some ideas why does it happen? Why sometimes mask generates that extreme points that are out of the bounds?

image description

edit retag flag offensive close merge delete