test2.tif (15.3 MB)
Hello,
I modified the sample code and got the attached image.
sample code: jetson_multimedia_api/argus/samples/cudaBayerDemosaic/CudaBayerDemosaicConsumer.cpp
//------------------------------------------------------------------
// Run the CUDA kernel to demosaic the Bayer input into the RGBA output.
cudaBayerDemosaic((CUdeviceptr)(bayerEglFrame.frame.pPitch[0]),
bayerEglFrame.width,
bayerEglFrame.height,
bayerEglFrame.pitch,
bayerEglFrame.eglColorFormat,
(CUdeviceptr)(rgbaEglFrame.frame.pPitch[0]));
if (CUDA_SUCCESS != cuMemcpyDtoH(testMem, (CUdeviceptr)(bayerEglFrame.frame.pPitch[0]), 3264*2464*2))
printf("error: fail cuMemcpyDtoH\n");
if (frame == 100) {
printf("w=%d h=%d, p=%d\n", bayerEglFrame.width, bayerEglFrame.height, bayerEglFrame.pitch);
FILE *fp;
fp = fopen("test.raw","w");
fwrite(testMem, 2, 3264*2464, fp);
fclose(fp);
}
// Return the Bayer frame to the Argus stream.
cuResult = cuEGLStreamConsumerReleaseFrame(
&m_cudaBayerStreamConnection, bayerResource, NULL);
if (cuResult != CUDA_SUCCESS)
{
ORIGINATE_ERROR("Unable to release frame to EGLStream (CUresult %s).",
getCudaErrorString(cuResult));
}
//----------------------------------------------
Attached image is broken image.
I already knew that how to get bayer in no-bypass mode(v4l2src).
But I need bypass mode as this case.
Thanks.