Z order (Morton Curve) for matrix .and Hausdorff distance.

9 Ansichten (letzte 30 Tage)
Pham Anh
Pham Anh am 23 Mai 2020
Hi everyone, I'm new and I'm doing a photo-processing project to recognize faces.
I have problem calculating the Z order for the matrix. I saw a code about it
function A = mapping(n)
% To create a Morton Scan order matrix
if n == 2
A = [1 2; 3 4];
else
B = mapping(n/2);
A = [B B+(n/2)^2; B+(n/2)^2*2 B+(n/2)^2*3];
end
But when I did it reported an error
>> Zorder(C)
Undefined function or variable 'mapping'.
Error in Zoder (line 6)
B = mapping(n/2);
Im working on Local Start Search algorithm

Antworten (1)

Srivardhan Gadila
Srivardhan Gadila am 26 Mai 2020
From the above information the function mapping calls itself recursively.
So if you simply renamed the function mapping to Zorder without adding more code or without making any other changes then you also have to change the line
B = mapping(n/2);
to
B = Zorder(n/2);
If you have done anything differently than mentioned above in the answer, then can you provide more details & reproduction steps?

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by