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
回答(1 个)
Walter Roberson
2017-1-11
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Neighborhood and Block Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!