Hi,
I’m new to Nvidia Jetson platform and Argus.
I have to get image from camera sensor (MIPI CSI) and paint it to gtk window.
Previously the painting was done in qt where the multicamera sample is modified to create an nvbuffer and copy the contents in to a file descriptor from which it would be read to a pointer variable pdata as follows:
UniqueObj frame(iFrameConsumer-> acquireFrame());
iFrame = interface_cast< IFrame>(frame);
//std::cout<<iFrame<<std::endl;
image = iFrame->getImage();
iNativeBuffer = interface_cast<NV::IImageNativeBuffer>(image);
if(!fd18)
{
fd18 = iNativeBuffer->createNvBuffer(STREAM_SIZE, NvBufferColorFormat_ARGB32, NvBufferLayout_Pitch);
}
else if (iNativeBuffer->copyToNvBuffer(fd18) != STATUS_OK)
{
// ORIGINATE_ERROR("Failed to copy frame to NvBuffer.");
}
void *pdata = NULL;
NvBufferParams params;
NvBufferGetParams(fd18, ¶ms);
NvBufferMemMap(fd18, 0, NvBufferMem_Read, &pdata);
NvBufferMemSyncForCpu(fd18, 0, &pdata);
//std::cout<<params.pitch[0]<<std::endl;
int b1 = params.pitch[2];
//std::cout<<"This is the pitch1"<<b1<<std::endl;
sync_obj->setData((unsigned char*)pdata);
My question is how would I get the image frame to a pointer (which i can pass to opencv mat or use for any other purpose) without copying the frame to file descriptor and then copying the fd to pdata - which is not at all efficient.
I know Iam a noob and any help would be apprecieated.
Hi,
My use case is to capture image from a CSI/MIPI camera sensor, use argus to perform some hardware isp functions (Edge enhance, exposure white balance etc) and transfer the frame to an ope cv mat for doing other operations (such as color conversion etc) and to finally stream it to a window (GTK).
After the previously mentioned code segment, the pointer is send to another thread using a signal for doing the post processing using opencv. I have to implement this in a new platform (GTK) while previously qt was used.
Browsing through the forums I came to know there was an object identification sample using open cv (11_camera_object_identification) but for some reason its removed from the installation.
I would like to know if there is some sample I could refer to capture frame using argus and transfer it to open cv mat efficiently with as little memcpy as possible.
I had another problem and would be great if you could give some insight to it.
Im working with the multicamera sample and implemented the opencv mat part successfully.
Now when I try to run a GTK window in the same main program, it hangs.
Tried argus in a separate thread: not working
Tried GTK in separate thread: not working
Without threading, one of the process (ArgusSamples::execute() or gtk::app->run() ) blocks the other, depending on which comes first.