import cv2 
import numpy as np

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

capture = cv2.VideoCapture(0)

#define the resolution size....
def make_1080p():
	capture.set(3,1920)
	capture.set(4,1080)

while True:
	#return frame by frame.....
	ret,frame = capture.read()
	gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
	faces = face_cascade.detectMultiScale(gray,scaleFactor=1.5,minNeighbors=2,minSize=(20,20))
	for (x,y,w,h) in faces:
		print(x,w,y,h)
		roi_gray = gray[y:y+h , x:x+w]
		cv2.imwrite('image_gray.png',roi_gray)

		#Draw the rectangle in FACE...
		color = (255,0,0)
		stroke = 2
		end_cord_x = x + w 
		end_cord_y = y + h
		cv2.rectangle(frame, (x, y), (end_cord_x,end_cord_y), color, stroke)
 	#display the frames.#cv2.imshow('frame',frame)
	cv2.imshow('gray_frame',frame)
	if cv2.waitKey(20) & 0XFF == ord('q'):
		break

#relase the camera...
capture.release()		
cd4c6f243b9a95864c92bbf1e8e0860525873be7
<mask token>


def make_1080p():
    capture.set(3, 1920)
    capture.set(4, 1080)


<mask token>

<mask token>


def make_1080p():
    capture.set(3, 1920)
    capture.set(4, 1080)


while True:
    ret, frame = capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5,
        minNeighbors=2, minSize=(20, 20))
    for x, y, w, h in faces:
        print(x, w, y, h)
        roi_gray = gray[y:y + h, x:x + w]
        cv2.imwrite('image_gray.png', roi_gray)
        color = 255, 0, 0
        stroke = 2
        end_cord_x = x + w
        end_cord_y = y + h
        cv2.rectangle(frame, (x, y), (end_cord_x, end_cord_y), color, stroke)
    cv2.imshow('gray_frame', frame)
    if cv2.waitKey(20) & 255 == ord('q'):
        break
capture.release()

<mask token>
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
capture = cv2.VideoCapture(0)


def make_1080p():
    capture.set(3, 1920)
    capture.set(4, 1080)


while True:
    ret, frame = capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5,
        minNeighbors=2, minSize=(20, 20))
    for x, y, w, h in faces:
        print(x, w, y, h)
        roi_gray = gray[y:y + h, x:x + w]
        cv2.imwrite('image_gray.png', roi_gray)
        color = 255, 0, 0
        stroke = 2
        end_cord_x = x + w
        end_cord_y = y + h
        cv2.rectangle(frame, (x, y), (end_cord_x, end_cord_y), color, stroke)
    cv2.imshow('gray_frame', frame)
    if cv2.waitKey(20) & 255 == ord('q'):
        break
capture.release()

import cv2
import numpy as np
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
capture = cv2.VideoCapture(0)


def make_1080p():
    capture.set(3, 1920)
    capture.set(4, 1080)


while True:
    ret, frame = capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5,
        minNeighbors=2, minSize=(20, 20))
    for x, y, w, h in faces:
        print(x, w, y, h)
        roi_gray = gray[y:y + h, x:x + w]
        cv2.imwrite('image_gray.png', roi_gray)
        color = 255, 0, 0
        stroke = 2
        end_cord_x = x + w
        end_cord_y = y + h
        cv2.rectangle(frame, (x, y), (end_cord_x, end_cord_y), color, stroke)
    cv2.imshow('gray_frame', frame)
    if cv2.waitKey(20) & 255 == ord('q'):
        break
capture.release()

import cv2 
import numpy as np

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

capture = cv2.VideoCapture(0)

#define the resolution size....
def make_1080p():
	capture.set(3,1920)
	capture.set(4,1080)

while True:
	#return frame by frame.....
	ret,frame = capture.read()
	gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
	faces = face_cascade.detectMultiScale(gray,scaleFactor=1.5,minNeighbors=2,minSize=(20,20))
	for (x,y,w,h) in faces:
		print(x,w,y,h)
		roi_gray = gray[y:y+h , x:x+w]
		cv2.imwrite('image_gray.png',roi_gray)

		#Draw the rectangle in FACE...
		color = (255,0,0)
		stroke = 2
		end_cord_x = x + w 
		end_cord_y = y + h
		cv2.rectangle(frame, (x, y), (end_cord_x,end_cord_y), color, stroke)
 	#display the frames.#cv2.imshow('frame',frame)
	cv2.imshow('gray_frame',frame)
	if cv2.waitKey(20) & 0XFF == ord('q'):
		break

#relase the camera...
capture.release()		