Is there a way to get the AWB gain lively?

Hi,
I need to lively get the AWB gain from ISP and write it to sensor AWB gain registers. So I’m asking is there a way to get the AWB gain lively on jeston nano?

Thanks
Bing

hello bing.yan,

please refer to MMAPI documentation, Argus::IAutoControlSettings::getWbGains.
BTW,
you should also calling Argus::ICaptureSession::repeat to queue a request with new wbGain settings,
please check below for an example,

iAutoControlSettings->setWbGains(bayerGains);
iAutoControlSettings->setAwbMode(AWB_MODE_MANUAL);
iSession->repeat(request.get());
1 Like

Hi Jerry,
Thank you so much!
Bing.Yan

Hi Jerry,
Sorry I have one more question after having a quick look to bayerGains in your example. My question is about bayerGains it has 4 elements, are the 4 elements of fixed order like R G G B or the order is dynamic, following sensor bayer format like BGGR, RGGB GRBG ?
printf("Intensity: r:%0.3f gO:%0.3f gE:%0.3f b:%0.3f "
“WBGains: r:%0.3f gO:%0.3f gE:%0.3f b:%0.3f\n”,
bayerAverages[0],
bayerAverages[1],
bayerAverages[2],
bayerAverages[3],
whiteBalanceGains[0],
whiteBalanceGains[1],
whiteBalanceGains[2],
whiteBalanceGains[3]);

            BayerTuple<float> bayerGains(whiteBalanceGains[0], whiteBalanceGains[1],
                whiteBalanceGains[2], whiteBalanceGains[3]);

hello bing.yan,

that’s a good question. it’s by default as RGGB.
you may using IBayerHistogram by calling r(), gEven(), gOdd(), b() for specific orders.
for instance,

    std::vector< BayerTuple<uint32_t> > histogram;
    const IBayerHistogram* bayerHistogram = interface_cast<const IBayerHistogram>(iMetadata->getBayerHistogram());

    for (uint32_t i = 0; i < histogram.size(); i++) {
    ...
        histogram[i].r();
        histogram[i].gEven();
        histogram[i].gOdd();
        histogram[i].b();

Thanks Jerry! I am currently using QT to draw the camera frames, the frames are captured by GST-launch-1.0 command, under this condition, can I still use the iAutoControlSettings->getWbGains method you mentioned above? Is there any way? I use QT because I need to draw some boxes recognized by AI detection on camera frames to show.

Bing.Yan

hello bing.yan,

that’s not supported, you may running with $ gst-inspect-1.0 nvarguscamerasrc to confirm all the support elements.
please refer to Argus sample applications to have implementation.

I need to capture frame of camera out and show it by QT interface so that I can draw some boxes on it at some positions of frames, do you know if I use argus interface, can I get the frame(ISP output) out for QT usage?
I saw a Frame::getImage interface which can get Image buffer data out by a interface Image::mapBuf , do you know what’s the format of the data got by Image::mapBuf? I saw it seems have some header bytes for special usage.

Thanks!
Bing.Yan

this topic has been solved, let’s open another new discussion thread for following up.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.