-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowImage.m
44 lines (38 loc) · 1.43 KB
/
showImage.m
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
function done = showImage(imgObj, imgName, showBB, showThin, purgeInvalid )
fig = figure; set(fig, 'Visible', 'on');
hold on;
fused = imfuse(imgObj.rawImage, imgObj.bwImgThickDna);
if (showThin)
fused = imfuse(fused, imgObj.bwImgThinnedRemoved);
end
imshow(fused);
viscircles(imgObj.centers, imgObj.radii, ...
'LineWidth', 0.5, 'EnhanceVisibility', false);
rad = ones(length(imgObj.region),1);
viscircles(imgObj.region, rad,...
'LineWidth', 0.5, 'EnhanceVisibility', false);
% for purged files, the purge object is transposed, so take another
% dimension.
if (purgeInvalid)
text(imgObj.region(imgObj.purged,1), imgObj.region(imgObj.purged,2), ...
num2str ((1: size(imgObj.purged,2))'), 'FontSize', 6);
else
text(imgObj.region(:,1), imgObj.region(:,2), ...
num2str ((1: size(imgObj.region,1))'), 'FontSize', 6);
end
if (showBB)
for dnaIndex=1:size(imgObj.dnaList,2)
curr = imgObj.dnaList{dnaIndex};
if curr.isValid == 1
thisBB = curr.bBox.BoundingBox;
rectangle('Position', thisBB,...
'EdgeColor','yellow', 'LineWidth', 1)
end
end
end
hold off;
imgName2 = [imgName '_detectedObjects.png'];
saveas(gcf,imgName2);
%k = waitforbuttonpress();
close;
end