- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
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.
Enlace copiado
3 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
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?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
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
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
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 );
Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla