import cv2 import sys img = cv2.imread("lena.jpg",cv2.CV_LOAD_IMAGE_UNCHANGED) #Check if image is loaded if img==None: print "Image is not loaded." sys.exit() #Convert image to gray gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #Output cv2.namedWindow("Original") cv2.imshow("Original",img) cv2.namedWindow("Gray") cv2.imshow("Gray",gray) #write output to disk cv2.imwrite("gray.jpg",gray) cv2.waitKey(); cv2.destroyAllWindows();
GFGYFYTGF
ReplyDeleteصيانة افران الغاز بجدة