Any way to only capture still images? And nvarguscamera does not respond to properties

Hello,

I am using a Jetson Xavier NX with RPi Camera v2.1 (both NoIR and regular) to develop a microscopy application. The only way to take pictures seems to be using GStreamer and saving frames. But is there any way to capture only still images, without launching a stream or video feed from the sensor? When I use the video mode, I can’t use the full abilities of the RPi camera.
I have been experiencing a lot of issues with noise and extremely poor image quality. I saw some of the earlier posts about this issue and I am trying to perform proper tuning for the camera. Also unlike most applications here which are in robotics, ours is in microscopy and I need complete control of imaging parameters with close to zero automatic features. So, I was trying to feed in exposure and white balance settings in the GStreamer string using nvarguscamera properties but it is not reflected in the images. For example, even after setting an exposure time of 0.6 seconds, the video feed output of the GStreamer was running at 20-21 fps. The edge enhancement effects are very visible even after setting it to off. What can I do about this?

hello amey.chaware,

it looks you’d two question here, still image capture and image quality.

  • still image capture,

you may refer to [Multimedia API Sample Applications], i.e. 09_camera_jpeg_capture, to perform image capture as JPEG file.
or, there’s Argus samples, Argus/samples/oneShot/, you may refer to, it captures a single image from a camera device and write to a JPG file.



  • image quality.

please also refer to Topic 139727, there’s update to include some tuning parameters to adjust the noise reduction for NX platforms.
you may download the attachment, Topic139727_Jul09.zip. please replace libnvodm_imager.so binary to apply the changes. thanks

Hi Jerry,

Thanks so much for the quick reply! I will build the one-shot sample and evaluate how it does.
EDIT: I am getting the following error and the preview window is completely blank:

Error generated. main.cpp, execute:390 Failed to get sensor modes
(Argus) Error InvalidState:  (propagating from src/eglstream/FrameConsumerImpl.cpp, function streamEventThread(), line 135)
(Argus) Error InvalidState:  (propagating from src/eglstream/FrameConsumerImpl.cpp, function streamEventThreadStatic(), line 177)

The code does not stop executing but the preview window is blank.

About image quality, thanks for the reference. I will use the imager binary you have provided. But that is not what I was referring to. I think that the Gstreamer input that I am providing is not matched in the output.

For example. I provided the following command:

nvarguscamerasrc sensor-id=0 tnr-mode=2 tnr-strength=1.000000 ee-strength=-1.000000 ee-mode=0 wbmode=0 exposuretimerange="600000000 600000001" gainrange="1 1.000001" ispdigitalgainrange="1 1" aeantibanding=1 aelock=false awblock=false ! video/x-raw(memory:NVMM), width=(int)3264, height=(int)2464, format=(string)NV12, framerate=(fraction)21/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)1200, height=(int)906, format=(string)BGRx ! appsink

So here, I expect the exposure time to be a little larger than half a second. So the video should not be able to give more than 2 fps. But the video generated by this command still provides a feed of 20-21 frames a second. Also, I am able to save almost 7-8 jpeg images a second in burst mode with this command. So clearly, my explicit request for the exposure time has not been followed. Am I doing anything wrong?

hello amey.chaware,

please resolve below error while camera initialization.

Error generated. main.cpp, execute:390 Failed to get sensor modes

due to camera stack has put into an InvalidState, you may using ctrl^c to force stop the camera service to exit the application.

please ensure you did not assign the settings beyond the max or min capability.
there’s device tree property to define that, for example, min_exp_time and max_exp_time.
BTW,
you may enable argus_camera application, which has UI to configure camera controls, and you may see the results in real-time.

Hi Jerry,

I did Ctrl+C out of course when I saw the black window. That’s okay. I don’t understand how to resolve the error. I am running the camera initialization, I am just using the sample code. I used the -h flag to see all the available properties, but there is no device tree or min_exp_time or max_exp_time. As far as I understand, the application is not able to see which sensor modes are available (nvarguscamerasrc lists 5 of them), can you tell me in detail how to solve this issue? Can you also tell me where I can find the argus_camera application and how to enable it?

Thanks.

hello amey.chaware,

you may found the Argus sources as below by installing jetson_multimedia_api components.
i.e. /usr/src/jetson_multimedia_api/argus

please also refer to README file for the steps to built argus_camera from the release sources.
thanks

Additional note: if you’re running L4T R32.4.3, you would have to apply this patch before building.

1 Like