Morton scanning ?

i am long days itslef looking for morton scanning . but i do not suceed to create morton matrix for an image ...
here is some code for 4*4 which i referred ..
clc;
clear all;
close all ;
n=2;
ind=morton(n);
a=reshape(1:4^n,2^n,2^n);
disp(a)here is the matlab function
function ind=morton(n);
% MORTON(N) return the morton permutation order for array of size 2^N
% e.g.
% n=2;
% matrix size is 2^n
% ind=morton(n);
% d=fix(rand(2^n,2^n)*10);
% disp(d)
% disp(d(ind))
linind4=(1:4^n)-1; %start index count for array at zero
ind4str=dec2base(linind4,4); %convert indices to base-4
b1=dec2bin(str2num(ind4str(:,1))); %split each base-4 into two base-2numbers
b2=dec2bin(str2num(ind4str(:,2)));
rb=[b1(:,1) b2(:,1)]; %the rows are given by the first bits of b1 and
b2
cb=[b1(:,2) b2(:,2)]; %the columns are given by the second bits of b1 and b2
r=bin2dec(rb)+1; %convert the row from bit to decimal
c=bin2dec(cb)+1; %convert column
ind=[2^n*(c-1)+r]'; %make a linear row index into array for easyaddressing
%morton.m ends
if any one knows how to create for a image please help me

5 comentarios

vishnu
vishnu el 9 de Mzo. de 2012
any program which convert the image into vectors of morton order is to be done
vishnu
vishnu el 14 de Mzo. de 2012
please i am near to the output .. i don no how to use it for my required image as for morton scanning? please help me
vishnu
vishnu el 15 de Mzo. de 2012
please anybody knows help me
vishnu
vishnu el 15 de Mzo. de 2012
its an urgent work please
Walter Roberson
Walter Roberson el 20 de Mzo. de 2012
http://www.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency

Iniciar sesión para comentar.

Respuestas (0)

La pregunta está cerrada.

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Mzo. de 2012

Cerrada:

el 3 de En. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by