PureBasic

Forums PureBasic
Nous sommes le Lun 10/Déc/2018 1:25

Heures au format UTC + 1 heure




Poster un nouveau sujet Répondre au sujet  [ 17 messages ]  Aller à la page Précédente  1, 2
Auteur Message
 Sujet du message: Re: Reconnaissance faciale
MessagePosté: Jeu 03/Nov/2016 19:42 
Hors ligne

Inscription: Jeu 03/Nov/2016 19:29
Messages: 6
I cannot get camera list, instead returned unicode symbols.
Is there a way to use Camera?

Code:
Dim cameralist.s(255)
Dim cameracount.i(255)
Dim formatList.FSDK_VideoFormatInfo(255)

FSDK_InitializeCapturing()
FSDK_GetCameraList(@cameralist(), cameracount())

; cameralist(0) should be "HP HD Webcam" but each time returned 4byte unicode letters.

Debug cameralist(0)
Debug Len(cameralist(0))

FSDK_GetVideoFormatList("HP HD Webcam", @formatList(0), cameracount(0)) ; evenlikethis


Haut
 Profil  
Répondre en citant le message  
 Sujet du message: Re: Reconnaissance faciale
MessagePosté: Dim 14/Mai/2017 15:04 
Hors ligne

Inscription: Jeu 03/Nov/2016 19:29
Messages: 6
Hi,
I stack on FSDK_GetTrackerFacePosition so always return 0 for coordinates

Thanx for any help

MainFile:
Code:
;{ OnErrorDeclz
Declare ErrorHandler()
OnErrorCall(@ErrorHandler())
;}

;{ Usingz
UseJPEGImageDecoder()
UseJPEGImageEncoder()

UsePNGImageDecoder()
UsePNGImageEncoder()
;}

;{ Includz
;{ Droopy
XIncludeFile #PB_Compiler_Home+"hmod\DroopyLib.pbi"
UseModule DroopyLib
;}
;{ Includz
XIncludeFile "fsdk_62_64dll.pbi"
;}
;}

;{ Defz

;{ WideGlobz
Global qIT.b = #False
Global CurTask.w
;}

;{ WinParaz
#wWidth  = 640
#wHeight = 480
#wMain=13
;}

;{ Win
Enumeration
  #scrlPrev
  #scrlFace
  #imgPrev
  #imgFace
 
  #trackBa
 
  #btnVideoTracker 
 
  #btnQit
EndEnumeration 
;} 

;}

