Filtering data from an image for surface roughness
4 views (last 30 days)
Show older comments
I'm working on code that takes in an image of the edge of a material, traces the edge, and then (hopefully) applies a Gaussian high pass filter to the data. I have the data from the trace, but I'm just not sure how to apply a filter to it. Here's my current code
function[]= MMtrace2(image)
%creates a trace of an image based on the trace from Photoshop
clc;
mm = imread(image);
BW = im2bw(mm);
BW2 = (BW == 0);
imshow(BW2);
[yy , xx]=find(BW2);
uy = accumarray( xx, yy, [], @mean );
ux = 1:max(xx);
figure;plot(ux,uy,'r','LineWidth',1.5);
end
The resulting image is attached. I'm just trying to get rid of the waviness of the profile (the longer curves), which is why I need the high pass filter.
Thanks
1 Comment
Image Analyst
on 10 Jul 2017
Edited: Image Analyst
on 10 Jul 2017
I fixed it for you this time, but in the future, to learn how to format your code, see this link: http://www.mathworks.com/matlabcentral/answers/13205#answer_18099
You also forgot to attach the image. Please use the green and brown frame icon so we can see what you're talking about.
To use a high pass filter, you can use imfilter() or conv2() or imgradient(). To measure texture or roughness, you can use stdfilt() or entropyfilt().
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!