Blockproc with more than one output

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

Answers (1)

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.

Asked:

on 11 Jan 2017

Answered:

on 11 Jan 2017

Community Treasure Hunt

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

Start Hunting!