Since the signal seems to be brightest in the green channel, let's just take that channel and get the 5 largest blobs and get their centroids:
greenChannel = rgbImage(:, :, 2);
mask = greenChannel > 128;
mask = bwareafilt(mask, 5);
props = regionprops(mask, 'Centroid');
xy = vertcat(props.Centroid);
hold on;
plot(xy(:, 1), xy(:, y), 'r+', 'LineWidth', 2, 'MarkerSize', 30);
If there might be some dots occluded so that there are only 3 or 4 instead of 5 then replace bwareafilt() by bwareaopen() to filter based on size rather than number.
0 Comments
Sign in to comment.