Hi @Tom Lancaster ,
To effective detect edges on a cylindrical sample with a DIC pattern, I will consider employing a combination of preprocessing and advanced edge detection techniques.
First, start by applying a Gaussian filter to reduce noise, which can interfere with edge detection. You can use the following MATLAB code snippet:
% Read the image
img = imread('your_cylindrical_sample.jpg');
% Convert to grayscale
grayImg = rgb2gray(img);
% Apply Gaussian filter
filteredImg = imgaussfilt(grayImg, 2);
Note: For more information on this function, please refer to
https://www.mathworks.com/help/images/ref/imgaussfilt.html?s_tid=doc_ta
Next, utilize the edge() function with the 'Canny' method, which is particularly effective for detecting edges in images with varying intensity:
% Perform edge detection
edges = edge(filteredImg, 'Canny');
If the DIC pattern still overwhelms the edges, consider using morphological operations to refine the edge map. For instance, you can use imopen() to remove small objects:
% Morphological opening
se = strel('disk', 2);
Note: for more information on this function, please refer to
https://www.mathworks.com/help/images/ref/strel.html
cleanedEdges = imopen(edges, se);
Finally, visualize the results to ensure the edges of the cylindrical sample are clearly defined. Adjust the parameters as necessary to optimize the detection for your specific image. Let me know if you have any further questions.