Как изменить черный цвет на красный с помощью OpenCV Python? ⇐ Python
Как изменить черный цвет на красный с помощью OpenCV Python?
How can you make it in Python? I faced a problem with this line
img_rgb.Set(mask,cv2.Scalar(0,0,255)) and here is the code :
import numpy as np import imutils import cv2 img_rgb = cv2.imread('figi.jpg') Conv_hsv_Gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) ret, mask = cv2.threshold(Conv_hsv_Gray, 0, 255,cv2.THRESH_BINARY_INV |cv2.THRESH_OTSU) img_rgb.Set(mask,cv2.Scalar(0,0,255)) cv2.imshow("imgOriginal", img_rgb) # show windows cv2.imshow("output", res) # show windows cv2.imshow("mask", mask) # show windows cv2.waitKey(0)
Источник: https://stackoverflow.com/questions/390 ... ncv-python
How can you make it in Python? I faced a problem with this line
img_rgb.Set(mask,cv2.Scalar(0,0,255)) and here is the code :
import numpy as np import imutils import cv2 img_rgb = cv2.imread('figi.jpg') Conv_hsv_Gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) ret, mask = cv2.threshold(Conv_hsv_Gray, 0, 255,cv2.THRESH_BINARY_INV |cv2.THRESH_OTSU) img_rgb.Set(mask,cv2.Scalar(0,0,255)) cv2.imshow("imgOriginal", img_rgb) # show windows cv2.imshow("output", res) # show windows cv2.imshow("mask", mask) # show windows cv2.waitKey(0)
Источник: https://stackoverflow.com/questions/390 ... ncv-python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение