calling one function from another

조회 수: 2 (최근 30일)
divya
divya 2013년 5월 22일
here is a program which calculates the image integral
function IntegralImages = GetIntergralImages(Picture)
% Make integral image from a Picture
% Convert the Picture to double
% double instead of im2double can also be used)
Picture=double(Picture);
% Make the integral image for fast region sum look up
IntegralImages.ii=cumsum(cumsum(Picture,1),2);
IntegralImages.ii=padarray(IntegralImages.ii,[1 1], 0, 'pre');
% Make integral image to calculate fast a local standard deviation of the % pixel data
IntegralImages.ii2=cumsum(cumsum(Picture.^2,1),2);
IntegralImages.ii2=padarray(IntegralImages.ii2,[1 1], 0, 'pre');
% Store other data
IntegralImages.width = size(Picture,2);
IntegralImages.height = size(Picture,1);
Mean4=OneScaleObjectDetection( IntegralImages,1, 1, 1,1)
i WANT TO CALL FUNCTION *OneScaleObjectDetection FROM THIS PROGRAM BUT ITS GIVES ME ERROR *
Undefined function 'GetSumRect' for input arguments of type 'struct'.
*_Error in OneScaleObjectDetection (line 6)
mean = GetSumRect(IntegralImages,x,y,w,h);
Error in GetIntergralImages (line 40)
Mean4=OneScaleObjectDetection( IntegralImages,1, 1, 1,1)_*
THE FUNCTION OneScaleObjectDetection IS AS FOLLOWS
function [x,y]=OneScaleObjectDetection( IntegralImages,x, y, w,h)
% Calculate the mean
InverseArea = 1 / (w*h);
mean = GetSumRect(IntegralImages.i1,x,y,w,h);
% Use the mean and squared integral image to calculate the grey-level
% Varianceiance, of every search window
Variance = GetSumRect(IntegralImages.i2,x,y,w,h)*InverseArea - (mean.^2);
% Convert the Varianceiation to Standard Deviation
Variance(Variance<1)=1; StandardDeviation =sqrt(Variance);
CAN ANYBODY HELP TO RESOLVE THE ERROR

채택된 답변

John Petersen
John Petersen 2013년 5월 22일
You're calling a function GetSumRect(...) that is not defined.
  댓글 수: 2
divya
divya 2013년 5월 22일
how to define this function...please explain in detail
Image Analyst
Image Analyst 2013년 5월 23일
We don't why you're calling these functions, or if you ever got them somehow. We have no idea if a friend wrote them for you, or if you wrote them, or if you downloaded then, or where they reside if you even do have them. And if they do exist, are they on your search path. Why don't you search your entire hard drive for those function names, both in filenames and inside m-files?
I don't even know if the misspelling of GetIntergralImages is intentional or not.

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by