Load an image and divide it into 8x8 matrices

1 回表示 (過去 30 日間)
Juliano Oliveira
Juliano Oliveira 2018 年 12 月 19 日
編集済み: Mark Sherstan 2018 年 12 月 19 日
I need to load an image with random dimension and split it into several 8x8 matrices.
I tried with:
[A, map] = imread('arq.jpeg');
[m,n,o] = size(A);
c = mat2cell(A, m*ones(1,8), n*ones(1,8));
But I got this error:
Number of input vector arguments, 2, does not match the input matrix's number of dimensions, 3.
How can I fix this to work with RGB images?

回答 (1 件)

Mark Sherstan
Mark Sherstan 2018 年 12 月 19 日
編集済み: Mark Sherstan 2018 年 12 月 19 日
Refer to the code here. You are having the errors as you are missing the third dimension of the matrix (the color space). The code I refernced will show you how to solve the issue.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by