Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

first of all, please use cv2, not the outdated cv module. (cv was completely removed in opencv3)

 import cv2
 import numpy as np
 img=cv2.imread("D:\OpenCV2.2\doc\logo.png",1)
 hsv=cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
 mask = cv2.inRange(hsv,(110,50,50),(130,255,255))
 res= cv2.bitwise_and(img,img,mask=mas)

first of all, please use cv2, not the outdated cv module. (cv was completely removed in opencv3)

 import cv2
 import numpy as np
 img=cv2.imread("D:\OpenCV2.2\doc\logo.png",1)
img = cv2.imread("D:/OpenCV2.2/doc/logo.png", 1)
 hsv=cv2.cvtColor(img, hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
 mask = cv2.inRange(hsv,(110,50,50),(130,255,255))
cv2.inRange(hsv, (110,50,50), (130,255,255))
 res= cv2.bitwise_and(img,img,mask=mas)
res = cv2.bitwise_and(img, img, mask=mas)