Page 1 of 1

Eliminating a light shadow from an image

PostPosted: Thu Feb 11, 2010 4:45 pm
by Gilad
Hi,

I have an image of an object taken in a studio. The image is well lighten from multiple sources and stands on a mate white background. the background is also lighten.

Most of the shadows that fall on the background are eliminated by the lights but there are still very little light grayish shadow that I would like to remove. Until now, the only solutions I found involved in manual intervention.

I would like to know if there are known methods for this or if anybody has an idea how to approach such a problem.

The object can also contain white elements and at this point I can't change the background color (to green or blue).

Thanks for any help.

Re: Eliminating a light shadow from an image

PostPosted: Thu Feb 11, 2010 5:21 pm
by JustAnotherStudent
I have tried playing around with the HSV colorspace, and in particular the 'Value' attribute also known as brightness...I have found i can get "okay" results by using this method...I have not seen any full proof methods to remove affects of illumination.

I suppose you could save an image with the illumination gradient on pure white, known as lightfield and subtract this image from the one being affected to cancel it out...Though Im sure someone will correct me on how this method works in real terms.

Re: Eliminating a light shadow from an image

PostPosted: Fri Feb 12, 2010 10:21 am
by andrew.kirillov
Hello,

Are there any sample images to visualize what we are talking about?

One of the ideas is to apply some color filers. If the shadows are gray, then their Saturation will be 0 (or close to it), but Value (or brightness) will be low. (Note: All gray gradients from black to white have 0 saturation, but brightness is growing from 0 (black) to 1 (white)). So you may try increasing brightness of de-saturated pixels.

Another idea. Even with all these shadows, is it still possible to separate background from object? It may be possible if object has quite distinct color. If so, then you may find area occupied by object, and the fill the rest (background) with solid white color (or color of background without shadows).

Re: Eliminating a light shadow from an image

PostPosted: Sat Feb 13, 2010 4:20 pm
by Gilad
Hi,

Thanks for your reply. I've attached some samples.

As you can see there is a very light gray shadow I would like to get rid off and have a true (255,255,255) background without giving away too much of the object.

Gilad.

Re: Eliminating a light shadow from an image

PostPosted: Mon Feb 15, 2010 4:12 pm
by andrew.kirillov
Hello,

The challenge of these pictures is that both of them contain glass parts, which color is very close to background color. This makes simple color filters quite useless.

You may try going different way. Here is what I able to get quickly in IPLab:
Image 13.jpg
Image 13.jpg (123.64 KiB) Viewed 17576 times

Image 12.jpg
Image 12.jpg (26.48 KiB) Viewed 17576 times


This was done by applying Homogenity edge detector first, then thresholding (if you start writing code manually then don’t forget about graysclaing before edge detection). In these pictures you may easily remove noise – just extract biggest blob (use BlobCounter to find biggest blob). Now, when you have your object, you will need to fill the rest of image (which is not occupied by object) using white color.

The above is just an idea. The last step can not be done in the AForge.NET framework for now, so you may need to do some coding/experimenting.

Re: Eliminating a light shadow from an image

PostPosted: Thu Feb 18, 2010 5:32 pm
by Gilad
Hi,

Thanks allot !! can't wait to try it out.

Gilad.

Re: Eliminating a light shadow from an image

PostPosted: Thu Feb 25, 2010 12:05 pm
by Gilad
Hi,

I went with your guidelines and got this. I'm very satisfied with the results !!

Thanks allot for your help !!!

Re: Eliminating a light shadow from an image

PostPosted: Thu Feb 25, 2010 12:37 pm
by andrew.kirillov
Nice to hear you got so good progress.

From the provided picture it is really not so hard to guess what are the image processing steps you’ve used. But, if you don’t mind, could you share a briefly list of involved steps, so it could help somebody else (potentially)?

Re: Eliminating a light shadow from an image

PostPosted: Mon Mar 21, 2011 9:52 am
by BengtS
Can you describe the image processing steps used?

Re: Eliminating a light shadow from an image

PostPosted: Thu Jan 18, 2018 10:16 am
by jeremyb35
A few years later, I'm also looking for this solution.
Can you please post what you've done here ?