matlab對圖像實現maxpooling

fun = @(block_struct) max(block_struct.data(:));

b = blockproc (a, [X Y], fun);

 

 

a=rand(5000);

X=4; Y=4; %window sizes

tic

fun = @(block_struct) max(block_struct.data(:));

b = blockproc (a, [X Y], fun);

toc

%Elapsed time is 19.764354 seconds.

tic

b=sepblockfun(a,[X,Y],'max');

toc

%Elapsed time is 0.092457 seconds.

 

 

https://www.mathworks.com/matlabcentral/answers/409032-how-do-i-compute-the-maxpool-of-a-image-let-us-say-stride-of-2-2-on-a-mxn-matrix

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章