四叉树分解 [英] Quadtree decomposition
本文介绍了四叉树分解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用以下代码对四叉树进行分解,但是每次遇到错误时都如此.
I tried the quadtree decomposition using the following code, but every time I am getting an error.
>> I=imread('hyd.tif');
>> S=qtdecomp(I)
或
>> I=imread('hyd.tif');
>> S=qtdecomp(I,.27)
错误:
??? Error using ==> qtdecomp>ParseInputs at 145
A must be two-dimensional
Error in ==> qtdecomp at 88
[A, func, params, minDim, maxDim] = ParseInputs(varargin{:});
推荐答案
罪魁祸首是由于您的图像为彩色或RGB.使用该算法之前,请尝试将图像转换为灰度.
The culprit is due to your image being in colour or RGB. Try converting the image to grayscale before using the algorithm.
I = imread('hyd.tif');
Igray = rgb2gray(I);
S = qtdecomp(Igray);
还请确保您的图片尺寸为2的幂,否则四叉树分解算法将不起作用.
Also make sure that your image dimensions are of a power of 2 or else the quadtree decomposition algorithm will not work.
这篇关于四叉树分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文