1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
function plot_beams_and_faces_figure(border_limits, img, faces, fig_handle)
%% plot faces and beams images
% border_limits has coordinates of left bottom and right top coners
xlb=border_limits(1);
ylb=border_limits(2);
xrt=border_limits(3);
yrt=border_limits(4);
[Ny,Nx]=size(img);
xc=linspace(xlb,xrt, Nx);
yc=linspace(ylb,yrt, Ny);
figure(fig_handle);
%% dummy plot just to put axis in the proper directions
plot(xlb,ylb,'.', xrt,yrt, '.');
hold on;
%% colormap
colormap(1-gray);
%% plot ray images
imagesc(xc,yc, img); colorbar;
hold on;
%% plot all faces
Nf=size(faces)(2); % number of faces
for i=1:Nf
hold on;
t=linspace(0,1,100);
xf=faces{i}.vertex1(1) + (faces{i}.vertex2(1)-faces{i}.vertex1(1))*t;
yf=faces{i}.vertex1(2) + (faces{i}.vertex2(2)-faces{i}.vertex1(2))*t;
plot(xf,yf, 'k-');
end
axis('equal');
hold off;
end
|