Plot intensity minima with improfile
조회 수: 1 (최근 30일)
이전 댓글 표시
I currently have code that calculates the gradient along line segments I've drawn on an image and plots them using improfile. How can I retrieve the coordinates of the improfile minima? Even better, how can I also plot them on the graph as points? Any help would be greatly appreciated!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151658/image.png)
for j = 1:10
points_x(j) = (x(1) * j + x(2) * (11 - j))/11;
points_y(j) = (y(1) * j + y(2) * (11 - j))/11;
line_x(j) = points_x(j) - x(1);
line_y(j) = points_y(j) - y(1);
v = [line_x(j), line_y(j)];
normal_x = linspace(points_x(j) + v(2), points_x(j) - v(2), 200);
normal_y = linspace(points_y(j) - v(1), points_y(j) + v(1), 200);
subplot(5, 2, j);
improfile(I, normal_x, normal_y), grid on;
title(['Voxel Gradients along Ray ' num2str(j) ' '])
xlabel('x')
ylabel('y')
zlabel('Intensity')
end
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!