MATLAB Answers

0

Divide image into 3x3 pixels?

Asked by Abdullah on 27 Nov 2016
Latest activity Answered by Daniel kiracofe on 27 Nov 2016
I hade used The Image Processing Toolbox function blockproc and i make the block size 3x3 it works on very small images, but on big images it take really long...Is there any faster way to do that ?

  0 Comments

Sign in to comment.

1 Answer

Answer by Daniel kiracofe on 27 Nov 2016

Depends. First, define "small" and "big". Do you mean it's okay for 10x10 but too slow for 1000x1000? Or does big mean 100,000 x 100,000? Depending on the amount of memory in your machine and whether you are using 32 or 64 bit matlab, there is some image size above which you are probably getting slowed down by memory usage, whereas below that it is the CPU that is limiting.
For 32 bit matlab, you'd probably start hitting memory limits around a 30,000 x 30,000 pixel image, assuming 3 bytes per pixel.
If you hitting memory limits, use the src_filename to only read one block of the file in at a time.
If you are hitting CPU limits, then the only option is to optimize the function that you are calling from blockproc(). Suggest to use the profiling tool to see what portions of your function are taking the most time and then go from there.

  0 Comments

Sign in to comment.