Remove Bright Edge from Image

17 views (last 30 days)
Sean
Sean on 3 Nov 2022
Edited: Sean on 3 Nov 2022
Need to find a way to remove the bright edge of these pictures. It is messing up my dot counts for the images below. Some images the outside edge appears some it does not. I cannot adjust the lighting of my optical inspection machine to repeativly remove the outter boundry. I have tried changing the im2bw ratio. Is there a way to remove the boundry on all pictures ?
I = imread(['C:\Users\SFarmer\Desktop\ring20.jpg']); %Imports the photo from the desktop (location\filename&type)
imshow(I) %Shows the image from the imprt
I=rgb2gray(I); %Converts the picture from color to gray scale
imshow(I) %Shows the gray scale picture
BW=im2bw(I,0.565); %Coverts picture to binary black and white (I, threshhold factor)
imshow(BW) %Shows the binary picture
CC=bwconncomp(BW);
[~, numDots] = bwlabel(BW) %Counts white dots and results can be seen in the command window;
Pictures below and attached show how some have more edge than others. I have tried workign through some simulations with thresholding.

Answers (0)

Community Treasure Hunt

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

Start Hunting!