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 次查看(过去 30 天)
显示 更早的评论
% 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 个评论
Image Analyst
2017-6-1
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!