Is there any other way to include those 3 intensity lines into one 3d plot in a smooth way. The one I got (see filter3d image) seems stretched and nothing that I've tried works. Please see the images attached.

1 view (last 30 days)
% 3 intensity profile lines.
x = [884 346 ];
y = [566 566];
x1 = [884 346 ];
y1 = [783 783];
x2 = [888 346];
y2 = [1027 1027];
I1 = imread([pathname,filename]);
I1 = imrotate(I1,270);
% I am rotating so I can see it better and I am cropping it because there is part of the image I am not interested.
figure;
I2 = imcrop(I1,[1075 174 1000 1649]);
imshow(I2,'InitialMagnification',50)
hold on
% create a line to define the farthest distance from each exposure, there are 3 exposures.
plot(x,y,'r-','linewidth',0.1);
plot(x1,y1,'g-','linewidth',0.1);
plot(x2,y2,'b-','linewidth',0.1);
hold off
% calculating the intensity profile and with the average so there is less noise
%%Centerlines
k=14; % Number of points to use in moving average
figure;
hold on
C=improfile(I2,x,y);
% Movmean by default uses a centered mean of window size k
Cma=movmean(C(:,:,3),k);
C1=improfile(I2,x1,y1);
Cma1=movmean(C1(:,:,3),k);
C2=improfile(I2,x2,y2);
Cma2=movmean(C2(:,:,3),k);
plot(Cma,'r-')
plot(Cma1,'g-')
plot(Cma2,'b-')
legend('t = 14 \mus','t = 19 \mus','t = 24 \mus','Location','SouthEast')
hold off
% calculating the 3d plot for the 3 lines
%%3D Plot of averaged intensities
ylocs=(292:1216)';
for i=1:size(ylocs,1)
C3d=improfile(I2,[892,892-500],[ylocs(i),ylocs(i)]);
C3draw(:,i)=C3d(:,:,3);
% Movmean by default uses a centered mean of window size k
Cma3d(:,i)=movmean(C3d(:,:,3),k);
end
% X-locations
xlocs=(0:500)';
% this is the part that belongs to filter3d image
%%Plotting of surface
figure;
surf(ylocs,xlocs,Cma3d,'EdgeColor','none')
  3 Comments
Image Analyst
Image Analyst on 1 Jun 2017
What are you doing? There are no useful comments. Why are you rotating, cropping, and blurring the image. Please add comments to explain what each line of code does and attach the original/input image, and say overall what you are trying to accomplish, like how many curves you want and what they represent.
Shirly S
Shirly S on 12 Jun 2017
Edited: Shirly S on 12 Jun 2017
Thank you guys for replying. I hope the comments are useful. I added the raw image. I am trying to get a normal 3d image. The one I got seems stretched. I am thinking that is because I was only doing a loop for the y-axis. When I tried to do the same but the x-axis it doesn't work.
Thank you!

Sign in to comment.

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!