calling one function from another
3 次查看(过去 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
0 个评论
采纳的回答
John Petersen
2013-5-22
You're calling a function GetSumRect(...) that is not defined.
2 个评论
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!