how to process only certain blocks using blockproc?

I have used blockproc to apply a function on certain blocks (that satisfya condition). I want to know how do i store the information about which blocks have been processed and which have been skipped.

2 comentarios

Matt J
Matt J el 4 de Feb. de 2019
Do the blocks overlap?
eram fatima
eram fatima el 4 de Feb. de 2019
no

Iniciar sesión para comentar.

 Respuesta aceptada

Matt J
Matt J el 4 de Feb. de 2019

0 votos

You could run blockproc a 2nd time with a block function that returns true/false depending on whether the condition was satisfied.

Más respuestas (1)

Matt J
Matt J el 4 de Feb. de 2019
Editada: Matt J el 4 de Feb. de 2019
If the blocks don't overlap, I would recommend using mat2tiles (Download) instead of blockproc.With mat2tiles, you can distribute the image blocks into cell array cells, and then use cellfun
C=mat2tiles(yourImage,block_size);
[output1,output2]=cellfun(@yourBlockFunction,C,'uni',0)
The advantage, aside from speed, is that cellfun will let @yourBlockFunction return multiple output argument, so you don't have to call it twice.

Etiquetas

Preguntada:

el 4 de Feb. de 2019

Comentada:

el 4 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by