Ask Your Question
0

How to remove floating background?

asked 2018-12-07 03:17:41 -0600

I have images with a black figure on white background, but the brightness of the latter varies smoothly in different parts.

image description

How to make it uniform or max. white (255)? Threshold cut is not possible because at the corners brightness drops almost to the brightness of the figure.

edit retag flag offensive close merge delete

Comments

1

I think you can try the answers given here

LBerger gravatar imageLBerger ( 2018-12-07 03:21:41 -0600 )edit

The second method looks better because it doesn't require parameters like object's size. Any hints what it does? So far as I understand, there is no source image here. Only the background produced from it and the difference. Right?

ya_ocv_user gravatar imageya_ocv_user ( 2018-12-07 04:40:26 -0600 )edit

Method 2 is fit background with a quadric. Image can be thresholded and only white pixel can be fit

LBerger gravatar imageLBerger ( 2018-12-07 07:09:16 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-12-08 04:29:17 -0600

updated 2018-12-08 07:02:09 -0600

The solution for this particular image is to use Morphology Open method with the kernel size of line's thickness. Previously need to make the negative. Morphology Open will render pure background which may be subtracted from the image.

image description

edit flag offensive delete link more

Comments

with second method I have got this :

image description

LBerger gravatar imageLBerger ( 2018-12-08 04:36:45 -0600 )edit
2

And with Morph Open:

don't know how to show image here so added it to the answer

ya_ocv_user gravatar imageya_ocv_user ( 2018-12-08 07:03:34 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-07 03:17:41 -0600

Seen: 521 times

Last updated: Dec 08 '18