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!