Quadtree decomposition

余生颓废 提交于 2019-12-12 04:46:22

问题


I tried the quadtree decomposition using the following code, but every time I am getting an error.

>> I=imread('hyd.tif');

>> S=qtdecomp(I)

Or

>> I=imread('hyd.tif');

>> S=qtdecomp(I,.27)

Error:

??? Error using ==> qtdecomp>ParseInputs at 145

A must be two-dimensional

Error in ==> qtdecomp at 88

[A, func, params, minDim, maxDim] = ParseInputs(varargin{:});

回答1:


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);

Also make sure that your image dimensions are of a power of 2 or else the quadtree decomposition algorithm will not work.



来源:https://stackoverflow.com/questions/23355462/quadtree-decomposition

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!