Using a user defined fucntion with blockproc
이전 댓글 표시
Is there a mistake in my syntax using blocproc:
Binary1=blockproc(OrigImage,[tileRowSize, tileColSize],@(x) myOperation(hObject, eventdata, handles, x.data));
the function I use "myOperation" is as follows:
function myOperation(hObject, eventdata, handles,tile)
[thresh1, thresh2] = Threshold(hObject, eventdata, handles,tile); %my personal thresholding function
%Create Binary Image
size(tile)
ix=tile;
level=thresh2
ix(ix<level)=0;
ix(ix>level+1)=1;
Im getting
Binary1 =
[]
답변 (2개)
Image Analyst
2015년 1월 15일
0 개 추천
I don't have time to look at it now, but in the meantime, see my blockproc demos, attached.
Iain
2015년 1월 15일
0 개 추천
What does your "myfunction" function output? It looks like it's not producing any output.
댓글 수: 4
Jason
2015년 1월 15일
Image Analyst
2015년 1월 15일
If you have blocks of 25 pixels by 25 pixels, and you move in "jumps" of 25 pixels, then I believe your last block will have only 1 row or column. Thus it may not have a value like the others that had a full block in them.
Jason
2015년 1월 15일
카테고리
도움말 센터 및 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!
