Skip to content

Add conventional Bayer naming#20970

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
s-trinh:update_Bayer_naming
Nov 2, 2021
Merged

Add conventional Bayer naming#20970
opencv-pushbot merged 1 commit intoopencv:3.4from
s-trinh:update_Bayer_naming

Conversation

@s-trinh
Copy link
Copy Markdown
Contributor

@s-trinh s-trinh commented Oct 28, 2021

fix #19629
fix #18619
fix #4857


Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution!

Comment on lines -748 to -751
COLOR_BayerBG2BGR = 46,
COLOR_BayerGB2BGR = 47,
COLOR_BayerRG2BGR = 48,
COLOR_BayerGR2BGR = 49,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please to keep these original defines "as is" (to ensure that we don't change anything) and add new defines through them below:
COLOR_BayerRGGB2BGR = COLOR_BayerBG2BGR, etc

BTW, It is OK to define RGB/BGR enums correspondence through 4 symbols code on the both sides:
COLOR_BayerRGGB2RGB = COLOR_BayerBGGR2BGR

respectively. For example, the above pattern has a very popular "BG" type.

@see cv::COLOR_BayerBG2BGR, cv::COLOR_BayerGB2BGR, cv::COLOR_BayerRG2BGR, cv::COLOR_BayerGR2BGR, cv::COLOR_BayerBG2RGB, cv::COLOR_BayerGB2RGB, cv::COLOR_BayerRG2RGB, cv::COLOR_BayerGR2RGB
@see cv::COLOR_BayerRGGB2BGR, cv::COLOR_BayerGRBG2BGR, cv::COLOR_BayerBGGR2BGR, cv::COLOR_BayerGBRG2BGR, cv::COLOR_BayerRGGB2RGB, cv::COLOR_BayerGRBG2RGB, cv::COLOR_BayerBGGR2RGB, cv::COLOR_BayerGBRG2RGB
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation describes "The two letters ... components from the second row, second and third columns" OpenCV encoding few lines above.
So it makes sense to keep old OpenCV encoding here.

We can add link on the issue: https://github.com/opencv/opencv/issues/19629 and new encoding below.

@s-trinh s-trinh force-pushed the update_Bayer_naming branch from 88447a6 to 1cc966b Compare November 1, 2021 21:05
@s-trinh
Copy link
Copy Markdown
Contributor Author

s-trinh commented Nov 1, 2021

@alalek
Updated with some additional doc changes.


What about BayerGR2RGB https://docs.opencv.org/4.5.4/dc/d38/group__gapi__colorconvert.html#gad78d0756339b84ed0fed49ac3b7dae01

Is it GBRG pattern?

@s-trinh s-trinh marked this pull request as ready for review November 1, 2021 21:13
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you 👍

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 2, 2021

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@s-trinh s-trinh force-pushed the update_Bayer_naming branch from 1cc966b to 30d6766 Compare November 2, 2021 19:19
@opencv-pushbot opencv-pushbot merged commit 85fd872 into opencv:3.4 Nov 2, 2021
@alalek alalek mentioned this pull request Nov 5, 2021
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants