Find angle between two fitted planes
Show older comments
I want to find the angle between two planes which have been fitted to a set of points (x,y,z); here, x and y are pixel position and z is the intensity value for position (x,y). I used the fit function as below:
For Image-1:
Image1 = double(imread('Image1.png'));
x = 1:size(Image1,1);
y = 1:size(Image1,2);
z= Image1;
[xo,yo,zo] = prepareSurfaceData(x,y,z);
For Image-2:
Image2 = double(imread('Image2.png'));
x1 = 1:size(Image2,1);
y1 = 1:size(Image2,2);
z1= Image2;
[xg,yg,zg] = prepareSurfaceData(x1,y1,z1);
Now, I fit a plane to these image points as following:
% fitted plane for the first image
fc =fit([yo,xo],zo,'poly10','Normalize','on','Robust','Bisquare');
% fitted plane for the second image
fg = fit([yg,xg],zg,'poly10','Normalize','on','Robust','Bisquare');
I plot these fitted planes as following:
figure
h1=plot(fc);
set(h1(1),'Edgecolor','none')
set(h1(1),'FaceAlpha','0.99')
set(h1(1),'FaceColor','green')
hold on
h2=plot (fg);
set(h2(1),'Edgecolor','none')
set(h2(1),'FaceAlpha','0.99')
set(h2(1),'FaceColor',[0.5 0.5 0.5])
hold off
I would like to measure the angle between the fitted planes fc and fg. Could you please suggest how can I measure the angle between them?
Answers (0)
Categories
Find more on Geometric Transformation and Image Registration 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!