Hello All, I am trying to find the locations of minimum intensity values (the minimum values of the local peaks) and their pixel locations. I would like to find the pixel location of the minimum values between pixels 100 and 200 (x-axis) and the distance between these two points in terms of pixels. I have included the code that is just the profile across the red line.
clc clear all
GrayImage = rgb2gray(imread('index.png'));
x1 = [0 225]; y1 = [110 110];
subplot(2,2,1); imshow(GrayImage); title('Original Image'); hold on line(x1,y1,'color', 'r'); hold off
subplot(2,2,2); improfile(GrayImage,x1,y1,225);

 채택된 답변

Image Analyst
Image Analyst 2015년 2월 2일

0 개 추천

You can use a function called imregionalmin().

댓글 수: 2

Cy
Cy 2015년 2월 3일
Hi Image Analyst, Thanks for always providing an answer. In this case, is there a way to avoid outputting a binary matrix? I am just looking for the locations of the minimums between two pixel values (Between 100 pixels and 200 pixels) and the pixel distance between them.
You can use find on the array:
localMins = imregionalmin(array);
[rows, columns] = find(localMins);

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

추가 답변 (0개)

카테고리

질문:

Cy
2015년 2월 2일

댓글:

2015년 2월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by