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];
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)