How to convert gstCamera stream to opencv frame?

Thanks in advanced. In jetson-inference, I want to use opencv in detectnet-camera.cpp, the first thing is convert gstCamera stream to opencv frame, as code below:

float confidence = 0.0f;

	while (!signal_recieved)
		// capture RGBA image
		float *imgRGBA = NULL;

		if (!camera->CaptureRGBA(&<b>imgRGBA</b>, 1000))
			printf("detectnet-camera:  failed to capture RGBA image from camera\n");

		// detect objects in the frame
		detectNet::Detection *detections = NULL;

Obviously, should do something about imgRGBA, would any expert tell me how to handle it?

imgRGBA is in float which may not work in OpenCV. You may need imgRGBA to be uint8_t.
This is not right. Please refer to #3.

Please check the following post: