2

我正在尝试将 Flycapture2 图像保存为浮点 EXR 图像。我从相机得到的像素格式是 YUV420,我需要将其转换为 RGB 才能保存。做这个的最好方式是什么?精度对此非常重要。

4

1 回答 1

0

您可以使用 Flycapture SDK 设置图像格式:

FlyCapture2::Format7ImageSettings fmt7ImageSettings;
FlyCapture2::Error error;

    fmt7ImageSettings.pixelFormat = FlyCapture2::PixelFormat::PIXEL_FORMAT_BGR;

    // Validate Format 7 settings  
    bool valid;
    error = cam.ValidateFormat7Settings(&fmt7ImageSettings, &valid, &fmt7PacketInfo);
    unsigned int num_bytes = fmt7PacketInfo.recommendedBytesPerPacket;


    // Set Format 7 (partial image mode) settings  
    error = cam.SetFormat7Configuration(&fmt7ImageSettings, num_bytes);
    if (error != FlyCapture2::ErrorType::PGRERROR_OK)
    {
        error.PrintErrorTrace();
    }
于 2017-04-07T12:27:20.547 回答