【问题标题】:Quadtree Decomposition - MATLAB四叉树分解 - MATLAB
【发布时间】:2009-12-13 16:41:32
【问题描述】:

如何使用 MATLAB 中的 qtdecomp(Image,threshold) 函数来查找 RGB 图像的四叉树分解

我试过了:

Ig = rgb2gray(I);       % I is the rgb image
S = qtdecomp(I,.27);

但我收到此错误:

??? Error using ==> qtdecomp>ParseInputs
A must be two-dimensional

Error in ==> qtdecomp at 88
[A, func, params, minDim, maxDim] = ParseInputs(varargin{:});

我也收到此错误:

??? Error using ==> qtdecomp>ParseInputs
Size of A is not a multiple of the maximum block dimension

谁能告诉我该怎么做?

【问题讨论】:

    标签: matlab image-processing


    【解决方案1】:

    一个明显的错误...在上面的代码中,您仍然将原始 RGB 图像 I 传递给 QTDECOMP 函数。您必须改为通过Ig

    S = qtdecomp(Ig,.27);
    

    【讨论】:

      【解决方案2】:

      您原帖中的代码有两个问题:
      1)第一个错误是因为您需要将图像的灰度版本Ig提供给qtdecomp函数,而不是彩色版本I

      S = qtdecomp(Ig, .27);
      

      2) 第二个错误是因为函数qtdecomp,图片的大小需要是正方形和2的幂。我建议你在图片编辑器中调整图片大小。例如,如果您的图像是 1500x1300,您可能希望将其调整大小或裁剪为 1024x1024,或者可能是 2048x2048。
      您可以使用以下 MATLAB 命令找到图像灰度版本的大小:

      size(Ig)
      

      要将其裁剪为左上角的 1024x1024,您可以运行以下 MATLAB 命令:

      Ig = Ig(1:1024, 1:1024);
      

      【讨论】:

        猜你喜欢
        • 2014-06-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-08-09
        • 1970-01-01
        • 1970-01-01
        • 2013-05-12
        相关资源
        最近更新 更多