How to plot the intensity profile at 45 degree angle at certin coordinate?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Happy PhD
am 30 Aug. 2019
Bearbeitet: Happy PhD
am 30 Aug. 2019
The maximal intensity is located at coordiante (1064; 662).
I can plot the line profile vertically and horiontally.
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 Kommentare
Akzeptierte Antwort
darova
am 30 Aug. 2019
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 Kommentare
Weitere Antworten (1)
Image Analyst
am 30 Aug. 2019
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 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!