Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Remove image shadow? clipping?

Subject: Remove image shadow? clipping?

From: Aron Sceidt

Date: 17 Nov, 2010 13:32:04

Message: 1 of 2

I'm more asking for a suggestion rather than a solution here. I have product images on white background captured along with some shadows produced by the product itself. Images are mainly in rgb but I'm converting them to grayscale. Most of the images contain either black or clear material, or perhaps some greyish values that are generated due to smudges on the product.

Is there maybe some way to clip a certain grey range representing the shadows to white in Matlab? Do you think that this would work?

Also sorry for not posting a picture but I have some rules not to publish any of the images.

Subject: Remove image shadow? clipping?

From: ImageAnalyst

Date: 17 Nov, 2010 14:18:52

Message: 2 of 2

On Nov 17, 8:32 am, "Aron Sceidt" <sigarr...@gmail.com> wrote:
> I'm more asking for a suggestion rather than a solution here. I have product images on white background captured along with some shadows produced by the product itself. Images are mainly in rgb but I'm converting them to grayscale. Most of the images contain either black or clear material, or perhaps some greyish values that are generated due to smudges on the product.
>
> Is there maybe some way to clip a certain grey range representing the shadows to white in Matlab? Do you think that this would work?
>
> Also sorry for not posting a picture but I have some rules not to publish any of the images.

------------------------------------------------------------------
Sure, as long as you know the gray level range of the shadows I think
you can just do something like (untested)
binaryImage = (shadowyImage > low_gl) & (shadowyImage < high_gl);
shadowlessImage = shadowyImage; % Initialize to mostly the same
% Replace the shadows only.
shadowlessImage(binaryImage) = desiredGrayLevel; % such as 255.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us