Store improfile data issue

3 visualizaciones (últimos 30 días)
dan kin
dan kin el 13 de Sept. de 2013
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)

Respuestas (1)

Image Analyst
Image Analyst el 13 de Sept. de 2013
Set the ydir property of the axes to 'normal' or 'reverse' to flip the plot of the data:
set(gca,'YDir','reverse')

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by