File size: 1,565 Bytes
d4035c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function LMdbshowscenes(D, HOMEIMAGES, subimages, showanno)
%
% Shows all the images in the database with annotation.
% This function can be used in combination with LMquery
%
% LMdbshowscenes(D, HOMEIMAGES, subimages, showanno)

%if nargin == 1
%    error('Not enought input parameters. You need to give the path to the images');
%end

Nimages = length(D);
if nargin > 2
    Nx = subimages(2);
    Ny = subimages(1);
else
    Nx = 6; Ny = 5; % will show 6x5 images per figure
end
Dx = 1/Nx; Dy = 1/Ny; 

if nargin < 4
    showanno = 1;
end

i = 0;
while i<Nimages
    figure
    for y = Ny-1:-1:0
        for x = 0:Nx-1
            i = i+1;
            if i>Nimages
                return
            end
            
            axes('position', [x*Dx y*Dy Dx Dy]); % create axis

            if nargin>1
                img = LMimread(D, i, HOMEIMAGES); % Load image

                if showanno
                    scaling = min(1,320/size(img,1)); % scale factor to create thumbnail
                    [annotation, img] = LMimscale(D(i).annotation, img, scaling, 'nearest'); % scale image

                    annotation = LMsortlayers(annotation, img);

                    [h,class] = LMplot(annotation, img); % show image and polygons
                else
                    imagesc(img)
                    axis('off'); axis('equal'); axis('tight')
                end
            else
                [h,class] = LMplot(D(i).annotation); % show image and polygons
                axis('ij')
            end
            drawnow
        end
    end
end