- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a very basic question. How do I allocate and access data of an image. I'm failing to see the pStepBytes functionality in allocate functions. I have the following code and I'm having problem.
*******************************************
//Allocate a temp complex image ...
int nStepTempImg (0);
Ipp32fc* pTempImg = r_ippiMalloc_32fc_C1 (nWidth_, nHeight_, &nStepTempImg);
//Now copy the image from input real image into real channel of temp image
int nOutIdx(0), nInIdx(0);
for (int i=0; i < nHeight_; i++)
{
for (int j=0; j < nWidth_; j++)
{
pTempImg[nOutIdx].re = pInImgData[nInIdx];
pTempImg[nOutIdx].im = 0;
nOutIdx ++;
nInIdx++;
}//for (int j=0; j < nWidth; j++)
nOutIdx += nStepTempImg;
nInIdx += nWidthUnwrapped_;
}
*******************************************
Is this how I'm supposed to access the image data ? I've tried other versions too, but I'm getting out of bounds memory access exception. Any help will be much appreciated.
Best,
FAISAL ...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
please take a look on IPP Reference Manual, volume 2: Image and Video Processing, Chapter 2 Intel Integrated Performance Primitives Concepts, article Major Operation Models, part Regions of interest in Intel IPP to get a basic understanding what for step parameter is.
You may also find it useful to search through this forum for questions, there is a chance that similar things already have been discussed there.
Look for example, what I was able to catch in a couple minutes:
Resizing image
Definition of plane and step
Remap function
ippiMalloc_32f_C3 Error in steps
Newbie
IPP Newbie
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
ippiMalloc_ * functions return row step in bytes not in image elements (see doc). So, before the loop you should insert
nStepTempImg/=sizeof(*pTempImg);
Thanks,
Alexander

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page