How to plot the intensity profile at 45 degree angle at certin coordinate?
8 ビュー (過去 30 日間)
古いコメントを表示
The maximal intensity is located at coordiante (1064; 662).
I can plot the line profile vertically and horiontally.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236429/image.png)
My problem is finding the start and end coordinate from the maxima point in the image and plotting this hoizontal line at 45 degree angle instead. i want to measure the size of the rectangle, rotated 45 degree. Any idea how to find those coordiantes?
Edit: correcting spelling.
0 件のコメント
採用された回答
darova
2019 年 8 月 30 日
Simple example
clc,clear
I = imread('image.png');
x = 900:1150; % x coordinate ( columns )
y = round( tand(45)*x )-400; % y coordinate ( rows )
subplot(2,1,1)
imshow(I)
hold on
plot(x,y,'-r')
hold off
axis on
subplot(2,1,2)
ind = sub2ind(size(I),y,x); % indices of pixels
plot(I(ind))
0 件のコメント
その他の回答 (1 件)
Image Analyst
2019 年 8 月 30 日
You can use improfile(), however that will get you the profile along one line only. What I'd actually recommend is to use the Radon Transform which will get you a projection along any angle or set of angles you want, and then you can just get the width by looking at the FWHM of the projection.
Attached is a similar application (not exact) using radon(). Once you see what it's doing I think you'll be able to modify it. Not including any fancy graphing stuff it should only be 3 lines of code - one to radon, and two to find() to find the FWHM.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!