bgr to rgb opencv
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
bgr to rgb opencv
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
cv2 convert to rgb
im_rgb = cv2.cvtColor(im_cv, cv2.COLOR_BGR2RGB)
how to use cv2.COLOR_BGR2GRAY
def main():
imagePath = "img.jpg"
img = cv2.imread(imagePath)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
generate_histogram(gray)
cv2.imwrite("before.jpg", gray)
gray = cv2.equalizeHist(gray)
generate_histogram(gray)
cv2.imwrite("after.jpg",gray)
return 0
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us