필터 지우기
필터 지우기

BLOCKPROC encountered an error while evaluating the user-supplied function handle, FUN. Caused by: Undefined function or variable 'net'.

조회 수: 3 (최근 30일)
can anyone suggest a way out of this and explain why is this error is occuring.
allcount=Inf;
I = imread('frame1359.jpg');
count=0;
myFilterHandle = @myFilter;
blockyImage = blockproc(I,[20 20], myFilterHandle);
allcount(2,1)=count;
disp(count);
function singleValue = myFilter(blockStruct)
s=(blockStruct.data);
r=imresize(s,[227 227]);
% net is a classifier already trained and loaded
pred=classify(net,r);
if pred =='1'
count=count+1;
end
% this is just for blockproc to keep running this is line (imresize) is not important
%if i dont use this blockproc wont proceed to next iteration.
singleValue=imresize(blockStruct.data,0.5);
end

채택된 답변

Walter Roberson
Walter Roberson 2018년 7월 26일
% net is a classifier already trained and loaded
However, it is not loaded in the workspace of the function myFilter .
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 7월 26일
myFilterHandle = @(blockStruct) myFilter(blockStruct, net);
together with
function singleValue = myFilter(blockStruct, net)
Samir khan
Samir khan 2018년 7월 30일
thanks sir. now i am able to classify the images. thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by