calling one function from another

2 visualizaciones (últimos 30 días)
divya
divya el 22 de Mayo de 2013
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

Respuesta aceptada

John Petersen
John Petersen el 22 de Mayo de 2013
You're calling a function GetSumRect(...) that is not defined.
  2 comentarios
divya
divya el 22 de Mayo de 2013
how to define this function...please explain in detail
Image Analyst
Image Analyst el 23 de Mayo de 2013
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.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by