Plot a heatmap from a matix

8 ビュー (過去 30 日間)
Ahmed Madhun
Ahmed Madhun 2019 年 10 月 25 日
編集済み: Ahmed Madhun 2019 年 10 月 26 日
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 月 26 日
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 日
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 件のコメント
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 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by