Store improfile data issue
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
I am using the code below to get the intensity profile plot data (Typically zero is taken to be black, and 255 is taken to be white) and I have a a problem that I will appreciate the help:
- The improfile plotted on the image is a mirror of the the data stored intensitySet (I wish my stored profile to start from left to right). Therefore, why and how can it be fixed?
Thanks
Code:
clc;
clear;
I = imread('liftingbody.png');
xline = [100, 300];
yline = [300, 300];
% line([x1,x2],[y1,y2]), not line([x1,y1],[x2,y2]);
imshow(I)
hold on;
line(xline,yline)
improfile(I,xline, yline);
[cx,cy,YofIntensity]=improfile(I,xline, yline);
Xindex = zeros(size(YofIntensity), 1, 'double')
for i=1:size(YofIntensity)
Xindex(i)=i;
end
intensitySet = horzcat(Xindex, YofIntensity)
figure(2);
plot(Xindex, YofIntensity)
댓글 수: 0
답변 (1개)
Image Analyst
2013년 9월 13일
Set the ydir property of the axes to 'normal' or 'reverse' to flip the plot of the data:
set(gca,'YDir','reverse')
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!