Skip to content

cv::Demosaicing with VNG method - output is offset by two pixels vertically #27225

@bjornpiltz

Description

@bjornpiltz

System Information

OpenCV 4.10.0, vcpkg, MSVC 2022

Detailed description

Demosaicking an 8-Bit image with the VNG method produces an output image which is shifted vertically by two pixels.

The same applies to all four options: COLOR_BayerRG2RGB_VNG , COLOR_BayerRG2GRB_VNG , COLOR_BayerBG2RGB_VNG and COLOR_BayerGB2RGB_VNG .

There are also artefacts along the edges, but that's not as serious imho.

in out
Image Image

Steps to reproduce

    cv::Mat in = cv::Mat::eye(16, 16, CV_8UC1) * 255;
    cv::resize(in, in, {}, 2, 2, cv::INTER_NEAREST);

    cv::Mat out;
    cv::cvtColor(in, out, cv::COLOR_BayerRG2RGB_VNG);

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions