Face detection + RGB chanels
This commit is contained in:
parent
5eb61028f2
commit
1fa7fc2558
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
Loading…
Reference in New Issue