Blockproc with more than one output
Mostrar comentarios más antiguos
Hi, I have been using the blockproc syntax to enable splitting an image up into smaller regions and performing a measurement on each on (fwhm)
myfun = @(block_struct) getFWHM_hexGrid(handles,block_struct.data); %get mean of all FWHM's
I2 = blockproc(image,[HMsize HMsize],myfun);
my function
function fwhmBlock=getFWHM_hexGrid(handles,image)
returns the averaged fwhm over the sub image. I am also wanted to pass back a second metric called 'centroid' and thought I could just make mu function have two outputs
function [centroid,fwhmBlock]=getFWHM_hexGrid(handles,image)
and assign the two outputs in blockproc
[centroid,fwhmBlock] = blockproc(image,[HMsize HMsize],myfun);
but this complains I have two many output variables.
Is it possible to pass back 2 variables from blockproc?
(one of my variables, centroid, is actually a matrix of x & y locations)
Thanks for any help
Respuestas (1)
Walter Roberson
el 11 de En. de 2017
0 votos
If I recall correctly you can return a cell array with as many entries as you like. In practice you would then need paste those together to form the output images.
Categorías
Más información sobre Neighborhood and Block Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!