hilbertCurve

버전 1.0.1.0 (2.59 KB) 작성자: Kenny Kim
Convert 2D data to 1D data and back easily by applying Hilbert curve transformation
다운로드 수: 185
업데이트 날짜: 2018/7/6

라이선스 보기

The benefit of Hilbert curve transformation is that the 1D data can be downsampled or upsampled without worrying about whether the 2D coordinate of the data point changes. Hilbert curve is designed in such a way that the absolute index of the data point does not matter; only the relative index compared to the whole data size matters.

Consists of three files:

hilbertCurve takes in 2D data and outputs it as 1D data.
hilbertCurveRev takes in 1D data and outputs it as 2D data.
hilbertCurveExample gives examples of using the functions.

Example:

% toy data
rowLen = 256;
data = zeros(rowLen,rowLen);
for x = 1:rowLen
for y = 1:rowLen
data(x,y) = exp(-(0.125/rowLen)*((x-(rowLen+1)/2)^2+(y-(rowLen+1)/2)^2));
end
end

% transform to hilbert curve
transData = hilbertCurve(data);

% reduce dimensionality
reduceRatio = 16; % has to be power of 4
transData = downsample(transData,reduceRatio);

%%%%% this is where you would place any of your analysis scripts %%%%%

% reverse transform to 2D
twoDimData = hilbertCurveRev(transData);

% plot
figure('Position',[100 100 1000 400]);
subplot(1,2,1);
imagesc(data,[0 1]);
subplot(1,2,2);
imagesc(twoDimData,[0 1]);

인용 양식

Kenny Kim (2024). hilbertCurve (https://www.mathworks.com/matlabcentral/fileexchange/67957-hilbertcurve), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Hilbert and Walsh-Hadamard Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.1.0

Adding image and putting an example on description. No change to actual code.
another minor change to description (just spacing)
minor change to description
minor change to description

1.0.0.0