Chnage
This commit is contained in:
parent
0b56f79b4d
commit
605112cd9f
22 changed files with 485 additions and 328 deletions
|
|
@ -5,6 +5,58 @@
|
|||
<Background> "0xeae6e1" </Background>
|
||||
<Volume> SoundVolume </Volume>
|
||||
<EventOpen>
|
||||
Var KornCropCountDown = 5
|
||||
Var KornIsShuttered = "false"
|
||||
Var KornOpenFaceCompareCountDown = 10
|
||||
Var KornIsCropped = "false"
|
||||
|
||||
; Note:
|
||||
; - Can't change roi and camera params in xml,
|
||||
; because the java code is not dynamic.
|
||||
; (It's a work-around method. (Maybe) Improve later.)
|
||||
|
||||
; Absolute positions
|
||||
Var KornRoiX = 440
|
||||
Var KornRoiY = 909
|
||||
Var KornRoiW = 200
|
||||
Var KornRoiH = 200
|
||||
Var KornRoiStepY = 40
|
||||
|
||||
; Re-calculate these values when either,
|
||||
; - CameraX size changes
|
||||
; - CameraX's hidden part size changes
|
||||
Var KornCamDisplayX = 285
|
||||
Var KornCamDisplayY = 781
|
||||
Var KornCamDisplayW = 500
|
||||
Var KornCamDisplayH = 680
|
||||
Var KornCamYHidden = 208
|
||||
|
||||
Var KornCamX = KornCamDisplayX
|
||||
Var KornCamY = KornCamDisplayY - KornCamYHidden
|
||||
Var KornCamW = KornCamDisplayW
|
||||
Var KornCamH = KornCamDisplayH + KornCamYHidden
|
||||
|
||||
Var KornRoiYMin = KornCamDisplayY
|
||||
Var KornRoiYRange = 220
|
||||
Var KornRoiYMax = KornCamDisplayY + KornRoiYRange
|
||||
|
||||
; To shrink the roi size, use this variable,
|
||||
; (value is between 0 and 100 (unit = percent))
|
||||
Var KornRoiPercentShrink = 30
|
||||
Var KornCamRoiDeltaX = KornRoiW * KornRoiPercentShrink
|
||||
Var KornCamRoiDeltaX = KornCamRoiDeltaX / 100
|
||||
Var KornCamRoiDeltaY = KornRoiH * KornRoiPercentShrink
|
||||
Var KornCamRoiDeltaY = KornCamRoiDeltaY / 100
|
||||
Var KornCamRoiW = KornRoiW - KornCamRoiDeltaX
|
||||
Var KornCamRoiH = KornRoiH - KornCamRoiDeltaY
|
||||
|
||||
; CameraX params
|
||||
Var KornCameraXOffsetX = 150
|
||||
Var KornCameraXX = KornCamDisplayX - KornCameraXOffsetX
|
||||
Var KornCameraXY = KornCamDisplayY
|
||||
Var KornCameraXW = 800
|
||||
Var KornCameraXH = 800
|
||||
; 800 = magic number
|
||||
|
||||
Var CamFlag = 0
|
||||
Var CamCount = 0
|
||||
|
|
@ -72,6 +124,7 @@
|
|||
|
||||
Var FrameOfFaceStepMoveY = 40
|
||||
|
||||
Var FrameOfFaceXPosition = 440
|
||||
Var FrameOfFaceYPosition = 909
|
||||
Var FrameOfFaceCropImageYPosition = 230
|
||||
</EventOpen>
|
||||
|
|
@ -175,7 +228,8 @@
|
|||
|
||||
|
||||
If Adult20 = 1 Then
|
||||
LivenessCommand "SetY" 210
|
||||
LivenessCommand "SetY" KornRoiY
|
||||
LivenessCommand "SetX" KornRoiX
|
||||
|
||||
LivenessCommand "start" 0
|
||||
|
||||
|
|
@ -206,6 +260,10 @@
|
|||
DEBUGVAR CountDownDelayReadCardID
|
||||
DEBUGVAR ShutterResult
|
||||
DEBUGVAR IDCardState
|
||||
|
||||
Var KornCamRoiDeltaXTmp = KornCamRoiDeltaX / 2
|
||||
Var KornCamRoiX = KornRoiX + KornCamRoiDeltaXTmp
|
||||
Var KornCamRoiY = KornRoiY
|
||||
|
||||
|
||||
If IDBirthdate = "" Then
|
||||
|
|
@ -230,20 +288,51 @@
|
|||
DEBUGVAR LivenessResult
|
||||
|
||||
If LivenessResult = "pass" Then
|
||||
Var LivenessShowString = "Pass "
|
||||
Var load_gif_stage = "Enable"
|
||||
|
||||
;CROP_IMAGE "/mnt/sdcard/camera1_alter.jpg" 170 FrameOfFaceCropImageYPosition 380 500 "/mnt/sdcard/camera1.jpg"
|
||||
If KornCropCountDown > 0 Then
|
||||
DEBUGVAR KornCropCountDown
|
||||
Var KornCropCountDown = KornCropCountDown - 1
|
||||
|
||||
CROP_IMAGE "/mnt/sdcard/camera1_alter.jpg" LivenessFramePositionX FrameOfFaceCropImageYPosition 200 200 "/mnt/sdcard/camera1.jpg"
|
||||
Var LivenessShowString = "Pass "
|
||||
Var load_gif_stage = "Enable"
|
||||
|
||||
Open "ROOT/taobin_project/xml/page_face_compare.xml"
|
||||
EndIff
|
||||
If KornIsShuttered = "false" Then
|
||||
CameraCmd "usbfront" "shutter" "/mnt/sdcard/camera1.jpg"
|
||||
|
||||
Var KornShutter = "Shuttered"
|
||||
DEBUGVAR KornShutter
|
||||
|
||||
Var KornIsShuttered = "true"
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If KornCropCountDown <= 0 Then
|
||||
|
||||
If KornIsCropped = "false" Then
|
||||
|
||||
CROP_IMAGE "/mnt/sdcard/camera1.jpg" "/mnt/sdcard/camera1_alter.jpg"
|
||||
|
||||
Var KornCrop = "Cropped"
|
||||
DEBUGVAR KornCrop
|
||||
|
||||
Var KornIsCropped = "true"
|
||||
EndIf
|
||||
|
||||
DEBUGVAR KornOpenFaceCompareCountDown
|
||||
Var KornOpenFaceCompareCountDown = KornOpenFaceCompareCountDown - 1
|
||||
|
||||
If KornOpenFaceCompareCountDown <= 0 Then
|
||||
Open "ROOT/taobin_project/xml/page_face_compare.xml"
|
||||
EndIf
|
||||
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
If LivenessResult = "fail" Then
|
||||
Var LivenessRestartCount = LivenessRestartCount + 1
|
||||
If LivenessRestartCount = 2 Then
|
||||
Var LivenessRestartCount = 0
|
||||
LivenessCommand "stop" 0
|
||||
LivenessCommand "start" 0
|
||||
Var LivenessResult = "-"
|
||||
EndIf
|
||||
|
|
@ -336,12 +425,13 @@
|
|||
<Volume> SoundVolume </Volume>
|
||||
<EventClick>
|
||||
SAVELOG "Allow up"
|
||||
If LivenessFramePositionY > 120 Then
|
||||
Var LivenessFramePositionYTmp = LivenessFramePositionY - FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceYPosition = FrameOfFaceYPosition - FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceCropImageYPosition = FrameOfFaceCropImageYPosition - FrameOfFaceStepMoveY
|
||||
DEBUGVAR LivenessFramePositionYTmp
|
||||
LivenessCommand "SetY" LivenessFramePositionYTmp
|
||||
|
||||
Var KornRoiYTmp = KornRoiY - KornRoiStepY
|
||||
If KornRoiYTmp > KornRoiYMin Then
|
||||
Var KornRoiY = KornRoiYTmp
|
||||
DEBUGVAR KornRoiY
|
||||
LivenessCommand "SetY" KornRoiY
|
||||
LivenessCommand "stop" 0
|
||||
LivenessCommand "start" 0
|
||||
EndIf
|
||||
</EventClick>
|
||||
|
|
@ -359,12 +449,13 @@
|
|||
<Volume> SoundVolume </Volume>
|
||||
<EventClick>
|
||||
SAVELOG "Allow down"
|
||||
If LivenessFramePositionY < 340 Then
|
||||
Var LivenessFramePositionYTmp = LivenessFramePositionY + FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceYPosition = FrameOfFaceYPosition + FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceCropImageYPosition = FrameOfFaceCropImageYPosition + FrameOfFaceStepMoveY
|
||||
DEBUGVAR LivenessFramePositionYTmp
|
||||
LivenessCommand "SetY" LivenessFramePositionYTmp
|
||||
|
||||
Var KornRoiYTmp = KornRoiY + KornRoiStepY
|
||||
If KornRoiYTmp < KornRoiYMax Then
|
||||
Var KornRoiY = KornRoiYTmp
|
||||
DEBUGVAR KornRoiY
|
||||
LivenessCommand "SetY" KornRoiY
|
||||
LivenessCommand "stop" 0
|
||||
LivenessCommand "start" 0
|
||||
EndIf
|
||||
</EventClick>
|
||||
|
|
@ -383,12 +474,13 @@
|
|||
<Volume> SoundVolume </Volume>
|
||||
<EventClick>
|
||||
SAVELOG "Allow up"
|
||||
If LivenessFramePositionY > 120 Then
|
||||
Var LivenessFramePositionYTmp = LivenessFramePositionY - FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceYPosition = FrameOfFaceYPosition - FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceCropImageYPosition = FrameOfFaceCropImageYPosition - FrameOfFaceStepMoveY
|
||||
DEBUGVAR LivenessFramePositionYTmp
|
||||
LivenessCommand "SetY" LivenessFramePositionYTmp
|
||||
|
||||
Var KornRoiYTmp = KornRoiY - KornRoiStepY
|
||||
If KornRoiYTmp > KornRoiYMin Then
|
||||
Var KornRoiY = KornRoiYTmp
|
||||
DEBUGVAR KornRoiY
|
||||
LivenessCommand "SetY" KornRoiY
|
||||
LivenessCommand "stop" 0
|
||||
LivenessCommand "start" 0
|
||||
EndIf
|
||||
</EventClick>
|
||||
|
|
@ -406,14 +498,16 @@
|
|||
<Volume> SoundVolume </Volume>
|
||||
<EventClick>
|
||||
SAVELOG "Allow down"
|
||||
If LivenessFramePositionY < 340 Then
|
||||
Var LivenessFramePositionYTmp = LivenessFramePositionY + FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceYPosition = FrameOfFaceYPosition + FrameOfFaceStepMoveY
|
||||
Var FrameOfFaceCropImageYPosition = FrameOfFaceCropImageYPosition + FrameOfFaceStepMoveY
|
||||
DEBUGVAR LivenessFramePositionYTmp
|
||||
LivenessCommand "SetY" LivenessFramePositionYTmp
|
||||
LivenessCommand "start" 0
|
||||
EndIf
|
||||
|
||||
;Var KornRoiYTmp = KornRoiY + KornRoiStepY
|
||||
;If KornRoiYTmp < KornRoiYMax Then
|
||||
; Var KornRoiY = KornRoiYTmp
|
||||
; DEBUGVAR KornRoiY
|
||||
; LivenessCommand "SetY" KornRoiY
|
||||
; LivenessCommand "stop" 0
|
||||
; LivenessCommand "start" 0
|
||||
;EndIf
|
||||
Var LivenessResult = "pass"
|
||||
</EventClick>
|
||||
</Button>
|
||||
|
||||
|
|
@ -426,21 +520,31 @@
|
|||
</Image>
|
||||
|
||||
<CameraX>
|
||||
<X> 140 </X>
|
||||
<Y> 781 </Y>
|
||||
<X> KornCameraXX </X>
|
||||
;140
|
||||
<Y> KornCameraXY </Y>
|
||||
;781
|
||||
<Name>"usbfront"</Name>
|
||||
<Width> 800 </Width>
|
||||
<Height> 800 </Height>
|
||||
<Width> KornCameraXW </Width>
|
||||
;800
|
||||
; Display width is about 500, (full width is about the same)
|
||||
<Height> KornCameraXH </Height>
|
||||
;800
|
||||
; Display height is about 680, (full height = 888)
|
||||
<LivenessParameterWhenOK> "FileName=/mnt/sdcard/camera1_alter.jpg" </LivenessParameterWhenOK>
|
||||
</CameraX>
|
||||
|
||||
|
||||
|
||||
<Image>
|
||||
<X> LivenessFramePositionX </X>
|
||||
<Y> FrameOfFaceYPosition </Y>
|
||||
<Width> 200 </Width>
|
||||
<Height> 200 </Height>
|
||||
<X> KornCamRoiX </X>
|
||||
;FrameOfFaceXPosition
|
||||
<Y> KornCamRoiY </Y>
|
||||
;FrameOfFaceYPosition
|
||||
<Width> KornCamRoiW </Width>
|
||||
;200
|
||||
<Height> KornCamRoiH </Height>
|
||||
;200
|
||||
<State> CameraStage </State>
|
||||
<Filename> "ROOT/taobin_project/image/liveness/bg3.png" </Filename>
|
||||
</Image>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue