Getting histogram data in 5.1.6

Please provide the following info (check/uncheck the boxes after clicking “+ Create Topic”):
Software Version
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
Linux
QNX
other

Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.5.0.7774
other

Host Machine Version
native Ubuntu 18.04
other

I am trying to get histogram data from the Tegra hardware ISP. We are currently using the SIPL camera API, however I cannot see any option to get a histogram from the ISP in this API under DriveOS 5.1.6, only under 5.2.0. Is this correct? I see that it’s possible to get the histogram using the old NvMedia ISP API. It looked fairly simple, and I started implemented a temporary solution (until we migrate to 5.2), but I ran into many issues. Some of these issue are likely to be connected.

We currently have two SIPL consumers - one for the raw image, one for processed YUV.

The first problem I ran into is that when I try to disable the YUV consumer, only keep the raw (ICP) consumer, INvSIPLCamera::Start call fails.

Since this is supposed top be a temporary solution, I would be okay with the image processing running twice for starters. When trying to reprocess the image, I ran into the issue, that it it comes out purple - the green channel is completely missing. Otherwise the processing does appear work. (The image from SIPL is fine.)

Note that I may not have configured the ISP correctly - I’ve set eg. the calibration matrix, but haven’t set most of the other options. I don’t see any way to specify eg. the sensor layout (one of the things I suspected being wrong).

The retrieved histogram is also unusable - it seems to register all the pixels in the topmost bin. I use the following settings (expecting a simple histogram):

controls.enable = true;
controls.offset = 0.0f; //Holds offset to be applied to input data prior to bin mapping
controls.knees[0] = 32 - 1;
controls.knees[1] = 2*32 - 1;
controls.knees[2] = 3*32 - 1;
controls.knees[3] = 4*32 - 1;
controls.knees[4] = 5*32 - 1;
controls.knees[5] = 6*32 - 1;
controls.knees[6] = 7*32 - 1;
controls.knees[7] = 8*32 - 1;

controls.ranges[0] = 5;   //Holds \(log_2\) range of the pixel values to be considered for each zone
controls.ranges[1] = 5;   //
controls.ranges[2] = 5;   //
controls.ranges[3] = 5;   //
controls.ranges[4] = 5;   //
controls.ranges[5] = 5;   //
controls.ranges[6] = 5;   //
controls.ranges[7] = 5;   //

All the calls for setting this up seem to succeed.

Anyone have any tips? Which of these issues are related?

Dear @kornel.lehocz.ext,
I will check internally and get back to you.
Could you clarify below things

I see that it’s possible to get the histogram using the old NvMedia ISP API

which old version you are talking about?

What is host OS version? I notice it is not ubuntu 18.04 in description.

As you are talking about multiple issues, is it possible to share simple code to reproduce issue ?

This API is deprecated in 5.2.0, this why I referred to it by old. It’s the functions in nvmedia_isp.h.

“What is host OS version? I notice it is not ubuntu 18.04 in description.”

  • I have 20.04 on this development laptop, if that’s what’s meant by host.

“As you are talking about multiple issues, is it possible to share simple code to reproduce issue ?”

  • Difficult, as it arises in this setup. I made it a single question, because I don’t know how they are related. Eg. someone might know that the missing green channel is because of not registering the buffer or it’s a misconfigured ISP.

Dear @kornel.lehocz.ext,

I have 20.04 on this development laptop, if that’s what’s meant by host.

DRIVE SW 10 does not work on ubuntu 20.04. I am not sure how you were able to install DRIVE SW 10 and compile nvmedia sample.

Let me check with engineering team on your use case and get back to you if I need any details.

Our build script is Docker based - I presume that’s using 18.04. It is in fact regrettable that the SDK manager doesn’t work under 20.04 and I cannot easily download samples. This is totally beside my question though.

The support in SIPL was added after DRIVE OS 5.1.6.1.