Is there a method to use ‘findpeaks’ to detect bright spots in an otherwise darkimage?
조회 수: 28 (최근 30일)
이전 댓글 표시
I am currently having the problem that if I run findpeaks along the columns of said image, the same spot is being detected multiple times, as it appears as peak in every column.
I am aware that there are ad-on options for 2D peak detection, but I was hoping for a solution using findpeaks.
댓글 수: 0
채택된 답변
Walter Roberson
2021년 6월 14일
편집: Walter Roberson
2021년 6월 15일
you can post process the findpeaks output but it really does not seem to be worth the effort.
islocalmax(img,1) & islocalmax(img,2)
will find 2d peaks.
You might need to do some processing for the case where a peak is the same height for several adjacent spots. You could do a imclose or dilation, and perhaps a bwmorph()
Or you could start with a dilation and then check for local max and then a bwmorph shrink... something like that.
추가 답변 (1개)
Image Analyst
2021년 6월 15일
Show/attach/post your original gray scale image. My guess is that you can threshold to find the bright blobs, then find the centroid and/or weighted centroid with regionprops(). You can also get the mean intensity and the max intensity for each spot using regionprops.. You would not use findpeaks which is used for 1-D signals. Also, using imregionalmax() might not be what you want since this might pinpoint several small regional maxes inside a large spot when you want only one - the weighted centroid. I can give better advice if you attach the actual gray level image you forgot to attach.
See my Image Segmentation Tutorial for a general tutorial about finding bright blobs on dark backgrounds.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!