Video & Image Processing

Image & Video Capture

import cv2

img = cv2.imread('images.jpeg')

print(img.shape)

img = cv2.resize(img,(860, 620))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # RGB2HSV, RGB2GRAY

print(img.shape)

cv2.imshow("Window Title", img)
cv2.waitKey(0)
cv2.destroyAllWindows()

🌈 HSV ဆိုတာဘာလဲ? HSV ဆိုတာ: H = Hue (အရောင်အမျိုးအစား) 🔹 Hue က Red, Green, Blue ဆိုတဲ့ အခြေခံအရောင်တွေပါ။ 🔹 Value က 0° မှ 179° အထိ ရှိတတ်တယ် (OpenCV မှာ Hue ကို 0-179 သာသုံးတယ်) S = Saturation (အရောင်အဆာ) 🔹 အရောင်ရောနှောမှု အဆာကောင်းလား၊ မကောင်းလားဆိုတာ။ 🔹 Value က 0 (အရောင်မရှိဘူး, ဖြူဖြူစင်စင်) မှ 255 (အရောင်ပြည့်ဝ) အထိ။ V = Value (အလင်းအမှောင်) 🔹 အလင်းအတောက်ရှိလား မရှိဘူးလားဆိုတာ။ 🔹 0 ဆိုတာ အမှောင်လုံးဝ၊ 255 ဆိုတာ အလင်းအတောက်။

import cv2

video = cv2.VideoCapture('ITE.mp4')
# video = cv2.VideoCapture(0) # ဒါက Camera ကို ဖွင့်တာ။ 0 ဆိုတာက Default Camera ပါ။

while True:
    try:
        res, frame = video.read()

        cv2.imshow("Video", frame)
    except:
        pass

    if cv2.waitKey(1000) & 0xff == ord('q'):  # cv2.waitKey(1000) ထဲက 1000 ဟာ milliseconds ပါ။
        break
    
video.release()  # <-- release the camera
cv2.destroyAllWindows()

Canny

Erode & Dilate

Numpy

Rectangle, Circle, Lines & Text

Colors Detection & Recognition

Face Detection & Recognition

https://github.com/opencv/opencv.gitarrow-up-right

MediaPipe

Game

Finger Counter

Hill Climb

Basketball

Last updated