Community
cancel
Showing results for 
Search instead for 
Did you mean: 
why0
Beginner
97 Views

ippiMean_StdDev_8u_C1R in Delphi

Hi,

I am using IPP in Delphi environment and want to compute standard deviation of the image. This is how I try to do this:

roiSize := CreateSize(Source.Width, Source.Height);
Mean := 0;
StdDev := 0;
case Source.PixelFormat of
pf8bit:
begin
pSrc := GetPointer8(Source);
srcStep := GetStep8(Source);

ippiMean_8u_C1R(pSrc,
srcStep,
roiSize,
@Mean
);


ippiMean_StdDev_8u_C1R(pSrc,
srcStep,
roiSize,
@Mean,
@StdDev
);

....

and function declarations :

ippiMean_StdDev_8u_C1R:
function(
const pSrc: PIpp8u;
srcStep: Integer;
roiSize: TIppiSize;
pMean: PIpp64f;
pStdDev: PIpp64f): TIppStatus; stdcall;

ippiMean_8u_C1R, ippiMean_8u_C3R:
function(
const pSrc: PIpp8u;
src1Step: Integer;
roiSize: TIppiSize;
pMean: PIpp64f): TIppStatus; stdcall;

...and addresses assigned:

ippiMean_StdDev_8u_C1R := GetProcAddress(ippidll, 'ippiMean_StdDev_8u_C1R');
ippiMean_8u_C1R := GetProcAddress(ippidll, 'ippiMean_8u_C1R');

========================================================

While calling ippiMean_StdDev_8u_C1R, I keep getting access violation at address 0, but for comparison ippiMean_8u_C1R works fine. Any idea what can be the problem? Thanks a lot in advance. There can be some stupidities in the code, because I am new to the topic.

0 Kudos
5 Replies
Thomas_Jensen1
Beginner
97 Views

First, you can declare TIppiSize = TPoint, and just directly pass Point types (no need for CreateSize).

Next, GetPointer8 must return a pointer to the start of the image buffer, and GetStep8 must return the size in bytes of one scanline.

Also, you must use stdcall in IPP function declarations.

And needless to say, do you check for nil when calling GetProcAddress?

why0
Beginner
97 Views

Thanks! Right, the 'needless to say' proved to be the correct answer. But how can I solve it? The others do load. Is my dll corrupted? I am on XP. And ippiMean_StdDev_8u_C1R is the function name, isn't it?
Igor_B_Intel1
Employee
97 Views

Hi,

ippiMean_StdDev_8u_C1R located in the ippcv library. You try to load it from ippi.

Igor.

why0
Beginner
97 Views

Yeah! It works! Thank you, Igor.
Thomas_Jensen1
Beginner
97 Views

You can view available function names in a DLL or OCX using "Depends", a tool from Microsoft, part of their Windows SDK.

Reply