# -*- coding: utf-8 -*-
"""
Created on Fri Feb 23 15:04:47 2018
@author: wuming
"""
import cv2
import numpy as np
image = cv2.imread('D:\\000ASU\\Research\\line_detect\\IMG_20180206_100901_s.jpg')
sp = image.shape
height = sp[0]
width = sp[1]
#new = cv2.CreateImage(cv2.GetSize(image), image.depth, 1)
new = np.zeros((height,width,3), np.uint8)
for i in range(height):
for j in range(width):
new[i,j] = 0.3 * image[i,j][0] + 0.59 * image[i,j][1] + 0.11 * image[i,j][2]
#cv2.ShowImage('a_window', new)
cv2.namedWindow('Image')
cv2.imshow('Image', new)
cv2.waitKey(0)
cv2.destroyAllWindows()