Error NoMemory in ippiForegroundHistogramInitAlloc_8u_C3R

Error NoMemory in ippiForegroundHistogramInitAlloc_8u_C3R

I have image 640*480 and 

if I use roiSize > 640*100 then Error NoMemory

RAM 8Gb

IPP 7.1

Why?

Source:

if (!pModel)
pModel = new IppFGHistogramModel ;

pModel->valueQuant = 64;
pModel->changeQuant = 32; /* 32 */
pModel->valueUse = 30; /* 30 */
pModel->valueAll = 50; /* 50 */
pModel->changeUse = 50; /* 50 */
pModel->changeAll = 80; /* 80 */
pModel->updBGChange = 0.0046f;
pModel->updBGRef = 0.0010f;
pModel->brightnessDistortion = 0;
pModel->numFrame = 0;
pModel->shadowBG = 0;
pModel->detectionRate = 0;

IppFGHistogramState_8u_C3R* pState = NULL;

IppStatus status = ippiForegroundHistogramInitAlloc_8u_C3R(pSrc, srcStep, roiSize, pModel, (IppFGHistogramState_8u_C3R**)&pState);

status = NoMemory

16 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Hi Sergey,
The function Allocates memory and initializes a state structure for foreground/background segmentation using histograms.

Are you build 32bit applicaiton? could it because the used memory have beyond (2G)?

I just try. It seems works no problem with dynamic link (ippcv.lib ippi.lib ipps.lib ippcore.lib).

C:\Users\yhu5\Desktop\ipp_issue\ippavx_test\Debug>"C:\Program Files (x86)\Intel\
Composer XE 2013\ipp\bin\ippvars.bat" ia32

C:\Users\yhu5\Desktop\ipp_issue\ippavx_test\Debug>ippavx_test.exe
ippCV AVX (g9) 7.1.1 (r37466) 7.1.1.37466
ippStsNoErr: No errors.

Best Regards,
Ying
C:\Users\yhu5\Desktop\ipp_issue\ippavx_test\Debug>

#include "stdio.h"
#include "stdlib.h"
#include "memory.h"
#include "math.h"
#include "ipp.h"

int main(int argc, char* argv[])
{
ippInit();

const IppLibraryVersion* lib = ippcvGetLibVersion();
printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version, lib->major, lib->minor, lib->majorBuild, lib->build);

int width=640;
int height=480;
int srcStep;

Ipp8u * pSrc = ippiMalloc_8u_C3(width, height, &srcStep);

IppFGHistogramModel* pModel =NULL;

if (!pModel)
pModel = new IppFGHistogramModel ;

pModel->valueQuant = 64;
pModel->changeQuant = 32; /* 32 */
pModel->valueUse = 30; /* 30 */
pModel->valueAll = 50; /* 50 */
pModel->changeUse = 50; /* 50 */
pModel->changeAll = 80; /* 80 */
pModel->updBGChange = 0.0046f;
pModel->updBGRef = 0.0010f;
pModel->brightnessDistortion = 0;
pModel->numFrame = 0;
pModel->shadowBG = 0;
pModel->detectionRate = 0;

IppFGHistogramState_8u_C3R* pState = NULL;
IppiSize roiSize={600,400};
IppStatus status = ippiForegroundHistogramInitAlloc_8u_C3R(pSrc, srcStep, roiSize, pModel, (IppFGHistogramState_8u_C3R**)&pState);

printf("%s\n",ippGetStatusString(status));
}

Hi Sergey,

Could you please upload the test case to show the problem. Just guess if you are building 32bit application and used memory may be beyond 2G?

I did a try , link 32bit IPP 7.1 dynamic library (ippcv.lib ippi.lib ipps.lib ippcore.lib) with below code and it seems everything run ok.

C:\Users\yhu5\Desktop\ipp_issue\ippavx_test\Debug>"C:\Program Files (x86)\Intel\
Composer XE 2013\ipp\bin\ippvars.bat" ia32

C:\Users\yhu5\Desktop\ipp_issue\ippavx_test\Debug>ippavx_test.exe
ippCV AVX (g9) 7.1.1 (r37466) 7.1.1.37466
ippStsNoErr: No errors.

Best Regards,
Ying

#include "stdio.h"
#include "stdlib.h"
#include "memory.h"
#include "math.h"
#include "ipp.h"

int main(int argc, char* argv[])
{
ippInit();

const IppLibraryVersion* lib = ippcvGetLibVersion();
printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version, lib->major, lib->minor, lib->majorBuild, lib->build);

