How to detect peaks in laser strip
3 次查看(过去 30 天)
显示 更早的评论
I = imread('1.jpg'); z = im2bw(I); skel = bwmorph(z,'skel',Inf); imshow(skel)
I want to detect middle of laser strip in image 1, called peak detection.. i tried thinning and morphological operations, but it exactly doesn't work and gives image 2.. I want single middle line.. So, which function or logic or code may be applied, please suggest me...
0 个评论
采纳的回答
Image Analyst
2012-11-19
编辑:Image Analyst
2012-11-19
I'd just scan down line by line, determining the center on a line-by-line basis. You could just threshold and determine the center that way, or, if it has a nice non-saturated profile, use something like a Savitzky-Golay filter (a sliding window polynomial fit, sgolay() is in the signal processing toolbox) to find the peak. The Signal Processing Toolbox also has a findpeaks() function. Then make groups where the column of the center doesn't move much from line to line. Then fit each group to a line with polyfit().
2 个评论
更多回答(1 个)
Harshit
2012-11-19
It is not possible due to noise. Although if you just want a line use hough transform to get different lines and then select the biggest line.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!