Plot intensity minima with improfile
3 次查看(过去 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!