-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplotNewColorMap0_.m
More file actions
59 lines (54 loc) · 2.22 KB
/
Copy pathplotNewColorMap0_.m
File metadata and controls
59 lines (54 loc) · 2.22 KB
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
function [plotH_] = plotNewColorMap0(RDepth, Depth, Map, Labels, tname, Y_cord, X_cord)
% PLOTNEWCOLORMAP0 - Plot detected regions on a depth image (used for
% stacked binary image of the lineaments).
%
% This function creates a new colormap plot to visualize the detected regions
% on a given depth image. The detected regions are highlighted based on their
% labels and are displayed with specific color coding.
%
% Syntax:
% [plotH_] = plotNewColorMap0(RDepth, Depth, Map, Labels, tname, Y_cord, X_cord)
%
% Inputs:
% RDepth - Matrix of the reference depth data.
% Depth - Matrix of the depth image data.
% Map - Matrix containing the detected regions labeled by integers.
% Labels - Array of labels corresponding to the detected regions to be highlighted.
% tname - Title name for the plot.
% Y_cord - Y coordinates for the plot.
% X_cord - X coordinates for the plot.
%
% Outputs:
% plotH_ - RGB image matrix with the detected regions highlighted.
%
% Description:
% The function processes the depth image data to normalize and highlight
% the detected regions specified by their labels. The regions are displayed
% in an RGB format where the intensity is normalized and the regions are
% colored differently from the background.
% Normalize the depth image for visualization
par = max(max((Depth))) - min(min(Depth));
plotH_(:,:,1) = (Depth - min(min(Depth))) / par;
plotH_(:,:,2) = (Depth - min(min(Depth))) / par;
plotH_(:,:,3) = (Depth - min(min(Depth))) / par;
% Find the maximum value in the reference depth data for normalization
normal = max(max(RDepth));
% Loop through each pixel in the map
for i = 1:size(Map,1)
for j = 1:size(Map,2)
% Check if the current pixel belongs to one of the labeled regions
if Map(i,j) > 0 && ~isempty(find(Map(i,j) == Labels, 1))
% Highlight the detected regions
plotH_(i,j,1) = abs(RDepth(i,j)) / normal;
plotH_(i,j,2) = 0;
plotH_(i,j,3) = 1 - abs(RDepth(i,j)) / normal;
end
end
end
% Global variables used in the plot
global XI
global YI
global xv
global yv
% Plot the image (Note: the actual plotting part might be done outside this function)
end