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.

채택된 답변

Walter Roberson
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
ヨナ エマヤ
ヨナ エマヤ 2021년 6월 15일
Thank you for your response.
Using islocalmax like described worked in the desired way.
The first results are very promising. Currently there are still some spots that are not detected (I will try to figure out under which conditions) and others that are detected twice. I will try to do some processing as you described and see if the result improves.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
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.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by