I just finished a facial recognition program available on fwh64.
Previously, I used several 3rd party facial recognition SDK, but with the recent development of AI programs, it was written with pure FWH64 and OpenCV(C++)
FWH Power!
Regards,
Charles KWON
sample image
http://www.kugya.com/result.jpg
- Code: Select all Expand view
#include "fivewin.ch"
#define IMREAD_COLOR 1
FUNCTION Main()
LOCAL oDlg
LOCAL oImage
LOCAL cFile := "test4.jpg"
DEFINE DIALOG oDlg TITLE "DrFace c)Charles KWON"
@ 0,0 IMAGE oImage FILE cFile OF oDlg
oDlg:bStart := {|| doFaceDetect( oDlg, cFile, oImage ) }
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
FUNCTION doFaceDetect( oDlg, cFile, oImage )
LOCAL pImg := 0
LOCAL pImg2
LOCAL pStr := ""
LOCAL pStr2 := ""
LOCAL oCV2
LOCAL nFaces
LOCAL aFaces := {}
oImage:Move(0,0,oImage:nWidth, oImage:nHeight, .t.)
oDlg:Move(0,0,oImage:nWidth, oImage:nHeight, .t.)
oDlg:Center()
oCv2 := TCV2():New()
IF !oCv2:imread( cFile, IMREAD_COLOR, @pImg )
RETURN .F.
ENDIF
IF !oCv2:DetectFaces( pImg, @nFaces, @aFaces )
oCv2:DeleteObject( pImg )
RETURN .F.
ENDIF
oImage:bPainted := {| hDC | oCv2:DrawFaces( hDC, aFaces ) }
oImage:Refresh()
RETURN .T.