AI code with OpenCV

in ai •  last year 

I am now trying the Bing ai for help on coding.

Testing code:
Opencv with Python

Open camera:

Import opencv library

import cv2

Create a VideoCapture object to access the camera

cap = cv2.VideoCapture(0)

Check if the camera is opened successfully

if not cap.isOpened():
print("Error opening camera")

Loop until the user presses 'q' key

while True:

Capture frame-by-frame from the camera

ret, frame = cap.read()

Check if the frame is valid

if not ret:
print("Error reading frame")
break

Display the resulting frame

cv2.imshow('Camera', frame)

Wait for 1 ms and check for user input

key = cv2.waitKey(1) & 0xFF

If 'q' is pressed, exit the loop

if key == ord('q'):
break

Release the camera and destroy all windows

cap.release()
cv2.destroyAllWindows()

It works

opencv_camera.PNG

It was the first time I generate code from AI, I think except on gaming, all my other projects I don't have to waste the time on searching and typing haha.

I remember the time I am learning OpenCV I did spend a lot of time on it, like did so much research and try to get how it runs etc.

Since the AI was born, I think there is no human needed, and I feel like I am stupid because all I did were wasted (spiriting and time) LMAO, all I did will be answered within a second just via an ask 😂.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!