Trying to get matlab to edge detect in shadow area

3 views (last 30 days)
I have an image that im working with on of a small PCB. Most of it is covered in good light but the bottom of it has a shaded area where im blocking the light. i cant seem to be able to get matlab to correct the image so it can detect the edges. what i want happening later on is to have matlab detect components and then identify them but i cant seem to get over this hurdle of adjusting the image so that the shaded area is corrected and then more suitable for matlab to detect the edges. the code below
f = rgb2gray(e);
k = imcomplement(f);
di = imdilate(k,B2);
er = imerode(k,B2);
morph = imsubtract (di,er);
imshow (morph)
this is my progress so far. i want to be able to make the right hand side of the PCB more visible. what could i possible do to get the results i require to move further??

Answers (1)

Kevin Claytor
Kevin Claytor on 25 Feb 2016
Have you taken a look at the non-uniform illumination tutorial? You'd probably want to cut the image down to just the circuit board and then apply the correction.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!