OpenCV는 YUV_420_888 평면에서 3개의 매트 개체를 만듭니다. (OpenCV create 3 mat objects from YUV_420_888 planes)


문제 설명

OpenCV는 YUV_420_888 평면에서 3개의 매트 개체를 만듭니다. (OpenCV create 3 mat objects from YUV_420_888 planes)

YUV_420_888 평면 데이터를 보유하기 위해 3개의 매트 개체를 생성할 수 있습니까? 하나는 Y, 다른 하나는 U, 마지막 하나는 V 평면입니다.

BGR이나 다른 것으로 변환하고 싶지 않고 위와 같이 데이터를 보관하십시오.


참조 솔루션

방법 1:

You can use Splitting of the Mat.

For example in a BGR Image (I'll show you in c++ because i'm not that into opencv4Android):

cv::Mat src = cv::imread("some.png");
cv::Mat planes[3];
cv::split(src, planes);

If you have a BGR you would now have the R‑Plane in the planes[2].

Another possibility is, to just get the Planes Buffer e.g.(Java Android now):

/* Get your Image somehow */
Image.Plane Y = img.getPlanes[0];
Image.Plane U = img.getPlanes[1];
Image.Plane V = img.getPlanes[2];

//now just for Y e.g.
ByteBuffer yBuffer = Y.getBuffer();
byte[] yBytes = new Byte[yBuffer.remaining()];
yBuffer.get(yBytes);

//read the byte data into a cv::Mat

(by user2179256Marcel T)

참조 문서

  1. OpenCV create 3 mat objects from YUV_420_888 planes (CC BY‑SA 2.5/3.0/4.0)

#opencv4android #OpenCV #opencv3.0






관련 질문

사용 가능한 모든 기기를 지원하는 Android NDK 빌드 (Android NDK build to support all available devices)

안드로이드에서 버튼 클릭시 커스텀 카메라 실행 (custom camera launch on button click in android)

나중에 Android에서 실행해야 하는 데스크탑용 OpenCV 애플리케이션 개발 및 테스트 (Developing and testing an OpenCV application on desktop which should later run on Android)

OpenCV4Android를 사용하여 HSV 이미지의 Value 구성 요소를 해제하여 알고리즘이 조명 조건에 덜 민감해지도록 하려면 어떻게 해야 합니까? (Using OpenCV4Android, how do I dismiss the Value component of an HSV image, so that algorithms become less sensitive to light conditions?)

Hue, Saturation, Value의 수치가 주어지면 색상환을 사용하여 색상의 이름을 말하는 방법 (Given the numerical value of Hue, Saturation and Value, how to tell the name of color using a color wheel)

이 OpenCV4Android 샘플 애플리케이션에서 이 코드는 무엇을 합니까? (What does this piece of code do in this OpenCV4Android sample application?)

opencv를 사용하여 이미지에서 파란색을 감지하려고 시도하고 예기치 않은 결과를 얻습니다. (Trying to detect blue color from image using opencv, and getting unexpected result)

rgba() 메서드에서 반환된 이 Mat가 RGBA 형식이 아닌 BGR 형식으로 나타나는 이유는 무엇입니까? (Why does this Mat returned by rgba() method appear to have BGR format rather than RGBA format?)

파란색에 대해 가능한 전체 Hue 범위를 지정했는데 inRange 함수가 파란색을 감지하지 못하는 이유는 무엇입니까? (Why isn't inRange function detecting blue color when I have given it the entire possible Hue range for the blue color?)

OpenCV는 YUV_420_888 평면에서 3개의 매트 개체를 만듭니다. (OpenCV create 3 mat objects from YUV_420_888 planes)

Bazel을 사용하는 프로젝트에 OpenCV android-sdk를 가져오는 방법은 무엇입니까? (How to import OpenCV android-sdk to my project which is using Bazel?)

Android 애플리케이션의 특정 프레임 내 자동 촬영 기능 (Auto picturing feature within specific frame in Android application)







코멘트