Edge detection with DIC pattern.
Show older comments
Need some help/advice with an edge detection method. I am looking at edge of cylinderical sample that contains a DIC pattern. I have tried some various basic stuff like the edge() and hough transformation, but I either have all of the DIC pattern showing in the edge image, or the edge of the sample is incomplete and no good.
anyone have any experience with this and could point me in the right direction please?
Accepted Answer
More Answers (1)
Kaustab Pal
on 19 Aug 2024
To effectively detect edges in noisy images, it's important to undertake several pre-processing steps before applying an edge-detection algorithm. If your image contains significant noise, you can mitigate this by smoothing the image with a Gaussian filter, followed by a histogram equalization operation. This will yield a more refined image. You can then apply an edge detection algorithm.
Here's a code example illustrating the process:
BW = rgb2gray(X); % converting the image X to grayscale
B = imgaussfilt(BW,5); % applying a gaussian filter with standard deviation of 5 to the image
BW = histeq(B); % performing histogram equilization
BW1 = edge(BW,'canny'); % applying edge detector
imshow(BW1)
Feel free to experiment with the Gaussian filter's standard deviation and the choice of edge detection algorithm to optimize your results.
You can expect the final output to resemble the image shown below:

Please refer to the links below for the official documentation on the different functions:
Edge Detection: https://www.mathworks.com/help/images/ref/edge.html
2-D Gaussian filtering of images: https://www.mathworks.com/help/images/ref/imgaussfilt.html
Histogram equalization: https://www.mathworks.com/help/images/histogram-equalization.html
Hope this helps.
2 Comments
Tom Lancaster
on 19 Aug 2024
Umar
on 19 Aug 2024
Hi @Tom Lancaster,
As for your concern, increasing the Gaussian filter's standard deviation may indeed erode the boundaries of your cylinder, so it is advisable to use a moderate value to maintain the integrity of the dimensions you are interested in.
Categories
Find more on Object Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