int width=640;
int height=480;
int srcStep;

Ipp8u * pSrc = ippiMalloc_8u_C3(width, height, &srcStep);

IppFGHistogramModel* pModel =NULL;

if (!pModel)
pModel = new IppFGHistogramModel ;

pModel->valueQuant = 64;
pModel->changeQuant = 32; /* 32 */
pModel->valueUse = 30; /* 30 */
pModel->valueAll = 50; /* 50 */
pModel->changeUse = 50; /* 50 */
pModel->changeAll = 80; /* 80 */
pModel->updBGChange = 0.0046f;
pModel->updBGRef = 0.0010f;
pModel->brightnessDistortion = 0;
pModel->numFrame = 0;
pModel->shadowBG = 0;
pModel->detectionRate = 0;

IppFGHistogramState_8u_C3R* pState = NULL;
IppiSize roiSize={600,400};
IppStatus status = ippiForegroundHistogramInitAlloc_8u_C3R(pSrc, srcStep, roiSize, pModel, (IppFGHistogramState_8u_C3R**)&pState);

printf("%s\n",ippGetStatusString(status));
}

Just test, something wrong with the post?

Hi Ying
I am build 32bit applicaiton.
640*480*3 = 921600 byte
My app uses memory beyond (2G)

Ipp8u * pSrc = ippiMalloc_8u_C3(width, height, &srcStep);
Do I have to use the memory allocated IPP?

I uses image from file into buffer

Ipp8u *pSrc = new Ipp8u(640*480*3);

regards
Sergey

Hi Ying

Your test is Ok
I'll try
Ipp8u * pSrc = ippiMalloc_8u_C3(width, height, &srcStep);
in my app

regards,
Sergey

>>...(pSrc, srcStep, roiSize, pModel...

How did you declare these variables / members and what values did they have when the function returned 'No Memory' error?

Note: Just posted and I don't see my it... Is that a new issues with IDZ web-site?

Hi Ying

This id my cide NOW
this is parametr in proc:
BYTE* RGBImage - image
int Width - 640
int Height - 480

...

Ipp8u* _img = NULL;
int stepBytes = 0;
IppiSize _roisize = {Width,Height};
try
{
_img = ippiMalloc_8u_C3(Width, Height, &(stepBytes));
ippiCopy_8u_C3R(RGBImage,stepBytes,_img,stepBytes,_roisize);

ppFGHistogramModel* pModel =NULL;

if (!pModel)
pModel = new IppFGHistogramModel ;

pModel->valueQuant = 64;
pModel->changeQuant = 32; /* 32 */
pModel->valueUse = 30; /* 30 */
pModel->valueAll = 50; /* 50 */
pModel->changeUse = 50; /* 50 */
pModel->changeAll = 80; /* 80 */
pModel->updBGChange = 0.0046f;
pModel->updBGRef = 0.0010f;
pModel->brightnessDistortion = 0;
pModel->numFrame = 0;
pModel->shadowBG = 0;
pModel->detectionRate = 0;

IppFGHistogramState_8u_C3R* pState = NULL;

IppStatus status = ippiForegroundHistogramInitAlloc_8u_C3R(_img, srcStep, _roisize, pModel, (IppFGHistogramState_8u_C3R**)&pState);

status noMemory (((

Can cause an error use IppCopy?
Can cause an error previous use ippiMalloc?

Hi
Sorry
IppStatus status = ippiForegroundHistogramInitAlloc_8u_C3R(_img, stepBytes, _roisize, pModel, (IppFGHistogramState_8u_C3R**)&pState);

Hi Sergey Kostrov
>>How did you declare these variables / members and what values did they have when the function returned 'No Memory' error?

pSrc - pointer
srcStep = 1920

regards
Sergey

Sorry, but I don't see my previous posts here.

Sergey kostrov,

There is an issue that IDZ Engineers are working on. looks like all your replies are going into this page: http://software.intel.com/ru-ru/forums/topic/339676 Please post your replies here

Thanks,
Sridevi

Sridevi Allam Technical consulting engineer - Intel MKL

Hi Sergey Kostrov

Ваш пост
>>...(pSrc, srcStep, roiSize, pModel...

How did you declare these variables / members and what values did they have when the function returned 'No Memory' error?

С уважением,
Сергей

Hi Ying
Thanks
I'm found my error!
I arent free memory before

Regargs,
Sergey

The documentation says that valueUse >= valueAll. Can you try with those numbers changed?

发表评论

登录添加评论。还不是成员?立即加入