Borrar filtros
Borrar filtros

morton scanning for image size of 256*256 .

4 visualizaciones (últimos 30 días)
vishnu
vishnu el 2 de Mzo. de 2012
i found out this as for 4*4 matrix from matlab central
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
----------------------------------------------------
i require to do this for whole image with out looping infinitely ..
can you please any one give the way by block processing
  2 comentarios
vishnu
vishnu el 2 de Mzo. de 2012
i get infinite loop and can able to proceed it .. please any one help ?
vishnu
vishnu el 9 de Abr. de 2012
how can we create an morton order?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 2 de Mzo. de 2012
  6 comentarios
vishnu
vishnu el 7 de Mzo. de 2012
but i get error like this .. Maximum variable size allowed by the program is exceeded.
Error in ==> morton at 10
linind4=(1:4^n)-1; %start index count for array at zero
.. i am totally confused sir.. i take a image and those image values to be an array representation according to morton order .. its an assignment for me .. please help me .. i want to learn about this
Walter Roberson
Walter Roberson el 7 de Mzo. de 2012
For the purpose of your morton code, n should be 8.
But that doesn't have anything to do with the code I referred you to, which is the code you asked about in your comment here. Do not use both routines together: only use one of them.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by