Example updated for mp.Image in documentation
PiperOrigin-RevId: 579277510
This commit is contained in:
parent
1c46e43088
commit
e22b7d5dd4
|
@ -51,7 +51,7 @@ void ImageSubmodule(pybind11::module* module) {
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import cv2
|
import cv2
|
||||||
cv_mat = cv2.imread(input_file)[:, :, ::-1]
|
cv_mat = cv2.imread(input_file)
|
||||||
rgb_frame = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv_mat)
|
rgb_frame = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv_mat)
|
||||||
gray_frame = mp.Image(
|
gray_frame = mp.Image(
|
||||||
image_format=mp.ImageFormat.GRAY8,
|
image_format=mp.ImageFormat.GRAY8,
|
||||||
|
|
|
@ -84,7 +84,7 @@ void ImageFrameSubmodule(pybind11::module* module) {
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import cv2
|
import cv2
|
||||||
cv_mat = cv2.imread(input_file)[:, :, ::-1]
|
cv_mat = cv2.imread(input_file)
|
||||||
rgb_frame = mp.ImageFrame(image_format=ImageFormat.SRGB, data=cv_mat)
|
rgb_frame = mp.ImageFrame(image_format=ImageFormat.SRGB, data=cv_mat)
|
||||||
gray_frame = mp.ImageFrame(
|
gray_frame = mp.ImageFrame(
|
||||||
image_format=ImageFormat.GRAY,
|
image_format=ImageFormat.GRAY,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user