0

Is there a way to split an image into different boxes and run GLCM on each separate box? E.g. split a 1000 x 1000 image into 50 20 x 20 boxes.

I'm looking to pinpoint regions of an image which show homogeneity - and then localise my analysis. I suspect that you can use blockproc to do this, but I'm not sure how to write the 'fun' function so that it runs the GLCM code. Many thanks.

Tonechas
  • 13,398
  • 16
  • 46
  • 80
Mike Miller
  • 253
  • 6
  • 18

1 Answers1

0

Maybe like this? I don't own the Image Processing Toolbox, so I can't try it...

for k = 1:50
  for l = 1:50
    G(k,l) = graycomatrix(A((k-1)*20+1:k*20, (l-1)*20+1:l*20));
  end
end

By the way – when you split a 1000x1000 image into 20x20 blocks, you'll end up with 2500 blocks.

dasdingonesin
  • 1,347
  • 1
  • 10
  • 16