Divide a matrix into submatrices in MATLAB

后端 未结 3 861
时光说笑
时光说笑 2020-12-12 06:16

I have an RGB image of size 412x550. I want to divide it into sub matrices of size 2x2. I have tried using mat2cell function but it is

3条回答
  •  半阙折子戏
    2020-12-12 06:46

    You should use the function im2col. It is exactly what you need.

    A = rand(412,550);
    B = im2col(A,[2 2]);
    

    The doc is there:

    http://www.mathworks.fr/help/images/ref/im2col.html;jsessionid=4d24325613716d84d4635b4fc636

提交回复
热议问题