- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anyone can tell me that how can I access the pixel data allocated by IppiMalloc.
I just wondering how to use the pStepBytes variable returned by IppiMalloc. If I just want to access a pixel, can I use pStepBytes as the width of the 2d array.
actually, I need to get the max value from a matrix. how should I do that? I attach some codes to illustrate my doubt.
int nImageSqureStep;
float* pImageSquare = ippiMalloc_32f_C1(szImage.width,szImage.height,&nImageSqureStep);
ippiSqr_32f_C1R(src,szImage.width*4,pImageSquare,nImageSqureStep,szImage);
How should I get access the pixel of pImageSqaure , for example
for (int row=0;row {
for (int col=0;col {
if (pImageSquare[row*nImageSqureStep+col]<)
}
}
it tell me wrong when it was executed and I gurantee that other part code is correct. So I think the problem is how to acess the pixel. and how to use the width is a problem.
Is there any other good way to get max value from the pImageSquare Array?
Thanks.
I just wondering how to use the pStepBytes variable returned by IppiMalloc. If I just want to access a pixel, can I use pStepBytes as the width of the 2d array.
actually, I need to get the max value from a matrix. how should I do that? I attach some codes to illustrate my doubt.
int nImageSqureStep;
float* pImageSquare = ippiMalloc_32f_C1(szImage.width,szImage.height,&nImageSqureStep);
ippiSqr_32f_C1R(src,szImage.width*4,pImageSquare,nImageSqureStep,szImage);
How should I get access the pixel of pImageSqaure , for example
for (int row=0;row
for (int col=0;col
if (pImageSquare[row*nImageSqureStep+col]<)
}
}
it tell me wrong when it was executed and I gurantee that other part code is correct. So I think the problem is how to acess the pixel. and how to use the width is a problem.
Is there any other good way to get max value from the pImageSquare Array?
Thanks.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just fix that with
pImageSquare[row*nImageSqureStep/4+col]
But I am still wondering about the correctness of the above access.
will it bring correct result? nImageSquareStep is larger than the true width of the pImageSquare image?
pImageSquare[row*nImageSqureStep/4+col]
But I am still wondering about the correctness of the above access.
will it bring correct result? nImageSquareStep is larger than the true width of the pImageSquare image?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anyone who can help me with that problem?Thanks.
How to access the pixel in IPP
How to access the pixel in IPP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
float max = *pImageSquare;
float *pTmp;
for ( int row = 0; row < szImage.height; row++ ) {
pTmp = (float *)( (char *)pImageSquare + nImageSquareStep * row );
for ( int col = 0; col < szImage.width; col++ ) {
if ( pTmp[col] > max ) max = pTmp[col];
}
}
but better
float max;
ippiMax_32f_C1R( [ImageSquare, nImageSquareStep, szImage, &max );
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page