MATLAB Answers

Divide image into 3x3 pixels?

3 ビュー (過去 30 日間)
Abdullah
Abdullah 2016 年 11 月 27 日
回答済み: Daniel kiracofe 2016 年 11 月 27 日
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 ?

回答 (1 件)

Daniel kiracofe
Daniel kiracofe 2016 年 11 月 27 日
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.

Community Treasure Hunt

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

Start Hunting!

Translated by