Question: Programming OpenCV (a) Use the VideoCapture() function in OpenCV to capture yourself and use the function cv2.imwrite(output.jpg, frame) to save your photo to a JPG

Programming OpenCV (a) Use the VideoCapture() function in OpenCV to capture yourself and use the function cv2.imwrite(output.jpg, frame) to save your photo to a JPG file, (b) Use the OpenCV to generate the histogram, and (c) Apply the principle of Histogram Equalization.

Below is what i have so far. I want to be able to use the cv2.imwrite function to not only show the picture, but to able to capture and save it. Help with part b and c are also appreciated

import numpy as np import cv2

cap = cv2.VideoCapture(0)

while(True): # Capture frame-by-frame ret, frame = cap.read()

# Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# Display the resulting frame cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break

# When everything done, release the capture cap.release() cv2.destroyAllWindows()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!