Compute fun handler for blockproc
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Constantin Alin
el 10 de Mayo de 2018
Comentada: Constantin Alin
el 11 de Mayo de 2018
Hello, i want to compute a function handler for blockproc() like
fun = @(block_struct) ...
FD(block_struct.data) * ones(size(block_struct.data));
A = blockproc(I,[16 16],fun)
to process a imagine I and then calculate Box Counting in every blocks. My question is how to compute handler (fun) to do that ? Thanks in advance.
0 comentarios
Respuesta aceptada
Walter Roberson
el 10 de Mayo de 2018
Make FD a function that accepts one variable that is an array of data, and have it do the box counting on that array.
Just watch out for incomplete blocks: along the bottom edge and the right edge you will get blocks that are not 16 x 16 unless the size of the image happens to be an exact multiple of 16 in each direction.
4 comentarios
Walter Roberson
el 11 de Mayo de 2018
fun = @(block_struct) BoxCountfracDim(block_struct.data);
out = blockproc(img, [16 16], fun, 'trim', false);
imagesc(out);
Más respuestas (1)
Constantin Alin
el 11 de Mayo de 2018
2 comentarios
Walter Roberson
el 11 de Mayo de 2018
BoxCountfracDim produces NaN if all of the entries in the input it is passed are zero. It produces NaN+NaN*i if the sum of the entries is negative.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!