calling one function from another

2 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by