Skip to content

videoio: fix grabFrame() in cap_android_camera.cpp#21165

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom
utibenkei:fix_android_ndk_camera_order_of_u_and_v
Dec 2, 2021
Merged

videoio: fix grabFrame() in cap_android_camera.cpp#21165
opencv-pushbot merged 1 commit intoopencv:4.xfrom
utibenkei:fix_android_ndk_camera_order_of_u_and_v

Conversation

@utibenkei
Copy link
Copy Markdown
Contributor

@utibenkei utibenkei commented Nov 30, 2021

In the NV21 and YV12 formats, "V (Cr)" is placed before "U (Cb)".
NV21: YYYYYYYY VUVU
YV12: YYYYYYYY VVUU
https://www.itread01.com/content/1542704886.html
https://developer.android.com/reference/android/graphics/ImageFormat#NV21
https://developer.android.com/reference/android/graphics/ImageFormat#YV12

Test Device : Pixel(NV21), Pixel3a(NV21)

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
android_pack_config=ndk-18-api-level-24.config.py

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 1, 2021

relates to #20529 (and its hotfix #21108)

/cc @komakai @saikatnanda @ShuangLiu1992

@komakai
Copy link
Copy Markdown
Contributor

komakai commented Dec 1, 2021

The change looks good. I don't have phone with a camera with YV12 output - so I can't test

@opencv-pushbot opencv-pushbot merged commit f61883b into opencv:4.x Dec 2, 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

Development

Successfully merging this pull request may close these issues.

4 participants