Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question''' <summary> ''' Retourne une liste de Rectangle selon le Filtre descripteur ''' </summary> ''' <param name="img">Image(Of Bgr, Byte)</param> ''' <remarks>renvoi un List(Of System.Drawing.Rectangle)</remarks> Public Function ChRec(ByRef Img As Image(Of Gray, Byte), ByRef Filtre As String) As List(Of System.Drawing.Rectangle) Dim DRec As New List(Of System.Drawing.Rectangle) Dim eyeDetector As New CascadeClassifier("C:\Users\confo\Desktop\Downloads\OpenCV\emgucv-windows-universal-gpu 2.4.9.1847\opencv\data\haarcascades\" & Filtre) For Each face As Rectangle In eyeDetector.DetectMultiScale(Img, 1.1, 10, New Size(20, 20), Size.Empty) 'Img.Draw(face, New Bgr(Col), 2) DRec.Add(face) Next Return DRec End Function ''' <summary> ''' Imprime une liste de Rectangle ''' </summary> ''' <param name="img">Image(Of Bgr, Byte)</param> ''' <remarks>Affiche un List(Of System.Drawing.Rectangle)</remarks> Public Sub DrawRec(ByRef Img As Image(Of Bgr, Byte), ByRef Filtre As List(Of System.Drawing.Rectangle), ByRef Couleur As Color, Optional ByVal Larg As Integer = 1) For Each face As Rectangle In Filtre Img.Draw(face, New Bgr(Couleur), Larg) Next End Sub ''' <summary> ''' renvoi une liste de Rectangle décrivant le visage ''' </summary> ''' <param name="img">Image(Of Bgr, Byte)</param> ''' <remarks>Affiche un List(Of System.Drawing.Rectangle)</remarks> Public Sub Visage_Rectangle(ByRef Img As Image(Of Bgr, Byte), Optional ByRef DRec As List(Of System.Drawing.Rectangle) = Nothing) 'Convert the image to Grayscale Dim imgGray As Image(Of Gray, Byte) = Img.Convert(Of Gray, Byte)() DRec = ChRec(imgGray, "haarcascade_frontalface_default.xml") DrawRec(Img, DRec, Color.Pink, 5) DRec = ChRec(imgGray, "frontalEyes35x16.xml") DrawRec(Img, DRec, Color.Blue, 4) DRec = ChRec(imgGray, "haarcascade_mcs_mouth.xml") DrawRec(Img, DRec, Color.Red, 3) DRec = ChRec(imgGray, "haarcascade_fullbody.xml") DrawRec(Img, DRec, Color.Beige, 2) DRec = ChRec(imgGray, "rightEye.xml") DrawRec(Img, DRec, Color.Brown) DRec = ChRec(imgGray, "nez.xml") DrawRec(Img, DRec, Color.DarkOrange) End Sub
16 nov. 2013 à 15:01
16 nov. 2013 à 15:02
Si non, dire ce qui pose problème.
16 nov. 2013 à 15:07
16 nov. 2013 à 15:18
16 nov. 2013 à 15:21