Face detection + RGB chanels

This commit is contained in:
Alexandre VEROT 2023-02-06 10:46:34 +01:00
parent 5eb61028f2
commit 1fa7fc2558
2 changed files with 26 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Programmin for Face detection
# Haar Cascade
import cv2
import numpy as np
# Charger le classificateur Haar Cascade
face_cascade = cv2.CascadeClassifier("Haar_Cascade.xml")
@ -24,3 +25,13 @@ for x, y, w, h in faces:
# Afficher l'image
cv2.imshow("Faces", img)
cv2.waitKey(0)
# Split the image into its RGB channels
b, g, r = cv2.split(img)
# Display the individual channels
cv2.imshow('Red channel', r)
cv2.imshow('Green channel', g)
cv2.imshow('Blue channel', b)
cv2.waitKey(0)
cv2.destroyAllWindows()

15
RGB_Chanels.py Normal file
View File

@ -0,0 +1,15 @@
import cv2
import numpy as np
# Load the image
img = cv2.imread('Image.jpg')
# Split the image into its RGB channels
b, g, r = cv2.split(img)
# Display the individual channels
cv2.imshow('Red channel', r)
cv2.imshow('Green channel', g)
cv2.imshow('Blue channel', b)
cv2.waitKey(0)
cv2.destroyAllWindows()