★ 개요 ★
Texture2D <-> OpenCV.Mat 변환
★ OpenCV.Mat ★
-1. OpenCV 에서 제공하는 클래스
-2. Matrix 로 사용되며 값을 Matrix 로 저장하는데 사용된다.
-3. Matrix 로 계산하면 빠르기 때문에 사용하는 듯 하다
★ Texture2D 정보 -> OpenCV.Mat Class 저장하기 ★
- 코드 -
Texture2D imgTexture = Resources.Load ("lena") as Texture2D;
Mat imgMat = new Mat (imgTexture.height, imgTexture.width, CvType.CV_8UC4);
Utils.texture2DToMat (imgTexture, imgMat);
★ OpenCV.Mat 정보로 -> Texture2D 만들기 ★
- 코드 -
Texture2D texture = new Texture2D (imgMat.cols (), imgMat.rows (), TextureFormat.RGBA32, false);
Utils.matToTexture2D (imgMat, texture);
gameObject.GetComponent<Renderer> ().material.mainTexture = texture;
★ OpenCV.Mat 정보로 -> Texture2D 만들기 결과 ★ ( Texture2DToMatExample )
'프로그래밍 - 클라이언트 > OpenCV' 카테고리의 다른 글
OpenCV 고급 2. MatToTexture 효율적 사용 (0) | 2018.09.15 |
---|---|
OpenCV 고급 1. 각종 이미지 필터 (1) | 2018.09.15 |
OpenCV 기본 3. WebCamTextureToMatHelper (0) | 2018.09.15 |
OpenCV 기본 2. WebCamTexture -> OpenCV.Mat (0) | 2018.09.15 |
OpenCV 개 (0) | 2018.09.15 |