;{ Prox

;{ HBitmap2PBImg
Structure PB_StructureDataBase
  Bitmap.i
  Width.l
  Height.l
  Depth.l
  ColorArray.l
EndStructure
Declare.i Hbitmap2PBImage(hbitmap.i)

Procedure.i Hbitmap2PBImage(hbitmap.i)
  ; -    pbImg.l = Hbitmap2PBImage(hbitmap.l) 
  ; -    Returns pbImg Handle from hBitmap
  ; -    Manually Release hBitmap and pbImg
  Protected *idb.PB_StructureDataBase
  GetObject_(hbitmap, SizeOf(BITMAP), @bm.BITMAP)
  If bm\bmBits
    *idb = CreateImage(#PB_Any, bm\bmWidth, bm\bmHeight, bm\bmBitsPixel)
    If IsImage(*idb)
      DeleteObject_(*idb\Bitmap)
      *idb\Bitmap = hbitmap
    EndIf
  EndIf
  ProcedureReturn *idb
EndProcedure
;}

;{ WinScroll
Declare scrollPrev()
Declare scrollFace()
Procedure scrollPrev()
  SetGadgetAttribute(#scrlFace, #PB_ScrollArea_X, GetGadgetAttribute(#scrlPrev, #PB_ScrollArea_X))
  SetGadgetAttribute(#scrlFace, #PB_ScrollArea_Y, GetGadgetAttribute(#scrlPrev, #PB_ScrollArea_Y))
EndProcedure
Procedure scrollFace()
  SetGadgetAttribute(#scrlPrev, #PB_ScrollArea_X, GetGadgetAttribute(#scrlFace, #PB_ScrollArea_X))
  SetGadgetAttribute(#scrlPrev, #PB_ScrollArea_Y, GetGadgetAttribute(#scrlFace, #PB_ScrollArea_Y))
EndProcedure
;}
;{ WinTrack
Global vidSeek.l
Procedure onTrackbarChange()
   vidSeek = GetGadgetState(#trackBa)
   SetGadgetState(#trackBa,vidSeek)
EndProcedure
;}

;}


;{ hTracker3D
Global vTrack3dStat.b=#False

Global programState
Enumeration ProgramState
    #psRemember
    #psRecognize
EndEnumeration

Global mouseX, mouseY

#TrackerMemoryFile = "tracker.dat"


Procedure VideoTracker(dummy.l) 
  If vTrack3dStat=#False
    vTrack3dStat=#True
 
    programState = #psRecognize
   
    mouseX = 0
    mouseY = 0
       
    RET=FSDK_InitializeCapturing():ErrorDCode(RET, #PB_Compiler_Line)
   
    Protected cameraName.s, *CameraList.CameraList;, Dim camList.s(255), camListDblPointer.i, camListPointer.i
    Protected Count.l, FrameWidth.l, FrameHeight.l
   
    FSDK_GetCameraList(@*CameraList, @Count):ErrorDCode(RET, #PB_Compiler_Line)
   
    cameraName = *CameraList\CameraList[0]
   
    If (0 = Count)
        MessageRequester("Error", "Please attach a camera", #PB_MessageRequester_Error)
        End
    EndIf
     
    Protected *VideoFormatInfo.VideoFormatInfo
   
   
    RET = FSDK_GetVideoFormatList(@cameraName, @*VideoFormatInfo, @Count):ErrorDCode(RET, #PB_Compiler_Line)
   
    RET = FSDK_SetVideoFormat(@cameraName, *VideoFormatInfo\VideoFormatInfo[0]) : ErrorDCode(RET, #PB_Compiler_Line)
   
    FrameWidth=*VideoFormatInfo\VideoFormatInfo[0]\Width
    FrameHeight=*VideoFormatInfo\VideoFormatInfo[0]\Height
   
    SetGadgetAttribute(#scrlPrev, #PB_ScrollArea_InnerWidth, FrameWidth)
    SetGadgetAttribute(#scrlPrev, #PB_ScrollArea_InnerHeight,  FrameHeight)
    SetGadgetAttribute(#scrlFace, #PB_ScrollArea_InnerWidth,FrameWidth)
    SetGadgetAttribute(#scrlFace, #PB_ScrollArea_InnerHeight, FrameHeight)
    ResizeGadget(#imgPrev,#PB_Ignore,#PB_Ignore,FrameWidth,FrameHeight)
    ResizeGadget(#imgFace,#PB_Ignore,#PB_Ignore,FrameWidth,FrameHeight)
   
    Protected sizeOfCurrency.l = 8, MaxSize.l = sizeOfCurrency * 256
    Protected cameraHandle.i, Tracker.l, imageHandle.i, err.l
    Protected hbitmapHandle.i, pbImg.i ; to store the HBITMAP handle
    Protected left_coord.i, top.i, w.i
    Protected Name.s = Space(256), Username.s
    Protected NullCharacterPos.i ; handle the null-terminated string
   
    RET = FSDK_OpenVideoCamera(cameraName, @cameraHandle):ErrorDCode(RET, #PB_Compiler_Line)
   
    RET = FSDK_LoadTrackerMemoryFromFile(@Tracker, #TrackerMemoryFile) : ErrorDCode(RET, #PB_Compiler_Line) ; try to load saved tracker state
   
    If Not #FSDKE_OK = RET
      RET = FSDK_CreateTracker(@Tracker) : ErrorDCode(RET, #PB_Compiler_Line) ; if could not be loaded, create a new tracker
    EndIf
   
   
    Protected TrackerMultiPara.s = Unicode2Ansi(@"HandleArbitraryRotations=False; DetermineFaceRotationAngle=False; InternalResizeWidth=100; FaceDetectionThreshold=5;")
   
    RET = FSDK_SetTrackerMultipleParameters(Tracker, @TrackerMultiPara, @err):ErrorDCode(RET, #PB_Compiler_Line)
   
    Protected *IDs.IDs
    Protected Dim IDs.i(255)
    Protected FaceCount.i ; As Currency
    Protected FacePos.TFacePosition

   
    While CurTask=#btnVideoTracker  And qIT.b = #False
        If FSDK_GrabFrame(cameraHandle, @imageHandle) = #FSDKE_OK ; grab the current frame from the camera
         
   
            RET = FSDK_FeedFrame(Tracker, 0, imageHandle, @FaceCount, @IDs(), MaxSize) : ErrorDCode(RET, #PB_Compiler_Line)   ; Changing MaXize2MaxSize;  *IDs, MemorySize(*IDs)  MaXize   maximum 256 faces detected
            Debug "FaceCount: "+FaceCount
           
            RET = FSDK_SaveImageToHBitmap(imageHandle, @hbitmapHandle) : ErrorDCode(RET, #PB_Compiler_Line); display current frame
           
            If RET = #FSDKE_OK
              pbImg=Hbitmap2PBImage(hbitmapHandle)
            EndIf
           
            If IsImage(pbImg)
              SetGadgetState(#imgPrev, ImageID(pbImg))
            EndIf
           
            If FaceCount>0

            For i = 0 To FaceCount - 1
;               Define facePosition.TFacePosition
;               Define *facePosition.TFacePosition
;               RET = FSDK_GetTrackerFacePosition(Tracker, 0, IDs(i), @*facePosition) : ErrorDCode(RET, #PB_Compiler_Line)
                RET = FSDK_GetTrackerFacePosition(Tracker, 0, @IDs(i), @FacePosition) : ErrorDCode(RET, #PB_Compiler_Line)
;               RET = FSDK_GetTrackerFacePosition(Tracker, 0, *IDs\IDs[i], @facePosition):ErrorDCode(RET, #PB_Compiler_Line)
;               left_coord = facePosition\xc - Int(facePosition\w * 0.6)
;               top = facePosition\yc - Int(facePosition\w * 0.5)
;               w = Int(facePosition\w * 1.2)
               
;               ShowMemoryViewer(@FacePos,SizeOf(FacePos))
               
                Debug FacePos\xc;left_coord
                Debug FacePos\yc;top
                Debug FacePos\w;w
               
;               RET = FSDK_GetAllNames(Tracker, *IDs, @Name, 256):ErrorDCode(RET, #PB_Compiler_Line) ; maximum of 256 characters
               
;               NullCharacterPos = FindString(Name, Chr(0))
;               If (NullCharacterPos > 0)
;                   Name = Left(Name, NullCharacterPos - 1)
;               EndIf
;               
;               If (#FSDKE_OK = RET And Len(Name) > 0) ; draw name
;                   SetGadgetText(#strFullNam, Name)
;               EndIf
   
;               If (mouseX >= left_coord And mouseX <= left_coord + w And mouseY >= top And mouseY <= top + w) And zz=1  ; remove zz=1
;                   If (#psRemember = programState)
;                       If (#FSDKE_OK = FSDK_LockID(Tracker, *IDs)):ErrorDCode(RET, #PB_Compiler_Line)
;                           Username = InputRequester("Person's name:", "Enter person's name","") ;get the user name
;                           FSDK_SetName(Tracker, *IDs, Username):ErrorDCode(RET, #PB_Compiler_Line)
;                           If (Len(Username) <= 0)
;                               FSDK_PurgeID(Tracker, *IDs):ErrorDCode(RET, #PB_Compiler_Line)
;                           EndIf
;                           FSDK_UnlockID(Tracker, *IDs\IDs[1]):ErrorDCode(RET, #PB_Compiler_Line)
;                       EndIf
;                   EndIf
;               EndIf
   
            Next
            EndIf 
            programState = #psRecognize
            If IsImage(pbImg)
              DeleteObject_(hbitmapHandle) ; delete the HBITMAP object
              FreeImage(pbImg)
              RET = FSDK_FreeImage(imageHandle):ErrorDCode(RET, #PB_Compiler_Line) ; delete the FSDK image handle
            EndIf 
         EndIf
    Wend
    FreeArray(IDs())   
    FSDK_SaveTrackerMemoryToFile(Tracker, #TrackerMemoryFile):ErrorDCode(RET, #PB_Compiler_Line)
    FSDK_FreeTracker(Tracker):ErrorDCode(RET, #PB_Compiler_Line)
    FSDK_CloseVideoCamera(cameraHandle):ErrorDCode(RET, #PB_Compiler_Line)
    FSDK_FinalizeCapturing():ErrorDCode(RET, #PB_Compiler_Line)
  EndIf 
  vTrack3dStat=#False
EndProcedure       
;}


;{ Main
;{ CreateWin 
  OpenWindow(#wMain, 10, 10, #wWidth*2+13, #wHeight+3, "", #PB_Window_BorderLess)
    RedrawWindow_(WindowID(#wMain),0,0,#RDW_INVALIDATE | #RDW_ERASE)
    UpdateWindow_(WindowID(#wMain))
   
    HideFromTaskBar(WindowID(#wMain),1)
    StickyWindow(#wMain,#True)
    Color = #Black
    InitWW = WindowWidth(#wMain):InitWH = WindowHeight(#wMain)
    SetWindowColor(#wMain, Color)
    ResizeWindow(#wMain,#PB_Ignore,#PB_Ignore,InitWW,InitWH)
    SmartWindowRefresh(#wMain,0)
    HideWindow(#wMain,1)
 
    ScrollAreaGadget(#scrlPrev, 1, 1, #wWidth,#wHeight, #wWidth, #wHeight, 30)
    BindGadgetEvent(#scrlPrev, @scrollPrev())
    ImageGadget(#imgPrev, 0, 0, #wWidth, #wHeight, 0)
    CloseGadgetList()
   
    ScrollAreaGadget(#scrlFace, #wWidth+1, 1, #wWidth,#wHeight, #wWidth, #wHeight, 30)
    BindGadgetEvent(#scrlFace, @scrollFace())
    ImageGadget(#imgFace, 0, 0, #wWidth, #wHeight, 0)
    CloseGadgetList()
   
    ButtonGadget(#btnVideoTracker, InitWW-11,13,10,InitWH-13, "v")
   
    ButtonGadget(#btnQit,InitWW-11,1,10,10,"x")
   
;}   
;{ Loop   
    While WindowEvent():Wend  ; (2)__-=::[ PROCESS ALL EVENTS NOW (gadget creation etc.) ]::=-__
    HideWindow(#wMain,0)      ; (3)__-=::[ SHOW/UN-HIDE THE WINDOW                       ]::=-__
        Repeat
          Select WindowEvent()
             
            Case #PB_Event_CloseWindow
              qIT = #True
             
            Case #PB_Event_Gadget
               Select EventGadget()
                 Case #btnVideoTracker
;{ #btnVideoTracker                   
                   CurTask=#btnVideoTracker
                   If vTrack3dStat=#False
                     CreateThread(@VideoTracker(),0)
                   EndIf
;}                   
                 Case #imgPrev 
                   If vTrack3dStat=#True
                    MouseX=DesktopMouseX()
                    MouseY=DesktopMouseY()
                     Debug MouseX
                     Debug MouseY
                     programState = #psRemember
                   EndIf 
                   
                 Case #btnQit
                   qIT = #True
               EndSelect
           EndSelect
           
        Until qIT.b = #True And vTrack3dStat=#False
;}         
;{ CloseLib
       
        RET=FSDK_Finalize()
        ErrorDCode(RET, #PB_Compiler_Line)
 
        CloseLibrary(FSDKLib)
;}       
;}

;{ ErrHandler
Procedure ErrorHandler()
  Protected ErrMsgz.s, ErrMsg.s = ErrorMessage(), ErrAddr = ErrorAddress(), ErrTgAddr = ErrorTargetAddress(), ErrKod = ErrorCode(), ErrLine = ErrorLine(), ErrFile.s = ErrorFile(), KillStat.b=#True
  ErrMsgz.s = "!!!Error:" + ErrMsg+"  | At Address:"+Str(ErrAddr)+"  | At TGAddress:"+Str(ErrTgAddr)+"  | ErrorCode:"+Str(ErrKod)+"  | ErrorLine:"+Str(ErrLine)+"  | ErrFile:"+ErrFile
  MessageRequester("Err!!!",ErrMsgz.s,#PB_MessageRequester_Ok)
  If ErrKod = #PB_OnError_InvalidMemory
    ;RunProgram(ProgramFilename())
  EndIf 
EndProcedure
;}


IncludeFile:fsdk_62_64dll.pbi
Code:
;My Trial key expired so have to dateback to continue testing
Trial111116.s="KEULVNulurz1SN+xWW1kB0zA8jzPWLPRCW0tXEk7NVZzhru8pdebX7kT1I3L2WDMxOtFH+rfZMVGUdA4yB4+VsM1fjius3/s4iZKhQx4gfOWwAiM9s38jFBspIgYfuzLjwQ4pnAS5SFV++ZDJNH/ectJpSobMmnOXA76jPJCLd4="

;{ FSDKlude
#fsdNGn="fsdk_62_64.dll"
; #fsdNGn="fsdk_61_64.dll"
;}
  ;{ Enumz
Enumeration   ; FSDK_VIDEOCOMPRESSIONTYPE
  #FSDK_MJPEG
EndEnumeration

Enumeration   ; FSDK_IMAGEMODE
  #FSDK_IMAGE_GRAYSCALE_8BIT
  #FSDK_IMAGE_COLOR_24BIT
  #FSDK_IMAGE_COLOR_32BIT
EndEnumeration

Enumeration   ; FSDK_StateCode 
  #FSDKE_OK                                = 0
  #FSDKE_FAILED                            = -1
  #FSDKE_NOT_ACTIVATED                     = -2
  #FSDKE_OUT_OF_MEMORY                     = -3
  #FSDKE_INVALID_ARGUMENT                  = -4
  #FSDKE_IO_ERROR                          = -5
  #FSDKE_IMAGE_TOO_SMALL                   = -6
  #FSDKE_FACE_NOT_FOUND                    = -7
  #FSDKE_INSUFFICIENT_BUFFER_SIZE          = -8
  #FSDKE_UNSUPPORTED_IMAGE_EXTENSION       = -9
  #FSDKE_CANNOT_OPEN_FILE                  = -10
  #FSDKE_CANNOT_CREATE_FILE                = -11
  #FSDKE_BAD_FILE_FORMAT                   = -12
  #FSDKE_FILE_NOT_FOUND                    = -13
  #FSDKE_CONNECTION_CLOSED                 = -14
  #FSDKE_CONNECTION_FAILED                 = -15
  #FSDKE_IP_INIT_FAILED                    = -16
  #FSDKE_NEED_SERVER_ACTIVATION            = -17
  #FSDKE_ID_NOT_FOUND                      = -18
  #FSDKE_ATTRIBUTE_NOT_DETECTED            = -19
  #FSDKE_INSUFFICIENT_TRACKER_MEMORY_LIMIT = -20
  #FSDKE_UNKNOWN_ATTRIBUTE                 = -21
  #FSDKE_UNSUPPORTED_FILE_VERSION          = -22
  #FSDKE_SYNTAX_ERROR                      = -23
  #FSDKE_PARAMETER_NOT_FOUND               = -24
  #FSDKE_INVALID_TEMPLATE                  = -25
  #FSDKE_UNSUPPORTED_TEMPLATE_VERSION      = -26
EndEnumeration

Enumeration   ; FSDK_Facial
 
  #FSDKP_LEFT_EYE                    = 0
  #FSDKP_RIGHT_EYE                   = 1
  #FSDKP_LEFT_EYE_INNER_CORNER       = 24
  #FSDKP_LEFT_EYE_OUTER_CORNER       = 23
  #FSDKP_LEFT_EYE_LOWER_LINE1        = 38
  #FSDKP_LEFT_EYE_LOWER_LINE2        = 27
  #FSDKP_LEFT_EYE_LOWER_LINE3        = 37
  #FSDKP_LEFT_EYE_UPPER_LINE1        = 35
  #FSDKP_LEFT_EYE_UPPER_LINE2        = 28
  #FSDKP_LEFT_EYE_UPPER_LINE3        = 36
  #FSDKP_LEFT_EYE_LEFT_IRIS_CORNER   = 29
  #FSDKP_LEFT_EYE_RIGHT_IRIS_CORNER  = 30
  #FSDKP_RIGHT_EYE_INNER_CORNER      = 25
  #FSDKP_RIGHT_EYE_OUTER_CORNER      = 26
  #FSDKP_RIGHT_EYE_LOWER_LINE1       = 41
  #FSDKP_RIGHT_EYE_LOWER_LINE2       = 31
  #FSDKP_RIGHT_EYE_LOWER_LINE3       = 42
  #FSDKP_RIGHT_EYE_UPPER_LINE1       = 40
  #FSDKP_RIGHT_EYE_UPPER_LINE2       = 32
  #FSDKP_RIGHT_EYE_UPPER_LINE3       = 39
  #FSDKP_RIGHT_EYE_LEFT_IRIS_CORNER  = 33
  #FSDKP_RIGHT_EYE_RIGHT_IRIS_CORNER = 34
  #FSDKP_LEFT_EYEBROW_INNER_CORNER   = 13
  #FSDKP_LEFT_EYEBROW_MIDDLE         = 16
  #FSDKP_LEFT_EYEBROW_MIDDLE_LEFT    = 18
  #FSDKP_LEFT_EYEBROW_MIDDLE_RIGHT   = 19
  #FSDKP_LEFT_EYEBROW_OUTER_CORNER   = 12
  #FSDKP_RIGHT_EYEBROW_INNER_CORNER  = 14
  #FSDKP_RIGHT_EYEBROW_MIDDLE        = 17
  #FSDKP_RIGHT_EYEBROW_MIDDLE_LEFT   = 20
  #FSDKP_RIGHT_EYEBROW_MIDDLE_RIGHT  = 21
  #FSDKP_RIGHT_EYEBROW_OUTER_CORNER  = 15
  #FSDKP_NOSE_TIP                    = 2
  #FSDKP_NOSE_BOTTOM                 = 49
  #FSDKP_NOSE_BRIDGE                 = 22
  #FSDKP_NOSE_LEFT_WING              = 43
  #FSDKP_NOSE_LEFT_WING_OUTER        = 45
  #FSDKP_NOSE_LEFT_WING_LOWER        = 47
  #FSDKP_NOSE_RIGHT_WING             = 44
  #FSDKP_NOSE_RIGHT_WING_OUTER       = 46
  #FSDKP_NOSE_RIGHT_WING_LOWER       = 48
  #FSDKP_MOUTH_RIGHT_CORNER          = 3
  #FSDKP_MOUTH_LEFT_CORNER           = 4
  #FSDKP_MOUTH_TOP                   = 54
  #FSDKP_MOUTH_TOP_INNER             = 61
  #FSDKP_MOUTH_BOTTOM                = 55
  #FSDKP_MOUTH_BOTTOM_INNER          = 64
  #FSDKP_MOUTH_LEFT_TOP              = 56
  #FSDKP_MOUTH_LEFT_TOP_INNER        = 60
  #FSDKP_MOUTH_RIGHT_TOP             = 57
  #FSDKP_MOUTH_RIGHT_TOP_INNER       = 62
  #FSDKP_MOUTH_LEFT_BOTTOM           = 58
  #FSDKP_MOUTH_LEFT_BOTTOM_INNER     = 63
  #FSDKP_MOUTH_RIGHT_BOTTOM          = 59
  #FSDKP_MOUTH_RIGHT_BOTTOM_INNER    = 65
  #FSDKP_NASOLABIAL_FOLD_LEFT_UPPER  = 50
  #FSDKP_NASOLABIAL_FOLD_LEFT_LOWER  = 52
  #FSDKP_NASOLABIAL_FOLD_RIGHT_UPPER = 51
  #FSDKP_NASOLABIAL_FOLD_RIGHT_LOWER = 53
  #FSDKP_CHIN_BOTTOM                 = 11
  #FSDKP_CHIN_LEFT                   = 9
  #FSDKP_CHIN_RIGHT                  = 10
  #FSDKP_FACE_CONTOUR1               = 7
  #FSDKP_FACE_CONTOUR2               = 5
  #FSDKP_FACE_CONTOUR12              = 6
  #FSDKP_FACE_CONTOUR13              = 8
  CompilerIf #fsdNGn = "../../bin/fsdk/fsdk_62_64.dll"
    #FSDK_FACIAL_FEATURE_COUNT = 70;66
    #FSDKP_FACE_CONTOUR14                = 66
    #FSDKP_FACE_CONTOUR15                = 67
    #FSDKP_FACE_CONTOUR16                = 68
    #FSDKP_FACE_CONTOUR17                = 69
  CompilerElseIf #fsdNGn = "../../bin/fsdk/fsdk_61_64.dll"
    #FSDK_FACIAL_FEATURE_COUNT = 66
  CompilerEndIf
EndEnumeration 
;}
  ;{ Constz
#FTemplateArraySize=3456;14326;13326; 3333 ;14326   Array(1)=1  Array(2)=13324
#TFPositionz=50
;}
  ;{ Structz
Structure TPoint                ;- FaceFeatStruct    .TPoint(#FSDK_FACIAL_FEATURE_COUNT - 1)
  x.l
  y.l
EndStructure

Structure TFacePosition         ;- FacePoStruct      .TFacePosition(#TFPositionz)
  xc.l
  yc.l
  w.l
  padding.l
  angle.d
EndStructure

Structure FacePosition
  FacePosition.TFacePosition
EndStructure 


Structure FSDK_VideoFormatInfo   ;- WebcamStruct
  Width.l
  Height.l
  BPP.l
EndStructure

Structure VideoFormatInfo
  VideoFormatInfo.FSDK_VideoFormatInfo[255]
EndStructure 

Structure CameraList
  CameraList.s[255]
EndStructure 

Structure IDs
  IDs.i[255]
EndStructure 

Structure FSDK_IMAGEMODE
    FSDK_IMAGE_GRAYSCALE_8BIT.l
    FSDK_IMAGE_COLOR_24BIT.l
    FSDK_IMAGE_COLOR_32BIT.l
EndStructure
 
Structure FSDK_VIDEOCOMPRESSIONTYPE
    FSDK_MJPEG.l
EndStructure
   
Structure FSDK_STRING
  c_str.b[1024]
EndStructure

Structure MatchStruct            ;- MatchStruct
  Score.q
  guid$
  FullPath$
EndStructure 
;}
  ;{ InitFSDK
If FileSize(#fsdNGn)>0
Global FSDKLib.i = OpenLibrary(#PB_Any, #fsdNGn)
If FSDKLib.i > 0
 
;{ ProtoFSDK

PrototypeC.l FSDK_ActivateLibrary(LicenseKey.s):Global FSDK_ActivateLibrary.FSDK_ActivateLibrary = GetFunction(FSDKLib.i, "FSDK_ActivateLibrary")

PrototypeC.l FSDK_GetHardware_ID(HardwareID.b):Global FSDK_GetHardware_ID.FSDK_GetHardware_ID = GetFunction(FSDKLib.i, "FSDK_GetHardware_ID")

PrototypeC.l FSDK_GetLicenseInfo(LicenseInfo.b):Global FSDK_GetLicenseInfo.FSDK_GetLicenseInfo = GetFunction(FSDKLib.i, "FSDK_GetLicenseInfo")

PrototypeC.l FSDK_SetNumThreads(Num.l):Global FSDK_SetNumThreads.FSDK_SetNumThreads = GetFunction(FSDKLib.i, "FSDK_SetNumThreads")
PrototypeC.l FSDK_GetNumThreads(Num.l):Global FSDK_GetNumThreads.FSDK_GetNumThreads = GetFunction(FSDKLib.i, "FSDK_GetNumThreads")

PrototypeC.l FSDK_Initialize(DataFilesPath.s):Global FSDK_Initialize.FSDK_Initialize = GetFunction(FSDKLib.i, "FSDK_Initialize")
PrototypeC.l FSDK_Finalize():Global FSDK_Finalize.FSDK_Finalize = GetFunction(FSDKLib.i, "FSDK_Finalize")

; Face detection funx

PrototypeC.l FSDK_DetectEyes(Image.l, *FacialFeatures.TPoint):Global FSDK_DetectEyes.FSDK_DetectEyes = GetFunction(FSDKLib.i, "FSDK_DetectEyes")
PrototypeC.l FSDK_DetectEyesInRegion(Image.l, *facePosition.TFacePosition, *FacialFeatures.TPoint):Global FSDK_DetectEyesInRegion.FSDK_DetectEyesInRegion = GetFunction(FSDKLib.i, "FSDK_DetectEyesInRegion")
PrototypeC.l FSDK_DetectFace(Image.l, *facePosition.TFacePosition):Global FSDK_DetectFace.FSDK_DetectFace = GetFunction(FSDKLib.i, "FSDK_DetectFace")
PrototypeC.l FSDK_DetectMultipleFaces(Image.l, DetectedCount.l, *FaceArray.TFacePosition, MaxSize.l):Global FSDK_DetectMultipleFaces.FSDK_DetectMultipleFaces = GetFunction(FSDKLib.i, "FSDK_DetectMultipleFaces")
PrototypeC.l FSDK_DetectFacialFeatures(Image.l, *FacialFeatures.TPoint):Global FSDK_DetectFacialFeatures.FSDK_DetectFacialFeatures = GetFunction(FSDKLib.i, "FSDK_DetectFacialFeatures")
PrototypeC.l FSDK_DetectFacialFeaturesInRegion(Image.l, *facePosition.TFacePosition, *FacialFeatures.TPoint):Global FSDK_DetectFacialFeaturesInRegion.FSDK_DetectFacialFeaturesInRegion= GetFunction(FSDKLib.i, "FSDK_DetectFacialFeaturesInRegion")
PrototypeC.l FSDK_DetectFacialFeaturesEx(Image.l, *FacialFeatures.TPoint, ConfidenceLevels.f):Global FSDK_DetectFacialFeaturesEx.FSDK_DetectFacialFeaturesEx= GetFunction(FSDKLib.i, "FSDK_DetectFacialFeaturesEx")
PrototypeC.l FSDK_DetectFacialFeaturesInRegionEx(Image.l, *facePosition.TFacePosition, *FacialFeatures.TPoint, ConfidenceLevels.f):Global FSDK_DetectFacialFeaturesInRegionEx.FSDK_DetectFacialFeaturesInRegionEx= GetFunction(FSDKLib.i, "FSDK_DetectFacialFeaturesInRegionEx")
PrototypeC.l FSDK_SetFaceDetectionParameters(HandleArbitraryRotations.i, DetermineFaceRotationAngle.i, InternalResizeWidth.l):Global FSDK_SetFaceDetectionParameters.FSDK_SetFaceDetectionParameters= GetFunction(FSDKLib.i, "FSDK_SetFaceDetectionParameters")
PrototypeC.l FSDK_SetFaceDetectionThreshold(threshold.l):Global FSDK_SetFaceDetectionThreshold.FSDK_SetFaceDetectionThreshold= GetFunction(FSDKLib.i, "FSDK_SetFaceDetectionThreshold")

; Image manipulation funx

PrototypeC.l FSDK_CreateEmptyImage(Image.l):Global FSDK_CreateEmptyImage.FSDK_CreateEmptyImage = GetFunction(FSDKLib.i, "FSDK_CreateEmptyImage")

Define License.s
CompilerIf #PB_Compiler_Unicode = #False
  License = Trial111116
  PrototypeC.l FSDK_LoadImageFromFile(Image.l, FileName.s):Global FSDK_LoadImageFromFile.FSDK_LoadImageFromFile = GetFunction(FSDKLib.i, "FSDK_LoadImageFromFile")
  PrototypeC.l FSDK_SaveImageToFile(Image.l, FileName.s):Global FSDK_SaveImageToFile.FSDK_SaveImageToFile = GetFunction(FSDKLib.i, "FSDK_SaveImageToFile")
CompilerElseIf #PB_Compiler_Unicode = #True
  License = Unicode2Ansi(@Trial111116)
  PrototypeC.l FSDK_LoadImageFromFile(Image.l, FileName.s):Global FSDK_LoadImageFromFile.FSDK_LoadImageFromFile = GetFunction(FSDKLib.i, "FSDK_LoadImageFromFileW")
  PrototypeC.l FSDK_SaveImageToFile(Image.l, FileName.s):Global FSDK_SaveImageToFile.FSDK_SaveImageToFile = GetFunction(FSDKLib.i, "FSDK_SaveImageToFileW")
CompilerEndIf 
 
PrototypeC.l FSDK_LoadImageFromBuffer(Image.l, Buffer.b, Width.l, Height.l, ScanLine.l, ImageMode.i):Global FSDK_LoadImageFromBuffer.FSDK_LoadImageFromBuffer = GetFunction(FSDKLib.i, "FSDK_LoadImageFromBuffer")
PrototypeC.l FSDK_LoadImageFromJpegBuffer(Image.l, Buffer.b, BufferLength.l):Global FSDK_LoadImageFromJpegBuffer.FSDK_LoadImageFromJpegBuffer = GetFunction(FSDKLib.i, "FSDK_LoadImageFromJpegBuffer")
PrototypeC.l FSDK_LoadImageFromPngBuffer(Image.l, Buffer.b, BufferLength.l):Global FSDK_LoadImageFromPngBuffer.FSDK_LoadImageFromPngBuffer = GetFunction(FSDKLib.i, "FSDK_LoadImageFromPngBuffer")


PrototypeC.l FSDK_FreeImage(Image.l):Global FSDK_FreeImage.FSDK_FreeImage = GetFunction(FSDKLib.i, "FSDK_FreeImage")   ;BV


PrototypeC.l FSDK_LoadImageFromHBitmap(Image.l, BitmapHandle.l):Global FSDK_LoadImageFromHBitmap.FSDK_LoadImageFromHBitmap = GetFunction(FSDKLib.i, "FSDK_LoadImageFromHBitmap")
PrototypeC.l FSDK_SaveImageToHBitmap(Image.l, BitmapHandle.l):Global FSDK_SaveImageToHBitmap.FSDK_SaveImageToHBitmap = GetFunction(FSDKLib.i, "FSDK_SaveImageToHBitmap")   ; BV, BR


PrototypeC.l FSDK_GetImageBufferSize(Image.l, BufSize.l, ImageMode.i):Global FSDK_GetImageBufferSize.FSDK_GetImageBufferSize = GetFunction(FSDKLib.i, "FSDK_GetImageBufferSize")
PrototypeC.l FSDK_SaveImageToBuffer(Image.l, Buffer.b, ImageMode.i):Global FSDK_SaveImageToBuffer.FSDK_SaveImageToBuffer = GetFunction(FSDKLib.i, "FSDK_SaveImageToBuffer")

PrototypeC.l FSDK_SetJpegCompressionQuality(Quality.l):Global FSDK_SetJpegCompressionQuality.FSDK_SetJpegCompressionQuality = GetFunction(FSDKLib.i, "FSDK_SetJpegCompressionQuality")

PrototypeC.l FSDK_CopyImage(SourceImage.l, DestImage.l):Global FSDK_CopyImage.FSDK_CopyImage = GetFunction(FSDKLib.i, "FSDK_CopyImage")
PrototypeC.l FSDK_ResizeImage(SourceImage.l, ratio.d, DestImage.l):Global FSDK_ResizeImage.FSDK_ResizeImage = GetFunction(FSDKLib.i, "FSDK_ResizeImage")
PrototypeC.l FSDK_MirrorImage(Image.l, UseVerticalInsteadOfHorizontalMirroring.i):Global FSDK_MirrorImage.FSDK_MirrorImage = GetFunction(FSDKLib.i, "FSDK_MirrorImage")
PrototypeC.l FSDK_RotateImage90(SourceImage.l, Multiplier.l, DestImage.l):Global FSDK_RotateImage90.FSDK_RotateImage90 = GetFunction(FSDKLib.i, "FSDK_RotateImage90")
PrototypeC.l FSDK_RotateImage(SourceImage.l, angle.d, DestImage.l):Global FSDK_RotateImage.FSDK_RotateImage = GetFunction(FSDKLib.i, "FSDK_RotateImage")
PrototypeC.l FSDK_RotateImageCenter(SourceImage.l, angle.d, xCenter.d, yCenter.d, DestImage.l):Global FSDK_RotateImageCenter.FSDK_RotateImageCenter = GetFunction(FSDKLib.i, "FSDK_RotateImageCenter")
PrototypeC.l FSDK_CopyRect(SourceImage.l, x1.l, y1.l, x2.l, y2.l, DestImage.l):Global FSDK_CopyRect.FSDK_CopyRect = GetFunction(FSDKLib.i, "FSDK_CopyRect")
PrototypeC.l FSDK_CopyRectReplicateBorder(SourceImage.l, x1.l, y1.l, x2.l, y2.l, DestImage.l):Global FSDK_CopyRectReplicateBorder.FSDK_CopyRectReplicateBorder = GetFunction(FSDKLib.i, "FSDK_CopyRectReplicateBorder")


PrototypeC.l FSDK_GetImageWidth(SourceImage.l, Width.l):Global FSDK_GetImageWidth.FSDK_GetImageWidth = GetFunction(FSDKLib.i, "FSDK_GetImageWidth")
PrototypeC.l FSDK_GetImageHeight(SourceImage.l, Height.l):Global FSDK_GetImageHeight.FSDK_GetImageHeight = GetFunction(FSDKLib.i, "FSDK_GetImageHeight")

PrototypeC.l FSDK_ExtractFaceImage(Image.l, *FacialFeatures.TPoint, Width.l, Height.l, ExtractedFaceImage.l, *ResizedFeatures.TPoint):Global FSDK_ExtractFaceImage.FSDK_ExtractFaceImage = GetFunction(FSDKLib.i, "FSDK_ExtractFaceImage")



; Matching

PrototypeC.l FSDK_GetFaceTemplate(Image.l, FaceTemplate.b):Global FSDK_GetFaceTemplate.FSDK_GetFaceTemplate = GetFunction(FSDKLib.i, "FSDK_GetFaceTemplate")
PrototypeC.l FSDK_GetFaceTemplateInRegion(Image.l, *facePosition.TFacePosition, FaceTemplate.b):Global FSDK_GetFaceTemplateInRegion.FSDK_GetFaceTemplateInRegion = GetFunction(FSDKLib.i, "FSDK_GetFaceTemplateInRegion")
PrototypeC.l FSDK_GetFaceTemplateUsingFeatures(Image.l, *FacialFeatures.TPoint, FaceTemplate.b):Global FSDK_GetFaceTemplateUsingFeatures.FSDK_GetFaceTemplateUsingFeatures = GetFunction(FSDKLib.i, "FSDK_GetFaceTemplateUsingFeatures")
PrototypeC.l FSDK_GetFaceTemplateUsingEyes(Image.l, *eyeCoords.TPoint, FaceTemplate.b):Global FSDK_GetFaceTemplateUsingEyes.FSDK_GetFaceTemplateUsingEyes = GetFunction(FSDKLib.i, "FSDK_GetFaceTemplateUsingEyes")
PrototypeC.l FSDK_MatchFaces(FaceTemplate1.b, FaceTemplate2.b, similarity.q):Global FSDK_MatchFaces.FSDK_MatchFaces = GetFunction(FSDKLib.i, "FSDK_MatchFaces")
PrototypeC.l FSDK_GetMatchingThresholdAtFAR(FARValue.f, threshold.q):Global FSDK_GetMatchingThresholdAtFAR.FSDK_GetMatchingThresholdAtFAR = GetFunction(FSDKLib.i, "FSDK_GetMatchingThresholdAtFAR")
PrototypeC.l FSDK_GetMatchingThresholdAtFRR(FRRValue.f, threshold.q):Global FSDK_GetMatchingThresholdAtFRR.FSDK_GetMatchingThresholdAtFRR = GetFunction(FSDKLib.i, "FSDK_GetMatchingThresholdAtFRR")
PrototypeC.l FSDK_GetDetectedFaceConfidence(Confidence.l):Global FSDK_GetDetectedFaceConfidence.FSDK_GetDetectedFaceConfidence = GetFunction(FSDKLib.i, "FSDK_GetDetectedFaceConfidence")





PrototypeC.l FSDK_InitializeCapturing():Global FSDK_InitializeCapturing.FSDK_InitializeCapturing = GetFunction(FSDKLib.i, "FSDK_InitializeCapturing")
PrototypeC.l FSDK_FinalizeCapturing():Global FSDK_FinalizeCapturing.FSDK_FinalizeCapturing = GetFunction(FSDKLib.i, "FSDK_FinalizeCapturing")
PrototypeC.l FSDK_SetCameraNaming(UseDevicePathAsName.i):Global FSDK_SetCameraNaming.FSDK_SetCameraNaming = GetFunction(FSDKLib.i, "FSDK_SetCameraNaming")
PrototypeC.l FSDK_GetCameraList(VCameraList.i, CameraCount.l):Global FSDK_GetCameraList.FSDK_GetCameraList = GetFunction(FSDKLib.i, "FSDK_GetCameraList")  ; byRef, byRef
PrototypeC.l FSDK_GetCameraListEx(VCameraNameList.q, VCameraDevicePathList.q, CameraCount.l):Global FSDK_GetCameraListEx.FSDK_GetCameraListEx = GetFunction(FSDKLib.i, "FSDK_GetCameraListEx")  ; byRef, byRef, byRef
PrototypeC.l FSDK_GetVideoFormatList(cameraName.i, VVideoFormatList.i, VideoFormatCount.l):Global FSDK_GetVideoFormatList.FSDK_GetVideoFormatList = GetFunction(FSDKLib.i, "FSDK_GetVideoFormatList")  ; cameraName.s  byRef*3
PrototypeC.l FSDK_SetVideoFormat(cameraName.i, *VideoFormat.FSDK_VideoFormatInfo):Global FSDK_SetVideoFormat.FSDK_SetVideoFormat = GetFunction(FSDKLib.i, "FSDK_SetVideoFormat")
PrototypeC.l FSDK_OpenVideoCamera(cameraName.s, cameraHandle.l):Global FSDK_OpenVideoCamera.FSDK_OpenVideoCamera = GetFunction(FSDKLib.i, "FSDK_OpenVideoCamera")  ; byVal, byRef
PrototypeC.l FSDK_CloseVideoCamera(cameraHandle.l):Global FSDK_CloseVideoCamera.FSDK_CloseVideoCamera = GetFunction(FSDKLib.i, "FSDK_CloseVideoCamera")   ; byVal
PrototypeC.l FSDK_GrabFrame(cameraHandle.l, Image.l):Global FSDK_GrabFrame.FSDK_GrabFrame = GetFunction(FSDKLib.i, "FSDK_GrabFrame") ; byVal, byRef
PrototypeC.l FSDK_Paint(DC.l, Image.l):Global FSDK_Paint.FSDK_Paint = GetFunction(FSDKLib.i, "FSDK_Paint")    ;byVal, byVal


PrototypeC.l FSDK_OpenIPVideoCamera(CompressionType.i, URL.s, Username.s, Password.s, TimeoutSeconds.l, cameraHandle.l):Global FSDK_OpenIPVideoCamera.FSDK_OpenIPVideoCamera = GetFunction(FSDKLib.i, "FSDK_OpenIPVideoCamera") ; cameraHandle byRef

PrototypeC.l FSDK_SetHTTPProxy(ServerNameOrIPAddress.s, Port.l, Username.s, Password.s):Global FSDK_SetHTTPProxy.FSDK_SetHTTPProxy = GetFunction(FSDKLib.i, "FSDK_SetHTTPProxy")


; Tracker

PrototypeC.l FSDK_CreateTracker(Tracker.l):Global FSDK_CreateTracker.FSDK_CreateTracker = GetFunction(FSDKLib.i, "FSDK_CreateTracker")  ; BR
PrototypeC.l FSDK_FreeTracker(Tracker.l):Global FSDK_FreeTracker.FSDK_FreeTracker = GetFunction(FSDKLib.i, "FSDK_FreeTracker")  ; BV
PrototypeC.l FSDK_ClearTracker(Tracker.l):Global FSDK_ClearTracker.FSDK_ClearTracker = GetFunction(FSDKLib.i, "FSDK_ClearTracker")  ; BV
PrototypeC.l FSDK_SetTrackerParameter(Tracker.l, ParameterName.s, ParameterValue.s):Global FSDK_SetTrackerParameter.FSDK_SetTrackerParameter = GetFunction(FSDKLib.i, "FSDK_SetTrackerParameter")   ; BV*3
PrototypeC.l FSDK_SetTrackerMultipleParameters(Tracker.l, Parameters.i, ErrorPosition.l):Global FSDK_SetTrackerMultipleParameters.FSDK_SetTrackerMultipleParameters = GetFunction(FSDKLib.i, "FSDK_SetTrackerMultipleParameters")   ; BV*2, BR
PrototypeC.l FSDK_GetTrackerParameter(Tracker.l, ParameterName.s, ParameterValue.s, MaxSizeInBytes.d):Global FSDK_GetTrackerParameter.FSDK_GetTrackerParameter = GetFunction(FSDKLib.i, "FSDK_GetTrackerParameter")  ; BV*4
PrototypeC.l FSDK_FeedFrame(Tracker.l, CameraIdx.l, Image.l, FaceCount.l, *IDs, MaxSizeInBytes.l):Global FSDK_FeedFrame.FSDK_FeedFrame = GetFunction(FSDKLib.i, "FSDK_FeedFrame") ; BV*3, BR*2, BV
PrototypeC.l FSDK_GetTrackerEyes(Tracker.l, CameraIdx.d, id.d, *FacialFeatures.TPoint):Global FSDK_GetTrackerEyes.FSDK_GetTrackerEyes = GetFunction(FSDKLib.i, "FSDK_GetTrackerEyes") ; BV*3, BR
PrototypeC.l FSDK_GetTrackerFacialFeatures(Tracker.l, CameraIdx.d, id.d, *FacialFeatures.TPoint):Global FSDK_GetTrackerFacialFeatures.FSDK_GetTrackerFacialFeatures = GetFunction(FSDKLib.i, "FSDK_GetTrackerFacialFeatures")  ; BV*3, BR
PrototypeC.l FSDK_GetTrackerFacePosition(Tracker.l, CameraIdx.d, id.d, *facePosition.TFacePosition):Global FSDK_GetTrackerFacePosition.FSDK_GetTrackerFacePosition = GetFunction(FSDKLib.i, "FSDK_GetTrackerFacePosition")  ; BV*3, BR
PrototypeC.l FSDK_LockID(Tracker.l, id.d):Global FSDK_LockID.FSDK_LockID = GetFunction(FSDKLib.i, "FSDK_LockID")  ; BV*2
PrototypeC.l FSDK_UnlockID(Tracker.l, id.d):Global FSDK_UnlockID.FSDK_UnlockID = GetFunction(FSDKLib.i, "FSDK_UnlockID") ; BV*2
PrototypeC.l FSDK_PurgeID(Tracker.l, id.d):Global FSDK_PurgeID.FSDK_PurgeID = GetFunction(FSDKLib.i, "FSDK_PurgeID") ; BV*2
PrototypeC.l FSDK_GetName(Tracker.l, id.d, Name.s, MaxSizeInBytes.d):Global FSDK_GetName.FSDK_GetName = GetFunction(FSDKLib.i, "FSDK_GetName")  ; BV*4
PrototypeC.l FSDK_GetAllNames(Tracker.l, id.d, Names.i, MaxSizeInBytes.d):Global FSDK_GetAllNames.FSDK_GetAllNames = GetFunction(FSDKLib.i, "FSDK_GetAllNames")  ; BV*4

PrototypeC.l FSDK_SetName(Tracker.l, id.d, Name.s):Global FSDK_SetName.FSDK_SetName = GetFunction(FSDKLib.i, "FSDK_SetName")  ; BV*3
PrototypeC.l FSDK_GetIDReassignment(Tracker.l, id.d, ReassignedID.d):Global FSDK_GetIDReassignment.FSDK_GetIDReassignment = GetFunction(FSDKLib.i, "FSDK_GetIDReassignment")  ; BV*2, BR
PrototypeC.l FSDK_GetSimilarIDCount(Tracker.l, id.d, Count.d):Global FSDK_GetSimilarIDCount.FSDK_GetSimilarIDCount = GetFunction(FSDKLib.i, "FSDK_GetSimilarIDCount")  ; BV*2, BR
PrototypeC.l FSDK_GetSimilarIDList(Tracker.l, id.d, SimilarIDList.d, MaxSizeInBytes.d):Global FSDK_GetSimilarIDList.FSDK_GetSimilarIDList = GetFunction(FSDKLib.i, "FSDK_GetSimilarIDList")  ; BV*2, BR, BV
PrototypeC.l FSDK_SaveTrackerMemoryToFile(Tracker.l, FileName.s):Global FSDK_SaveTrackerMemoryToFile.FSDK_SaveTrackerMemoryToFile = GetFunction(FSDKLib.i, "FSDK_SaveTrackerMemoryToFile")  ; BV*2
PrototypeC.l FSDK_LoadTrackerMemoryFromFile(Tracker.l, FileName.s):Global FSDK_LoadTrackerMemoryFromFile.FSDK_LoadTrackerMemoryFromFile = GetFunction(FSDKLib.i, "FSDK_LoadTrackerMemoryFromFile")  ; BR, BV
PrototypeC.l FSDK_GetTrackerMemoryBufferSize(Tracker.l, BufSize.d):Global FSDK_GetTrackerMemoryBufferSize.FSDK_GetTrackerMemoryBufferSize = GetFunction(FSDKLib.i, "FSDK_GetTrackerMemoryBufferSize")  ; BV, BR
PrototypeC.l FSDK_SaveTrackerMemoryToBuffer(Tracker.l, Buffer.b, MaxSizeInBytes.d):Global FSDK_SaveTrackerMemoryToBuffer.FSDK_SaveTrackerMemoryToBuffer = GetFunction(FSDKLib.i, "FSDK_SaveTrackerMemoryToBuffer")  ; BV, BR, BV
PrototypeC.l FSDK_LoadTrackerMemoryFromBuffer(Tracker.l, Buffer.b):Global FSDK_LoadTrackerMemoryFromBuffer.FSDK_LoadTrackerMemoryFromBuffer = GetFunction(FSDKLib.i, "FSDK_LoadTrackerMemoryFromBuffer")  ; BR*2

; Facial attributes

PrototypeC.l FSDK_GetTrackerFacialAttribute(Tracker.l, CameraIdx.d, id.d, AttributeName.s, AttributeValues.s, MaxSizeInBytes.d):Global FSDK_GetTrackerFacialAttribute.FSDK_GetTrackerFacialAttribute = GetFunction(FSDKLib.i, "FSDK_GetTrackerFacialAttribute")   ; BV*6
PrototypeC.l FSDK_DetectFacialAttributeUsingFeatures(Image.l, *FacialFeatures.TPoint, AttributeName.s, AttributeValues.s, MaxSizeInBytes.d):Global FSDK_DetectFacialAttributeUsingFeatures.FSDK_DetectFacialAttributeUsingFeatures = GetFunction(FSDKLib.i, "FSDK_DetectFacialAttributeUsingFeatures")  ; BV, BR, BV*3
PrototypeC.l FSDK_GetValueConfidence(AttributeValues.s, Value.s, Confidence.f):Global FSDK_GetValueConfidence.FSDK_GetValueConfidence = GetFunction(FSDKLib.i, "FSDK_GetValueConfidence")  ; BV*2, BR
;}
Else
  MessageRequester("Err","err opning fLib",#PB_MessageRequester_Ok)
  End
EndIf
Else
  MessageRequester("Err","fLib NotXists",#PB_MessageRequester_Ok)
  End
EndIf
;}
  ;{ ActiLib
  If FSDK_ActivateLibrary(License) = 0 And FSDK_Initialize("") = 0
    FSDK_SetNumThreads(4)
  Else
    MessageRequester("Err","Faild ActiFLib",#PB_MessageRequester_Ok)
    End
  EndIf
;}
;{ FSDKErrCodz
;{ FSDKErrDebg
Declare.s  ErrorDCode(nbr.i,LayNo.l)
Procedure.s ErrorDCode(nbr.i,LayNo.l)
  Protected ErrString.s
  Select nbr
    Case  0
      ErrString = "OK"
    Case -1
       ErrString = "FAILED"
    Case -2
       ErrString = "NOT_ACTIVATED"
    Case -3
       ErrString = "OUT_OF_MEMORY"
    Case -4
       ErrString = "INVALID_ARGUMENT"
    Case  -5
       ErrString = "IO_ERROR"
    Case -6
       ErrString = "IMAGE_TOO_SMALL"
    Case   -7
       ErrString = "FACE_NOT_FOUND"
    Case   -8
       ErrString = "INSUFFICIENT_BUFFER_SIZE"
    Case   -9
       ErrString = "UNSUPPORTED_IMAGE_EXTENSION"
    Case   -10
       ErrString = "CANNOT_OPEN_FILE"
    Case   -11
       ErrString = "CANNOT_CREATE_FILE"
    Case   -12
       ErrString = "BAD_FILE_FORMAT"
    Case   -13
       ErrString = "FILE_NOT_FOUND"
    Case   -14
       ErrString = "CONNECTION_CLOSED"
    Case   -15
       ErrString = "CONNECTION_FAILED"
    Case   -16
       ErrString = "IP_INIT_FAILED"
    Case   -17
       ErrString = "NEED_SERVER_ACTIVATION"
    Case   -18
       ErrString = "ID_NOT_FOUND"
    Case   -19
       ErrString = "ATTRIBUTE_NOT_DETECTED"
    Case   -20
       ErrString = "INSUFFICIENT_TRACKER_MEMORY_LIMIT"
    Case   -21
       ErrString = "UNKNOWN_ATTRIBUTE"
    Case   -22
       ErrString = "UNSUPPORTED_FILE_VERSION"
    Case   -23
       ErrString = "SYNTAX_ERROR"
    Case   -24
       ErrString = "PARAMETER_NOT_FOUND"
    Case   -25
       ErrString = "INVALID_TEMPLATE"
    Case   -26
       ErrString = "UNSUPPORTED_TEMPLATE_VERSION"
  EndSelect
  If nbr<>0
    ErrString+"  "+Str(LayNo)
    Debug ErrString
    ProcedureReturn ErrString
  EndIf
EndProcedure
;}
;}


Dll_FSDK
https://www.dropbox.com/s/5pys5ypubh3wye1/fsdk_62_64.dll?dl=1


Haut
 Profil  
Répondre en citant le message  
Afficher les messages postés depuis:  Trier par  
Poster un nouveau sujet Répondre au sujet  [ 17 messages ]  Aller à la page Précédente  1, 2

Heures au format UTC + 1 heure


Qui est en ligne

Utilisateurs parcourant ce forum: Google [Bot] et 1 invité


Vous ne pouvez pas poster de nouveaux sujets
Vous ne pouvez pas répondre aux sujets
Vous ne pouvez pas éditer vos messages
Vous ne pouvez pas supprimer vos messages

Rechercher:
Aller à:  

 


Powered by phpBB © 2008 phpBB Group | Traduction par: phpBB-fr.com
subSilver+ theme by Canver Software, sponsor Sanal Modifiye