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!