Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get an image with clear edges

Hi, All
 
I'm trying to obtain an image with clear edges. I attached two images. The first image is the original one. The second image is after a threshold processing. But on both sides the image still shows bad edges. Is there a way to clean them and make it looks better? I tried to use fill hold vi, it helped to some extent but couldn't solve it all.
Thank you for the help.
 
Regards
Steve
Download All
0 Kudos
Message 1 of 5
(3,128 Views)
Apply and lowpass filter in the vertical direction and then threshold.
Randall Pursley
0 Kudos
Message 2 of 5
(3,119 Views)
I just tried rpursley8's suggestion and it works pretty well. You might try some other filters such as median and play with their settings some more. Since you posted your sample images as JPEG files, it is hard to know if the "noise" in the image that I tried to filter out is always due to the source or JPEG compression artifacts. I took your Original.jpg above and put it through a smoothing/median filter, then a thresholding step, then a morphology (Open) step to remove some extraneous speckles. The result I saw is attached.
0 Kudos
Message 3 of 5
(3,105 Views)
Thank you, rpursley8 and VGA CD-ROM.
I'll try your suggestions and let you know the result.
 
Regards
Steve
0 Kudos
Message 4 of 5
(3,089 Views)
Thanks, Vijay S.
It works great.
0 Kudos
Message 5 of 5
(3,028 Views)