I implemented the minutia heat map presented in this paper (page 7): https://arxiv.org/pdf/1909.09901.pdf
The result is that i have 6 matrixes and i am looking for a way to plot these as shown in the paper (same page), like this:
Basically, the low values is presented in dark, and it gets lighter when it increase.

댓글 수: 5

darova
darova 2019년 10월 25일
What about pcolor?
Katie
Katie 2019년 10월 25일
pcolor, image, imagesc, imshow, or heatmap could all give you results that look similar to those in the paper figure you've shared. pcolor doesn't exactly color grid locations in accordance to the value at that grid location. Instead, it's doing a bilinear interpolation based on the colors at the verticies of that grid cell. There's some discussion about the difference between pcolor and image here: https://www.mathworks.com/matlabcentral/answers/37049-removing-grid-edge-lines-in-pcolor-figure
If you're set on using heatmap to plot your matricies, you could do a 2 by 3 subplot setup with the 'gray' colormap (or a custom colormap) and with the grid turned off.
subplot(2,3,1)
heatmap(x1,'Colormap',gray,'GridVisible','off')
Thanks it seems to work, however, it sees to not be accurate. Because all my 6 matrixes are different, but when i use:
heatmap(Mx, 'Colormap',gray,'GridVisible','off'));
all the figures are the same, any idea of why this happen ?
Make range for color axis the same for each figure
min = % minimum of 6 matrix
max = % maximum of 6 matrix
caxis([min max])
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
편집: Ahmed Madhun 2019년 10월 26일
Sorry didn't get you comment: how to apply that for my code ?
% Function to create the HeatMap matrix of a minutia set in "TestData" file
function HeatMapCreator()
% Start plotting minutia
[X, Y, A] = GetMinData("TestData");
% Minutia 1 has X1, Y1, and A1 => X and Y is the position and A is the angle between 0-359
% Count Minutiea
n = length(X);
% set Width and Hight
W = 600;
H = 750;
K = 6;
% Create the matixes
MM = cell(K, 1);
M = zeros(H,W);
% Define the gussian paramater
GP = 2*2^2;
% Go throw each pixel
for k = 1:6
for i = 1 : W
for j = 1 : H
Hijk = 0;
for t = 1 : n
Xt = X(t);
Yt = Y(t);
At = A(t);
%Calculate Cs
ED = sqrt((i-Xt)^2+(j-Yt)^2);
Cs = exp(-ED/GP);
%Calculate Co
DO = At - (2 * k * pi / K);
if (DO < -pi) || (DO > pi)
DO = 2 * pi - DO;
end
Co = exp(-DO/GP);
Hijk = Hijk + (Cs * Co);
end
M(i,j) = Hijk;
end
end
MM{k} = M;
end
% Show the 6 figures
for k = 1:6
figure(k)
heatmap(MM{k},'Colormap',gray,'GridVisible','off');
end
end
Comment: I set the Gussian paramater to test weather it works or not.

댓글을 달려면 로그인하십시오.

 채택된 답변

darova
darova 2019년 10월 26일

0 개 추천

You are using H for rows and W for columns
M1 = zeros(H,W);
% ...
for i = 1 : W
for j = 1 : H
% ...
M1(i,j) = Hijk; % looks like mistake
You can use cells to create 6 matrices automatically
MM = cell(6,1);
M = zeros(H,W);
for k = 1:6
for i
for j
for t
% do stuff
end
% ...
M(i,j) = %...
end
end
MM{k} = M;
end
After you found max and min values (global) use loop to visualize
for k = 1:6
figure(k)
heatmap(MM{k});
caxis([minx maxx])
colormap gray
end

댓글 수: 11

Yeah, i saw the mistake of the i and j, and corrected it.
But how do you define the minx and maxx for:
caxis([minx maxx])
darova
darova 2019년 10월 26일
Find max value of each matrix and choose biggest. Do the same for minimum
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
편집: Ahmed Madhun 2019년 10월 26일
Not really, no value is now displayed on the heatmap figures at all.
I change my code as you advised:
minV = 0;
maxV = 0;
for k = 1:6
for i = 1 : W
for j = 1 : H
Hijk = 0;
for t = 1 : n
Xt = X(t);
Yt = Y(t);
At = A(t);
%Calculate Cs
ED = sqrt((i-Xt)^2+(j-Yt)^2);
Cs = exp(-ED/GP);
%Calculate Co
DO = At - (2 * k * pi / K);
if (DO < -pi) || (DO > pi)
DO = 2 * pi - DO;
end
Co = exp(-DO/GP);
Hijk = Hijk + (Cs * Co);
end
M(i,j) = Hijk;
end
end
MM{k} = M;
% Get the maximum and minimum cell from all matrixes
if minV > min(M(:))
minV = min(M(:));
end
if maxV < max(M(:))
maxV = max(M(:));
end
end
for k = 1:6
figure(k)
heatmap(MM{k})
caxis([minV maxV])
colormap gray
end
the result is:
However, if i use the old code to display the heatmap as:
heatmap(MM{1},'Colormap',gray,'GridVisible','off');
the result is:
But this is equal for all matrixes!, which is not correct as all matrixes are different!
darova
darova 2019년 10월 26일
Is color range caxis the same for each matrix?
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
편집: Ahmed Madhun 2019년 10월 26일
Yes, because i only store the highest and loweat value of all matrixes.
darova
darova 2019년 10월 26일
Please attach the data
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
Here is it in a .mat format, that contains X, Y, A. => X(1), Y(1) and A(1) is for the same object.
There is difference but only in intensity
for k = 1:5
subplot(3,2,k)
% figure(k)
h = pcolor(MM{k}-MM{k+1});
set(h,'edgecolor','none');
% caxis([minV maxV])
colormap gray
end
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
Not sure, because according to the paper. If it's implemented correctly each heat map should highlight only minutia in the same degree range.
darova
darova 2019년 10월 26일
편집: darova 2019년 10월 26일
Can you attach a screenshot or something? The file is too large, can't donwload .pdf (i have low internet speed)
Ahmed Madhun
Ahmed Madhun 2019년 10월 26일
The paper is only 8 Mb. You can find it if you search on google for: "Learning a Fixed-Length Fingerprint Representation"

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품

질문:

2019년 10월 25일

편집:

2019년 10월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by