AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Eliminating a light shadow from an image

The forum is to discuss topics related to different areas of image processing and computer vision.

Eliminating a light shadow from an image

Postby Gilad » Thu Feb 11, 2010 4:45 pm

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.
Gilad
 
Posts: 9
Joined: Thu Jul 16, 2009 7:19 am

Re: Eliminating a light shadow from an image

Postby JustAnotherStudent » Thu Feb 11, 2010 5:21 pm

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.
JustAnotherStudent
 
Posts: 7
Joined: Sat Oct 31, 2009 3:46 pm

Re: Eliminating a light shadow from an image

Postby andrew.kirillov » Fri Feb 12, 2010 10:21 am

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).
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3383
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Eliminating a light shadow from an image

Postby Gilad » Sat Feb 13, 2010 4:20 pm

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.
Attachments
TSM.8.4.jpg
TSM.8.4.jpg (139.91 KiB) Viewed 11305 times
TSM.4.26.jpg
TSM.4.26.jpg (173.36 KiB) Viewed 11304 times
Gilad
 
Posts: 9
Joined: Thu Jul 16, 2009 7:19 am

Re: Eliminating a light shadow from an image

Postby andrew.kirillov » Mon Feb 15, 2010 4:12 pm

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 11299 times

Image 12.jpg
Image 12.jpg (26.48 KiB) Viewed 11299 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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3383
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Eliminating a light shadow from an image

Postby Gilad » Thu Feb 18, 2010 5:32 pm

Hi,

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

Gilad.
Gilad
 
Posts: 9
Joined: Thu Jul 16, 2009 7:19 am

Re: Eliminating a light shadow from an image

Postby Gilad » Thu Feb 25, 2010 12:05 pm

Hi,

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

Thanks allot for your help !!!
Attachments
candle.jpg
candle.jpg (96.39 KiB) Viewed 11269 times
Gilad
 
Posts: 9
Joined: Thu Jul 16, 2009 7:19 am

Re: Eliminating a light shadow from an image

Postby andrew.kirillov » Thu Feb 25, 2010 12:37 pm

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)?
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3383
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Eliminating a light shadow from an image

Postby BengtS » Mon Mar 21, 2011 9:52 am

Can you describe the image processing steps used?
BengtS
 
Posts: 1
Joined: Mon Mar 21, 2011 9:47 am

Re: Eliminating a light shadow from an image

Postby jeremyb35 » Thu Jan 18, 2018 10:16 am

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




Return to Image Processing and Computer Vision