Obtaining Camera Serial Number or ID from Argus library

Hello,
Is there any way to get camera serial number or id from Argus library?
I have checked the ICameraProperties interface, I find getUUID() function, however, the comment is the following:

    /**
     * Returns the camera UUID.
     * @todo Describe the meaning of the camera UUID.
     */

This does not help at all.
Could you please let me know if there is a way to get camera serial number or ID?

Thanks,

Jon

hello jon7,

may I know what’s the actual use-case? are you storing the serial number in the eeprom?

Hi Jerry,
We use two cameras as stereo cameras. For each pair, we do the calibration.

So first usage of the camera ID or serial number is that we will need to put the camera ID into the calibration file.

Second, the calibration file is stored in the device as a regular file. When starting our application, our program in the device needs to read the camera IDs then verify that the calibration file matches.

Thanks,

Jon Liu

hello jon7,

please check Sensor Software Driver Programming.
you can have using those device tree [Module Properties], such as badge, position property.
from the driver side you may parse these to distinguish your dual camera sensors.

Hello Jerry,
I have read through the device tree in the document you sent. Please correct me if I am wrong, the badge can specify the camera model, but for each individual camera, I do not think it is proper to use badge, since it is not realistic to assign each TX2 a unique device tree file.

The calibration for each individual camera pairs are different. So, we want to read the serial number or camera ID for each individual camera. Do we have that feature in Argus library?

Thanks,

Jon Liu

hello jon7,

don’t you have dual camera in your system for each TX2 platform?
you may use the single device tree by specify these two camera as below pseudo code.
these two unique badge to include the position value helps you to distinguish camera, and apply different calibration file.
for example,

                modules {
                        module0 {
                                badge = "cam_bottom_ID";
                                position = "bottom";
                        module1 {
                                badge = "cam_top_ID";
                                position = "top";

Hi Jerry,
I am not very familiar about the device tree. I think based on the programming manual, I should be able to change the device tree. But how can I read the badge and position info from Argus library in my application program?

Another thing, I have talked to our hardware teammates, they are saying that the left and right cameras are always connected to the fixed CSI blocks across the TX2. So in this case, if I call getCameraDevices(my_camera_vec), is it the case that every time, the my_camera_vec[0] will be always left(or right) camera?

Jon

hello jon7,

please check Argus::ICameraProperties Class for reference.
you could call the API, getModuleString() which contains the device’s name, position, and partial model number.
thanks

Hi Jerry,
I have seen the getModuleString() in L4T 32.6.1.(Refer to this) However, I am using L4T 32.5(jetpack 4.5), it looks like the API is not exposed (Please refer to this).

Thanks

Jon

hello jon7,

how about check the camera sensor placement position on the module, it’s also the property reported in device tree.
i.e. Argus::ICameraProperties::getSensorPlacement

Hi @JerryChang
I have tried Argus::ICameraProperties::getSensorPlacement, it works as expected. I can distinguish left and right cameras.

Now the only question is how to know the serial number or GUID of the cameras. In our calibration files, we have serial numbers or GUIDs for the cameras written in the file. We also have the serial numbers or GUIDs of the cameras labelled on each device. In this way, we know the device and its associated calibration file in production stage.

Now for firmware, the application needs to verify that the calibration file is indeed for the two cameras by reading the serial number or GUIDs of the cameras and check them with the ones inside the calibration file.

I am running L4T 32.5.

Is ICameraProperties::getUUID() able to get the camera GUID?

Thanks,

Jon

hello jon7,

what exactly is this calibration file included? is this something for sensor calibration, such as image tuning settings?

yes, that’s GUID content, saved with unsigned int64.

Hi Jerry,

Yes, the calibration file is used for stereo image matching and processing. It is different for each stereo camera pair. In the calibration file, the guids or serial numbers of each camera in the stereo camera pair are recorded. For the application, I will need to read the guid or SN from cameras and compare with the ones inside calibration file. This way, it can be sure that we are using the correct calibration file.

So I guess if getUUID() works, then I can use ICameraProperties::getUUID() to identify each cameras. right? Note that I am using L4T32.5, and I would like to confirm that getUUID() works properly on L4T32.5?

I read through Is Argus::ICameraProperties::getUUID() not unique?, could you clarify that is this UUID unique for all the cameras I use? We are using leopard IMX577.

Update 1 [2021-12-06]

I have read the UUID by getUUID(). For left camera, I got GUID=1 and for right camera, I got GUID=0. That seems not correct. I have used the gdb to inspect the struct of UUID. Here is the code I used to obtain the GUID:

uint64_t IMX577StereoCamera::getCameraUUID(Argus::CameraDevice* pCam)
{
    uint64_t camGUID = UINT64_MAX;

    if(pCam != nullptr)
    {
        ICameraProperties *iCameraProperties = interface_cast<ICameraProperties>(pCam);
        if(iCameraProperties != nullptr)
        {
            UUID camUUID = iCameraProperties->getUUID();
            camGUID = 0;
            for(int i = 0; i < 6; ++i)
            {
                camGUID |= (camUUID.node[i] << (64 - 8 * (i + 1)));
            }
            camGUID |= camUUID.clock_seq;
        }
        else
        {
            std::cerr << FUNC_LINE(__func__, __LINE__) << "cannot get camera properties" << std::endl;
        }
    }
    else
    {
        std::cerr << FUNC_LINE(__func__, __LINE__) << "null ptr found" << std::endl;
    }
    return camGUID;
}

Thanks,

Jon