Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

image defect in grabcut

The grabcut algorithm is giving me a defect in the image segmentation. The input image is:

image description

The result is:

image description

Basic code for grabcut:

border_offset = 10 bgdModel = np.zeros((1, 65), np.float64) fgdModel = np.zeros((1, 65), np.float64)

rect = (border_offset,border_offset,img_size[0]-border_offset,img_size[1]-border_offset)

cv.grabCut(img,mask,rect,bgdModel,fgdModel,3,cv.GC_INIT_WITH_RECT)

Changing the border offset results in smaller or larger defects. The defect is always in the bottom right corner.

When I change the size of the image the result is different but not correct. The border is rough and the image is clipped.

Any suggestions ?

image description

click to hide/show revision 2
None

updated 2020-09-03 08:06:59 -0600

berak gravatar image

image defect in grabcut

The grabcut algorithm is giving me a defect in the image segmentation. The input image is:

image description

The result is:

image description

Basic code for grabcut:

border_offset = 10
bgdModel = np.zeros((1, 65), np.float64)
fgdModel = np.zeros((1, 65), np.float64)

np.float64)

rect = (border_offset,border_offset,img_size[0]-border_offset,img_size[1]-border_offset)

cv.grabCut(img,mask,rect,bgdModel,fgdModel,3,cv.GC_INIT_WITH_RECT)

Changing the border offset results in smaller or larger defects. The defect is always in the bottom right corner.

When I change the size of the image the result is different but not correct. The border is rough and the image is clipped.

Any suggestions ?

image description

image defect in grabcut

The grabcut algorithm is giving me a defect in the image segmentation. The input image is:

image description

The result is:

image description

Basic code for grabcut:

border_offset = 10
bgdModel = np.zeros((1, 65), np.float64)
fgdModel = np.zeros((1, 65), np.float64)

rect = (border_offset,border_offset,img_size[0]-border_offset,img_size[1]-border_offset)

cv.grabCut(img,mask,rect,bgdModel,fgdModel,3,cv.GC_INIT_WITH_RECT)

rect = (border_offset,border_offset,img_size[0]-border_offset,img_size[1]-border_offset)

cv.grabCut(img,mask,rect,bgdModel,fgdModel,3,cv.GC_INIT_WITH_RECT)

Changing the border offset results in smaller or larger defects. The defect is always in the bottom right corner.

When I change the size of the image the result is different but not correct. The border is rough and the image is clipped.

Any suggestions ?

image description

image defect in grabcut

The grabcut algorithm is giving me a defect in the image segmentation. The input image is:

image description

The result is:

image description

Basic code for grabcut:

border_offset = 10
bgdModel = np.zeros((1, 65), np.float64)
fgdModel = np.zeros((1, 65), np.float64)

rect = (border_offset,border_offset,img_size[0]-border_offset,img_size[1]-border_offset)

cv.grabCut(img,mask,rect,bgdModel,fgdModel,3,cv.GC_INIT_WITH_RECT)

Changing the border offset results in smaller or larger defects. The defect is always in the bottom right corner.

When I change the size of the image the result is different but not correct. The border is rough and the image is clipped.

Any suggestions ?

image description

Small remark: it must be fully automated, so no user interaction with drawing masks.