diff --git a/camera-shutter-click-01.wav b/camera-shutter-click-01.wav new file mode 100644 index 0000000..bb562e1 Binary files /dev/null and b/camera-shutter-click-01.wav differ diff --git a/config.properties b/config.properties index c340566..7a2cdbe 100644 --- a/config.properties +++ b/config.properties @@ -1,9 +1,9 @@ -#Fri Mar 21 14:45:24 ICT 2025 -AudioPhase1=C\:\\Users\\rdkar\\OneDrive\\Documents\\IntelliJ Project\\ErhaCam\\audio\\phase1.mp3 -AudioPhase2=C\:\\Users\\rdkar\\OneDrive\\Documents\\IntelliJ Project\\ErhaCam\\audio\\phase2.mp3 -AudioPhase3=C\:\\Users\\rdkar\\OneDrive\\Documents\\IntelliJ Project\\ErhaCam\\audio\\phase3.mp3 -AudioPhase4=C\:\\Users\\rdkar\\OneDrive\\Documents\\IntelliJ Project\\ErhaCam\\audio\\phase4.mp3 -AudioPhase5=C\:\\Users\\rdkar\\OneDrive\\Documents\\IntelliJ Project\\ErhaCam\\audio\\phase5.mp3 +#Mon Mar 24 13:39:02 ICT 2025 +AudioPhase1=C\:\\Users\\Erha\\IdeaProjects\\ErhaCam\\audio\\phase1.mp3 +AudioPhase2=C\:\\Users\\Erha\\IdeaProjects\\ErhaCam\\audio\\phase2.mp3 +AudioPhase3=C\:\\Users\\Erha\\IdeaProjects\\ErhaCam\\audio\\phase3.mp3 +AudioPhase4=C\:\\Users\\Erha\\IdeaProjects\\ErhaCam\\audio\\phase4.mp3 +AudioPhase5=C\:\\Users\\Erha\\IdeaProjects\\ErhaCam\\audio\\phase5.mp3 CameraCenter= CameraConfigCenter={"Brightness"\:0.0,"Contrast"\:0.0,"Saturation"\:0.0,"Hue"\:0.0,"Gain"\:1.0,"Exposure"\:1.0,"Sharpness"\:0.0,"Gamma"\:0.0,"AutoExposure"\:true,"AutoFocus"\:true,"AutoWhiteBalance"\:true} CameraConfigLeft45={"Brightness"\:0.0,"Contrast"\:0.0,"Saturation"\:0.0,"Hue"\:0.0,"Gain"\:1.0,"Exposure"\:1.0,"Sharpness"\:0.0,"Gamma"\:0.0,"AutoExposure"\:true,"AutoFocus"\:true,"AutoWhiteBalance"\:true} @@ -19,7 +19,10 @@ FTPPass=password FTPPath=/ FTPPort=21 FTPUser=user +FlipCamera=true +MirrorCamera=true PhotoDirectory=C\:\\Users\\Erha\\Desktop\\ErhaCapture +SharpnessThreshold=70.0 cascadeMaxSize=500 cascadeMinNeighbors=3 cascadeMinSize=250 diff --git a/database.db b/database.db index d17139a..927d6e1 100644 Binary files a/database.db and b/database.db differ diff --git a/logs/2024-10-21.log b/logs/2024-10-21.log index 7f1011d..f7706fd 100644 --- a/logs/2024-10-21.log +++ b/logs/2024-10-21.log @@ -47,3 +47,382 @@ 2024-10-21 15:28:21 INFO: GetAll success, result count: 36 2024-10-21 15:28:25 INFO: Not loading empty fxml file 2024-10-21 15:28:25 INFO: Application closed +2025-03-21 14:43:56 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 14:43:56 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 14:43:56 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 14:43:56 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 14:43:56 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 14:43:56 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 14:43:56 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 14:43:56 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\FullQuality, Msg : C:\Users\rdkar +2025-03-21 14:43:56 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\FullQualityCrop, Msg : C:\Users\rdkar +2025-03-21 14:43:56 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\Compressed, Msg : C:\Users\rdkar +2025-03-21 14:43:56 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\CompressedCrop, Msg : C:\Users\rdkar +2025-03-21 14:43:56 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\thumbs, Msg : C:\Users\rdkar +2025-03-21 14:44:00 ERROR: id.co.gtc.erhacam.MainApplication.start() Secure Dongle not found +2025-03-21 14:44:52 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 14:44:52 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 14:44:52 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 14:44:52 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 14:44:52 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 14:44:52 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 14:44:52 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 14:44:52 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\FullQuality, Msg : C:\Users\rdkar +2025-03-21 14:44:52 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\FullQualityCrop, Msg : C:\Users\rdkar +2025-03-21 14:44:52 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\Compressed, Msg : C:\Users\rdkar +2025-03-21 14:44:52 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\CompressedCrop, Msg : C:\Users\rdkar +2025-03-21 14:44:52 INFO: Config.SomeCodes.MakeDirectory() Error creating directory: C:\Users\rdkar\OneDrive\Desktop\Erha Capture\thumbs, Msg : C:\Users\rdkar +2025-03-21 14:44:52 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 14:44:52 INFO: Config.SomeCodes.ExtractResource() Resource File extracted: /countdown321.wav +2025-03-21 14:44:53 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 14:44:53 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 14:44:53 INFO: Config.SomeCodes.ExtractResource() Resource File extracted: /haarcascade_frontalface_alt.xml +2025-03-21 14:44:53 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 14:44:58 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 14:44:58 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 14:45:06 INFO: id.co.gtc.erhacam.SettingView.initialize() Found 1 Cameras +2025-03-21 14:45:06 INFO: id.co.gtc.erhacam.SettingView.lambda$initialize$0() adding camera : OBSBOT Meet 2 StreamCamera to camera list +2025-03-21 14:45:13 INFO: Config.ConfigFile.SetCameraLeft90() Camera Left 90 Degree changed from ACER QHD User Facing to OBSBOT Meet 2 StreamCamera +2025-03-21 14:45:24 INFO: Config.ConfigFile.SetPhotoDirectory() Photo Directory changed from C:\Users\rdkar\OneDrive\Desktop\Erha Capture to C:\Users\Erha\Desktop\ErhaCapture +2025-03-21 14:45:24 INFO: Config.ConfigFile.Save() Config Saved +2025-03-21 14:45:29 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 14:45:29 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 14:45:29 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 14:45:29 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 14:45:32 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 14:45:53 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 14:45:53 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 14:50:19 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 14:50:19 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 14:50:19 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 14:50:19 INFO: Config.SomeCodes.MakeDirectory() Directory created: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 14:50:19 INFO: Config.SomeCodes.MakeDirectory() Directory created: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 14:50:19 INFO: Config.SomeCodes.MakeDirectory() Directory created: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 14:50:19 INFO: Config.SomeCodes.MakeDirectory() Directory created: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 14:50:19 INFO: Config.SomeCodes.MakeDirectory() Directory created: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 14:50:19 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 14:50:19 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 14:50:20 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 14:50:20 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 14:50:20 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 14:50:20 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 14:50:20 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 14:50:25 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:18:02 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:18:02 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:18:02 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:18:02 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:18:02 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:18:02 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:18:02 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:18:02 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:18:02 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:18:02 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:18:02 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:18:02 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:18:02 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:18:03 INFO: Config.SomeCodes.ExtractResource() Resource File extracted: /kesalahan_server.wav +2025-03-21 15:18:03 INFO: Config.SomeCodes.ExtractResource() Resource File extracted: /data_barcode_tidak_ditemukan.wav +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:18:03 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:18:03 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:18:03 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:18:09 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:18:11 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:18:23 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:18:23 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:19:32 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:19:32 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:19:32 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:19:32 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:19:32 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:19:32 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:19:32 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:19:32 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:19:32 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:19:33 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:19:33 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:19:33 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:19:38 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:19:43 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:19:50 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:19:50 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:23:01 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:23:01 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:23:01 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:23:01 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:23:01 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:23:01 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:23:01 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:23:01 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:23:01 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:23:01 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:23:02 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:23:02 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:23:02 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:23:02 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:23:02 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:23:07 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:23:08 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:23:08 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:23:08 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:23:08 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:24:41 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:24:41 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:24:41 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:24:41 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:24:41 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:24:41 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:24:41 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:24:41 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:24:41 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:24:41 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:24:41 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:24:41 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:24:41 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:24:42 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:24:42 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:24:42 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:24:48 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:24:49 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:28:22 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:28:22 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:28:22 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:28:22 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:28:22 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:28:22 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:28:22 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:28:22 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:28:22 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:28:22 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:28:23 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:28:23 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:28:23 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:28:23 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:28:23 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:28:28 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:28:33 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:28:41 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:28:41 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:39:18 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:39:18 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:39:18 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:39:18 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:39:18 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:39:18 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:39:18 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:39:18 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:39:18 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:39:18 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:39:19 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:39:19 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:39:19 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:39:19 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:39:19 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:39:24 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:39:26 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:39:36 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:39:36 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:39:42 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:39:42 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:43:57 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:43:57 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:43:57 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:43:57 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:43:57 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:43:57 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:43:57 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:43:57 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:43:57 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:43:57 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:43:58 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:43:58 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:43:58 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:43:58 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:43:58 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:44:03 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:44:07 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:44:21 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:44:21 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:57:31 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:57:31 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:57:31 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:57:31 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:57:31 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:57:31 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:57:31 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:57:31 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:57:31 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:57:31 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:57:31 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:57:37 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:57:45 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 15:57:59 ERROR: id.co.gtc.erhacam.MainView.loadContent() loadContent Not loading empty fxml file +2025-03-21 15:57:59 INFO: id.co.gtc.erhacam.MainApplication.lambda$start$0() Application closed +2025-03-21 15:58:54 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 15:58:54 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 15:58:54 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 15:58:54 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 15:58:54 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 15:58:54 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 15:58:54 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 15:58:54 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 15:58:54 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 15:58:54 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 15:58:54 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 15:58:54 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 15:58:55 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 15:58:55 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 15:58:55 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 15:59:01 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 15:59:03 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 16:07:12 INFO: Config.ConfigFile.() Current working directory in Java : C:\Users\Erha\IdeaProjects\ErhaCam +2025-03-21 16:07:12 INFO: Config.ConfigFile.Load() Load config file at C:\Users\Erha\IdeaProjects\ErhaCam\config.properties +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() FaceMaxSize created with value : 500 +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.Detectors.setFaceMaxSize() EyeMaxSize created with value : 83 +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() FaceMinSize created with value : 250 +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.Detectors.setFaceMinSize() EyeMinSize created with value : 41 +2025-03-21 16:07:12 INFO: Config.ConfigFile.Load() Config Loaded +2025-03-21 16:07:12 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQuality +2025-03-21 16:07:12 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\FullQualityCrop +2025-03-21 16:07:12 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\Compressed +2025-03-21 16:07:12 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\CompressedCrop +2025-03-21 16:07:12 INFO: Config.SomeCodes.MakeDirectory() Directory exists: C:\Users\Erha\Desktop\ErhaCapture\thumbs +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.MainApplication.start() Secure Dongle UserID valid +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.CaptureView.initialize() Audio Player : Inited +2025-03-21 16:07:12 INFO: Config.SomeCodes.LoadQRReader() QRReader loaded +2025-03-21 16:07:12 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_frontalface_alt.xml +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.Detectors.LoadFrontalFaceDetector() FaceDetector loaded +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() Eye Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_eye.xml +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.Detectors.LoadEyeDetector() EyeDetector loaded +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() Profile Face Detector file : C:\Users\Erha\IdeaProjects\ErhaCam\haarcascade_profileface.xml +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.Detectors.LoadProfileFaceDetector() ProfileFaceDetector loaded +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.MainApplication.start() Application started +2025-03-21 16:07:13 INFO: SecureDongle.SecureDongle.lambda$StartMonitor$0() Start Monitoring UserID=14022025 +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.CaptureView.lambda$initialize$15() Left90 Index: 0 +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : QR Reader loaded +2025-03-21 16:07:13 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Face detector loaded +2025-03-21 16:07:18 INFO: id.co.gtc.erhacam.CaptureView.onLog() [01] : Camera Started with resolution 2160x3840@0 +2025-03-21 16:07:51 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 16:08:12 ERROR: id.co.gtc.erhacam.CaptureView.call() Record associated with barcode +2025-03-21 16:08:33 INFO: id.co.gtc.erhacam.CaptureView.onPlaybackStarted() Audio Positikan Muka Started +2025-03-21 16:08:40 INFO: id.co.gtc.erhacam.CaptureView.onPlaybackFinished() Audio Positikan Muka Finished diff --git a/src/main/java/BASS/AudioPlayer.java b/src/main/java/BASS/AudioPlayer.java index c41dc3a..de6808b 100644 --- a/src/main/java/BASS/AudioPlayer.java +++ b/src/main/java/BASS/AudioPlayer.java @@ -14,9 +14,8 @@ public class AudioPlayer { public void WaitUntilFinished(){ while(currentFileHandle!=0){ try { - Thread.sleep(100); + Thread.sleep(10); } catch (InterruptedException ignored) { - } } } @@ -102,9 +101,8 @@ public class AudioPlayer { * Play Audio File * @param filename File to be played * @param playbackstatus PlaybackStatus callback - * @return true if success, false if failed */ - public boolean PlayFile(final String filename, final PlaybackStatus playbackstatus){ + public void PlayFile(final String filename, final PlaybackStatus playbackstatus){ if (inited && filename!=null && !filename.isEmpty()){ int filehandle = bass.BASS_StreamCreateFile(false, filename, 0, 0, 0); if (filehandle!=0){ @@ -136,11 +134,18 @@ public class AudioPlayer { currentFile = ""; currentFileHandle = 0; }).start(); - return true; - } else Logger.error("AudioPlayer PlayFile failed, BASS_ChannelStart failed, error code: "+bass.BASS_ErrorGetCode()); - } else Logger.error("AudioPlayer PlayFile failed, BASS_StreamCreateFile failed, error code: "+bass.BASS_ErrorGetCode()); - } else Logger.info("AudioPlayer PlayFile failed, AudioPlayer is not initialized"); - return false; + } else { + Logger.error("AudioPlayer PlayFile failed, BASS_ChannelStart failed, error code: "+bass.BASS_ErrorGetCode()); + if (playbackstatus!=null) playbackstatus.onPlaybackFailure(filename); + } + } else { + Logger.error("AudioPlayer PlayFile failed, BASS_StreamCreateFile failed, error code: "+bass.BASS_ErrorGetCode()); + if (playbackstatus!=null) playbackstatus.onPlaybackFailure(filename); + } + } else { + Logger.info("AudioPlayer PlayFile failed, AudioPlayer is not initialized"); + if (playbackstatus!=null) playbackstatus.onPlaybackFailure(filename); + } } } diff --git a/src/main/java/Camera/LiveCamEvent.java b/src/main/java/Camera/LiveCamEvent.java index 4a7df2e..c1b1c83 100644 --- a/src/main/java/Camera/LiveCamEvent.java +++ b/src/main/java/Camera/LiveCamEvent.java @@ -4,11 +4,12 @@ public interface LiveCamEvent { void onDetectedQRCode(String qrCode); void onFrontalFaceDetector(boolean hasface, int width, int height); void onProfileFaceDetector(boolean hasface, int width, int height); - void onEyeDetector(boolean hasEye, int width, int height); + void onEyeDetector(boolean hasEye); void onLeftEarDetector(boolean hasLeftEar, int width, int height); void onRightEarDetector(boolean hasRightEar, int width, int height); void onLeftEyeDetector(boolean hasLeftEye, int width, int height); void onRightEyeDetector(boolean hasRightEye, int width, int height); void onLog(String log); void onBlink(int counter); + void onStartCapturing(); } diff --git a/src/main/java/Config/ConfigFile.java b/src/main/java/Config/ConfigFile.java index 043e30b..490e14a 100644 --- a/src/main/java/Config/ConfigFile.java +++ b/src/main/java/Config/ConfigFile.java @@ -45,6 +45,11 @@ public class ConfigFile { private @Getter int cascadeMinSize; private @Getter int cascadeMaxSize; + private @Getter boolean MirrorCamera = false; + private @Getter boolean FlipCamera = false; + + private @Getter double SharpnessThreshold; + private boolean needsave = false; public ConfigFile(){ @@ -53,6 +58,27 @@ public class ConfigFile { Load(); } + public void setMirrorCamera(boolean value){ + if (MirrorCamera != value){ + MirrorCamera = value; + needsave = true; + } + } + + public void setFlipCamera(boolean value){ + if (FlipCamera != value){ + FlipCamera = value; + needsave = true; + } + } + + public void setSharpnessThreshold(double value){ + if (SharpnessThreshold != value){ + SharpnessThreshold = value; + needsave = true; + } + } + public void setCascadeScaleFactor(double value){ if (cascadeScaleFactor != value){ cascadeScaleFactor = value; @@ -554,6 +580,10 @@ public class ConfigFile { if (prop.getProperty("FTPPass") == null) allcorrect = false; if (prop.getProperty("FTPPath") == null) allcorrect = false; if (prop.getProperty("PhotoDirectory") == null) allcorrect = false; + if (prop.getProperty("MirrorCamera") == null) allcorrect = false; + if (prop.getProperty("FlipCamera") == null) allcorrect = false; + if (prop.getProperty("SharpnessThreshold") == null) allcorrect = false; + if (prop.getProperty(CameraConfigEnum.CameraConfigLeft90.toString()) == null) allcorrect = false; if (prop.getProperty(CameraConfigEnum.CameraConfigLeft45.toString()) == null) allcorrect = false; @@ -601,6 +631,11 @@ public class ConfigFile { Detectors.setFaceMinSize(cascadeMinSize); Detectors.setScaleFactor(cascadeScaleFactor); + MirrorCamera = toBoolean(prop.getProperty("MirrorCamera")); + FlipCamera = toBoolean(prop.getProperty("FlipCamera")); + + SharpnessThreshold = toDouble(prop.getProperty("SharpnessThreshold")); + Logger.info("Config Loaded"); MakeDirectories(); return; @@ -653,6 +688,9 @@ public class ConfigFile { Detectors.setFaceMaxSize(cascadeMaxSize); Detectors.setFaceMinSize(cascadeMinSize); Detectors.setScaleFactor(cascadeScaleFactor); + MirrorCamera = false; + FlipCamera = false; + SharpnessThreshold = 75.0; Logger.info("Default Config Created"); needsave = true; Save(); @@ -709,6 +747,10 @@ public class ConfigFile { prop.setProperty("cascadeMinSize", String.valueOf(cascadeMinSize)); prop.setProperty("cascadeMaxSize", String.valueOf(cascadeMaxSize)); + prop.setProperty("MirrorCamera", String.valueOf(MirrorCamera)); + prop.setProperty("FlipCamera", String.valueOf(FlipCamera)); + prop.setProperty("SharpnessThreshold", String.valueOf(SharpnessThreshold)); + try{ prop.store(new FileOutputStream(Path.of(currentDirectory, "config.properties").toString()), null); Logger.info("Config Saved"); diff --git a/src/main/java/Config/SomeCodes.java b/src/main/java/Config/SomeCodes.java index 3aa6d09..fd44b14 100644 --- a/src/main/java/Config/SomeCodes.java +++ b/src/main/java/Config/SomeCodes.java @@ -15,6 +15,7 @@ import org.bytedeco.opencv.opencv_core.Mat; import org.bytedeco.opencv.opencv_core.Rect; import org.bytedeco.opencv.opencv_core.Size; import org.bytedeco.opencv.opencv_core.UMat; +import org.opencv.core.MatOfDouble; import org.tinylog.Logger; import java.awt.image.BufferedImage; @@ -31,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import static org.bytedeco.opencv.global.opencv_core.CV_64F; +import static org.bytedeco.opencv.global.opencv_core.CV_64FC3; @SuppressWarnings("unused") public class SomeCodes { @@ -229,6 +231,10 @@ public class SomeCodes { } } + public static boolean toBoolean(String x){ + return x!=null && x.equalsIgnoreCase("true"); + } + /** * Check if string is valid IPV4 address * @param ipaddress IPV4 address @@ -620,30 +626,48 @@ public class SomeCodes { if (values!=null && values.length>0){ double lowest = values[0]; for(double x : values){ - if (x=0){ + if (xsetCameraStatus(ss)); - raise_log(ss); - - + if (event!=null) event.onStartCapturing(); Task task = new Task<>() { @SuppressWarnings("BusyWait") @@ -826,7 +832,11 @@ public class Cameradetail { TimerTask fpsTask = new TimerTask() { @Override public void run() { - LiveFPS = fps.getAndSet(0); + int fpsval = fps.getAndSet(0); + if (fpsval!=LiveFPS){ + LiveFPS = fpsval; + if (event!=null) event.onStartCapturing(); + } } }; @@ -884,15 +894,29 @@ public class Cameradetail { fps.incrementAndGet(); UMat originalmat = new UMat(); - mat.copyTo(originalmat); // copy to BestMat for using OpenCL - // revisi 18/03/2025 - UMat flippedmat = new UMat(); - opencv_core.flip(originalmat, flippedmat, 1); // flip horizontal - opencv_core.rotate(flippedmat, BestMat, opencv_core.ROTATE_90_COUNTERCLOCKWISE); + mat.copyTo(originalmat); // copy to originalmat for using OpenCL + if (config.isMirrorCamera()){ + // revisi 18/03/2025 + UMat flippedmat = new UMat(); + opencv_core.flip(originalmat, flippedmat, 0); // flip vertical + flippedmat.copyTo(originalmat); + } + if (config.isFlipCamera()){ + // revisi 18/03/2025 + UMat flippedmat = new UMat(); + opencv_core.flip(originalmat, flippedmat, 1); // flip horizontal + flippedmat.copyTo(originalmat); + } + + // rotate 90 degree counter clockwise karena kamera potrait + opencv_core.rotate(originalmat, originalmat, opencv_core.ROTATE_90_COUNTERCLOCKWISE); + + + IsGrabbingLiveView.set(false); - if (!BestMat.empty()) { - opencv_imgproc.resize(BestMat, LiveMat, LiveSize); // resize to LiveSize + if (!originalmat.empty()) { + opencv_imgproc.resize(originalmat, LiveMat, LiveSize); // resize to LiveSize UMat graymat = new UMat(); // use OpenCL for grayscale opencv_imgproc.cvtColor(LiveMat,graymat, COLOR_BGR2GRAY); // convert to grayscale if (use_qr){ @@ -950,6 +974,14 @@ public class Cameradetail { no_face_counter = 0; if (event!=null) event.onFrontalFaceDetector(true, _face_width, _face_height); + face_indicator.setVisible(true); + + double sharpness = CalculateSharpness(originalmat); + if (sharpness>=config.getSharpnessThreshold()){ + sharpness_value = sharpness; + originalmat.copyTo(BestMat); + Platform.runLater(()->sharpness_indicator.setText(String.format("%.2f", sharpness_value))); + } if (theface.getFace()!=null){ LiveMatROI = new Rect(theface.getFace().x(), theface.getFace().y(), theface.getFace().width(), theface.getFace().height()); @@ -963,12 +995,18 @@ public class Cameradetail { open_eye_counter++; continue; } - System.out.println("Valid Open Eyes"); + //System.out.println("Valid Open Eyes"); - if (eye_state==0){ + if (eye_state!=1){ // transisi dari tutup mata ke buka mata System.out.println("Transition from close to open eyes"); + eye_state = 1; + if (event!=null) event.onEyeDetector(true); + eye_indicator.setVisible(true); + + + long now = System.currentTimeMillis(); if (waiting_for_second_blink){ long diff = now - last_blink; @@ -984,7 +1022,6 @@ public class Cameradetail { } last_blink = now; } - eye_state = 1; } else { // ada muka, tidak ada mata // transisi dari buka mata ke tutup mata @@ -993,15 +1030,26 @@ public class Cameradetail { close_eye_counter++; continue; } - System.out.println("Valid Closed Eyes"); + //System.out.println("Valid Closed Eyes"); if (eye_state!=0){ System.out.println("Transition from open to close eyes"); + eye_state = 0; + if (event!=null) event.onEyeDetector(false); + eye_indicator.setVisible(false); } - eye_state = 0; } } else if (have_left_45_face ){ no_face_counter = 0; if (event!=null) event.onProfileFaceDetector(true, _face_width, _face_height); + face_indicator.setVisible(true); + + double sharpness = CalculateSharpness(originalmat); + if (sharpness>=config.getSharpnessThreshold()){ + sharpness_value = sharpness; + originalmat.copyTo(BestMat); + Platform.runLater(()->sharpness_indicator.setText(String.format("%.2f", sharpness_value))); + } + } else { // no face detected, but let's not cancel the previous state immediately @@ -1021,6 +1069,8 @@ public class Cameradetail { if (event!=null) { event.onFrontalFaceDetector(false, _face_width, _face_height); event.onProfileFaceDetector(false, _face_width, _face_height); + face_indicator.setVisible(false); + eye_indicator.setVisible(false); } } else no_face_counter++; diff --git a/src/main/java/id/co/gtc/erhacam/CaptureView.java b/src/main/java/id/co/gtc/erhacam/CaptureView.java index ca77caa..f742ea8 100644 --- a/src/main/java/id/co/gtc/erhacam/CaptureView.java +++ b/src/main/java/id/co/gtc/erhacam/CaptureView.java @@ -15,8 +15,6 @@ import ErhaAPI.UploadResult; import javafx.application.Platform; -import javafx.beans.InvalidationListener; -import javafx.beans.Observable; import javafx.concurrent.Task; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; @@ -31,7 +29,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; import javafx.scene.control.Alert.AlertType; import org.bytedeco.javacv.OpenCVFrameGrabber; @@ -77,6 +74,7 @@ public class CaptureView { private String audio_upload_berhasil = "upload_berhasil.wav"; private String audio_upload_gagal = "upload_gagal.wav"; private String audio_countdown = "countdown321.wav"; + private String audio_camera_shutter = "camera-shutter-click-01.wav"; private String audio_tahan_posisi = "tahan_posisi.wav"; private String audio_data_barcode_tidak_ditemukan = "data_barcode_tidak_ditemukan.wav"; private String audio_kesalahan_server = "kesalahan_server.wav"; @@ -94,7 +92,6 @@ public class CaptureView { private final ErhaAPI erhaAPI = new ErhaAPI(false); - private final double sharpness_threshold = 150; @FXML private void ChangeDirectory(){ DirectoryChooser dc = new DirectoryChooser(); @@ -131,17 +128,377 @@ public class CaptureView { @SuppressWarnings("resource") @FXML - private void TakePhotos(){ + private void TakePhotos(String directory, String prefix){ boolean has_face = Arrays.stream(have_face).anyMatch(AtomicBoolean::get); + if (has_face){ AutoCloseAlert.show("Pengambilan Foto", "Tahan Posisi Anda", "Proses ini kurang lebih 3 detik", 5, null); if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_countdown)) { + if (!Objects.equals(audioPlayer.getCurrentFile(), audio_tahan_posisi)){ audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_tahan_posisi, ps); - } else System.out.println("audioPlayer already playing countdown"); + audioPlayer.PlayFile(audio_tahan_posisi, new PlaybackStatus() { + @Override + public void onPlaybackStarted(String filename) { + } + + @Override + public void onPlaybackFinished(String filename) { + Size thumbsize = new Size(160,120); + + PhotoReviewClass prc = new PhotoReviewClass(); + prc.setPrefix(prefix); + + long nanostart = System.nanoTime(); // for performance measurement + + ExecutorService executor = Executors.newFixedThreadPool(5); + + audioPlayer.PlayFile(audio_camera_shutter, null); + + Callable task1 = ()->{ + if (image1!=null) { + image1.RemapROI(0.1,0.3, false); + + double sharpness = CalculateSharpness(image1.getLiveMat()); + System.out.println("Image1 sharpness: "+sharpness); + + PhotoResult p1 = image1.TakePhoto(directory,prefix); + p1.setSharpscore(sharpness); + if (ValidFile(p1.getFullres())){ + if (ValidFile(p1.getCompressedfile())){ + return p1; + } + } + } else System.out.println("Image1 is null"); + return null; + }; + Callable task2 = ()->{ + if (image2!=null) { + image2.RemapROI(0.1,0.3, false); + double sharpness = CalculateSharpness(image2.getLiveMat()); + System.out.println("Image2 sharpness: "+sharpness); + + PhotoResult p2 = image2.TakePhoto(directory,prefix); + p2.setSharpscore(sharpness); + if (ValidFile(p2.getFullres())){ + if (ValidFile(p2.getCompressedfile())){ + return p2; + } + } + } else System.out.println("Image2 is null"); + return null; + }; + + Callable task3 = ()->{ + if (image3!=null) { + image3.RemapROI(0.1,0.3, false); + double sharpness = CalculateSharpness(image3.getLiveMat()); + System.out.println("Image3 sharpness: "+sharpness); + + PhotoResult p3 = image3.TakePhoto(directory,prefix); + p3.setSharpscore(sharpness); + + if (ValidFile(p3.getFullres())){ + if (ValidFile(p3.getCompressedfile())){ + return p3; + } + } + + } else System.out.println("Image3 is null"); + return null; + }; + + Callable task4 = ()->{ + if (image4!=null) { + image4.RemapROI(0.1,0.3, false); + double sharpness = CalculateSharpness(image4.getLiveMat()); + System.out.println("Image4 sharpness: "+sharpness); + + PhotoResult p4 = image4.TakePhoto(directory,prefix); + p4.setSharpscore(sharpness); + + if (ValidFile(p4.getFullres())){ + if (ValidFile(p4.getCompressedfile())){ + return p4; + } + } + + } else System.out.println("Image4 is null"); + return null; + }; + + Callable task5 = ()->{ + if (image5!=null) { + image5.RemapROI(0.1,0.3, false); + double sharpness = CalculateSharpness(image5.getLiveMat()); + System.out.println("Image5 sharpness: "+sharpness); + + PhotoResult p5 = image5.TakePhoto(directory,prefix); + p5.setSharpscore(sharpness); + + if (ValidFile(p5.getFullres())){ + if (ValidFile(p5.getCompressedfile())){ + return p5; + } + } + + } else System.out.println("Image5 is null"); + return null; + }; + + PhotoResult p1 = null; + PhotoResult p2 = null; + PhotoResult p3 = null; + PhotoResult p4 = null; + PhotoResult p5 = null; + try{ + Future f1 = executor.submit(task1); + Future f2 = executor.submit(task2); + Future f3 = executor.submit(task3); + Future f4 = executor.submit(task4); + Future f5 = executor.submit(task5); + + p1 = f1.get(); + p2 = f2.get(); + p3 = f3.get(); + p4 = f4.get(); + p5 = f5.get(); + + } catch (Exception e){ + Logger.error("Error TakePhotos: " + e.getMessage()); + } finally { + executor.shutdown(); + } + + + + String timestamp = SomeCodes.GetDateTimeString(); + System.out.println("Creating timestamp: "+timestamp); + + // check for blurred image + double score1=-1, score2=-1, score3=-1, score4=-1, score5=-1; + if (p1!=null){ + score1 = p1.getSharpscore(); + } + if (p2!=null){ + score2 = p2.getSharpscore(); + } + if (p3!=null){ + score3 = p3.getSharpscore(); + } + if (p4!=null){ + score4 = p4.getSharpscore(); + } + if (p5!=null){ + score5 = p5.getSharpscore(); + } + System.out.println("Sharpness score: "+score1+", "+score2+", "+score3+", "+score4+", "+score5); + double lowest = FindLowestValue(score1,score2,score3,score4,score5); + if (lowestbestroi.area()) + bestroi = p2.getBestROI(); + if (reducedroi==null) + reducedroi = p2.getReducedROI(); + else if (p2.getReducedROI().area()>reducedroi.area()) + reducedroi = p2.getReducedROI(); + } + if (p3!=null && p3.getBestROI()!=null){ + if (bestroi==null) + bestroi = p3.getBestROI(); + else if (p3.getBestROI().area()>bestroi.area()) + bestroi = p3.getBestROI(); + if (reducedroi==null) + reducedroi = p3.getReducedROI(); + else if (p3.getReducedROI().area()>reducedroi.area()) + reducedroi = p3.getReducedROI(); + } + if (p4!=null && p4.getBestROI()!=null){ + if (bestroi==null) + bestroi = p4.getBestROI(); + else if (p4.getBestROI().area()>bestroi.area()) + bestroi = p4.getBestROI(); + if (reducedroi==null) + reducedroi = p4.getReducedROI(); + else if (p4.getReducedROI().area()>reducedroi.area()) + reducedroi = p4.getReducedROI(); + } + if (p5!=null && p5.getBestROI()!=null){ + if (bestroi==null) + bestroi = p5.getBestROI(); + else if (p5.getBestROI().area()>bestroi.area()) + bestroi = p5.getBestROI(); + if (reducedroi==null) + reducedroi = p5.getReducedROI(); + else if (p5.getReducedROI().area()>reducedroi.area()) + reducedroi = p5.getReducedROI(); + } + + if (p1!=null){ + prc.setFileLeft90(ValidFile(p1.getFullres()) ? p1.getFullres() : ""); + prc.setCompressedLeft90(ValidFile(p1.getCompressedfile()) ? p1.getCompressedfile() : ""); + if (ValidFile(p1.getFullcrop())){ + // ada crop + prc.setCroppedLeft90(p1.getFullcrop()); + } else { + String xx = image1.CropBestMat(directory,prefix, bestroi); + if (ValidFile(xx)) prc.setCroppedLeft90(xx); + } + if (ValidFile(p1.getCompressedcrop())){ + prc.setCompressedCropLeft90(p1.getCompressedcrop()); + } else { + String xx =image1.CropReducedMat(directory,prefix, reducedroi); + if (ValidFile(xx)) prc.setCompressedCropLeft90(xx); + } + String thumb1 = MakeThumbfile(p1.getFullres(), thumbsize); + if (ValidFile(thumb1)) prc.setThumbLeft90(thumb1); + } + if (p2!=null){ + prc.setFileLeft45(ValidFile(p2.getFullres()) ? p2.getFullres() : ""); + prc.setCompressedLeft45(ValidFile(p2.getCompressedfile()) ? p2.getCompressedfile() : ""); + if (ValidFile(p2.getFullcrop())){ + // ada crop + prc.setCroppedLeft45(p2.getFullcrop()); + } else { + String xx = image2.CropBestMat(directory,prefix, bestroi); + if (ValidFile(xx)) prc.setCroppedLeft45(xx); + } + if (ValidFile(p2.getCompressedcrop())){ + prc.setCompressedCropLeft45(p2.getCompressedcrop()); + } else { + String xx = image2.CropReducedMat(directory,prefix, reducedroi); + if (ValidFile(xx)) prc.setCompressedCropLeft45(xx); + } + String thumb2 = MakeThumbfile(p2.getFullres(), thumbsize); + if (ValidFile(thumb2)) prc.setThumbLeft45(thumb2); + } + if (p3!=null){ + prc.setFileCenter(ValidFile(p3.getFullres()) ? p3.getFullres() : ""); + prc.setCompressedCenter(ValidFile(p3.getCompressedfile()) ? p3.getCompressedfile() : ""); + if (ValidFile(p3.getFullcrop())){ + // ada crop + prc.setCroppedCenter(p3.getFullcrop()); + } else { + String xx = image3.CropBestMat(directory,prefix, bestroi); + if (ValidFile(xx)) prc.setCroppedCenter(xx); + } + if (ValidFile(p3.getCompressedcrop())){ + prc.setCompressedCropCenter(p3.getCompressedcrop()); + } else { + String xx = image3.CropReducedMat(directory,prefix, reducedroi); + if (ValidFile(xx)) prc.setCompressedCropCenter(xx); + } + String thumb3 = MakeThumbfile(p3.getFullres(), thumbsize); + if (ValidFile(thumb3)) prc.setThumbCenter(thumb3); + } + if (p4!=null){ + prc.setFileRight45(ValidFile(p4.getFullres()) ? p4.getFullres() : ""); + prc.setCompressedRight45(ValidFile(p4.getCompressedfile()) ? p4.getCompressedfile() : ""); + if (ValidFile(p4.getFullcrop())){ + // ada crop + prc.setCroppedRight45(p4.getFullcrop()); + } else { + String xx = image4.CropBestMat(directory,prefix, bestroi); + if (ValidFile(xx)) prc.setCroppedRight45(xx); + } + if (ValidFile(p4.getCompressedcrop())){ + prc.setCompressedCropRight45(p4.getCompressedcrop()); + } else { + String xx = image4.CropReducedMat(directory,prefix, reducedroi); + if (ValidFile(xx)) prc.setCompressedCropRight45(xx); + } + String thumb4 = MakeThumbfile(p4.getFullres(), thumbsize); + if (ValidFile(thumb4)) prc.setThumbRight45(thumb4); + } + if (p5!=null){ + prc.setFileRight90(ValidFile(p5.getFullres()) ? p5.getFullres() : ""); + prc.setCompressedRight90(ValidFile(p5.getCompressedfile()) ? p5.getCompressedfile() : ""); + if (ValidFile(p5.getFullcrop())){ + // ada crop + prc.setCroppedRight90(p5.getFullcrop()); + } else { + String xx = image5.CropBestMat(directory,prefix, bestroi); + if (ValidFile(xx)) prc.setCroppedRight90(xx); + } + if (ValidFile(p5.getCompressedcrop())){ + prc.setCompressedCropRight90(p5.getCompressedcrop()); + } else { + String xx= image5.CropReducedMat(directory,prefix, reducedroi); + if (ValidFile(xx)) prc.setCompressedCropRight90(xx); + } + String thumb5 = MakeThumbfile(p5.getFullres(), thumbsize); + if (ValidFile(thumb5)) prc.setThumbRight90(thumb5); + } + + long duration = (System.nanoTime() - nanostart) / 1000000; // in milliseconds + System.out.println("TakePhotos duration: "+duration+" ms"); + + AutoCloseAlert.show("Photos Taken", "Photos Taken", "Photos Taken", 5, null); + + String[] files = prc.compressed(); + if (files.length>0){ + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(),audio_pengambilan_berhasil)){ + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_pengambilan_berhasil, new PlaybackStatus() { + @Override + public void onPlaybackStarted(String filename) { + + } + + @Override + public void onPlaybackFinished(String filename) { + Platform.runLater(AutoCloseAlert::close); + UploadFiles(prc, prefix); + } + + @Override + public void onPlaybackFailure(String filename) { + + } + + }); + } + } + } else { + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(),audio_pengambilan_gagal)){ + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_pengambilan_gagal, null); + } + } + } + } + + @Override + public void onPlaybackFailure(String filename) { + + } + }); + + } } @@ -153,431 +510,93 @@ public class CaptureView { // } - - Size thumbsize = new Size(160,120); - String directory = config.getPhotoDirectory(); - String prefix = RemoveSpaces(medicalRecordID.getText()) ; - if (ValidDirectory(directory)){ - if (ValidMedicalRecordId(prefix)){ - - PhotoReviewClass prc = new PhotoReviewClass(); - prc.setPrefix(prefix); - - long nanostart = System.nanoTime(); // for performance measurement - - ExecutorService executor = Executors.newFixedThreadPool(5); - - Callable task1 = ()->{ - if (image1!=null) { - image1.RemapROI(0.1,0.3, false); - - double sharpness = CalculateSharpness(image1.getBestMat()); - if (sharpness task2 = ()->{ - if (image2!=null) { - image2.RemapROI(0.1,0.3, false); - double sharpness = CalculateSharpness(image2.getBestMat()); - if (sharpness task3 = ()->{ - if (image3!=null) { - image3.RemapROI(0.1,0.3, false); - double sharpness = CalculateSharpness(image3.getBestMat()); - if (sharpness task4 = ()->{ - if (image4!=null) { - image4.RemapROI(0.1,0.3, false); - double sharpness = CalculateSharpness(image4.getBestMat()); - if (sharpness task5 = ()->{ - if (image5!=null) { - image5.RemapROI(0.1,0.3, false); - double sharpness = CalculateSharpness(image5.getBestMat()); - if (sharpness f1 = executor.submit(task1); - Future f2 = executor.submit(task2); - Future f3 = executor.submit(task3); - Future f4 = executor.submit(task4); - Future f5 = executor.submit(task5); - - p1 = f1.get(); - p2 = f2.get(); - p3 = f3.get(); - p4 = f4.get(); - p5 = f5.get(); - - } catch (Exception e){ - Logger.error("Error TakePhotos: " + e.getMessage()); - } finally { - executor.shutdown(); - } - - - - String timestamp = SomeCodes.GetDateTimeString(); - System.out.println("Creating timestamp: "+timestamp); - - // check for blurred image - double score1=0, score2=0, score3=0, score4=0, score5=0; - if (p1!=null){ - score1 = p1.getSharpscore(); - } - if (p2!=null){ - score2 = p2.getSharpscore(); - } - if (p3!=null){ - score3 = p3.getSharpscore(); - } - if (p4!=null){ - score4 = p4.getSharpscore(); - } - if (p5!=null){ - score5 = p5.getSharpscore(); - } - System.out.println("Sharpness score: "+score1+", "+score2+", "+score3+", "+score4+", "+score5); - double lowest = FindLowestValue(score1,score2,score3,score4,score5); - if (lowestbestroi.area()) - bestroi = p2.getBestROI(); - if (reducedroi==null) - reducedroi = p2.getReducedROI(); - else if (p2.getReducedROI().area()>reducedroi.area()) - reducedroi = p2.getReducedROI(); - } - if (p3!=null && p3.getBestROI()!=null){ - if (bestroi==null) - bestroi = p3.getBestROI(); - else if (p3.getBestROI().area()>bestroi.area()) - bestroi = p3.getBestROI(); - if (reducedroi==null) - reducedroi = p3.getReducedROI(); - else if (p3.getReducedROI().area()>reducedroi.area()) - reducedroi = p3.getReducedROI(); - } - if (p4!=null && p4.getBestROI()!=null){ - if (bestroi==null) - bestroi = p4.getBestROI(); - else if (p4.getBestROI().area()>bestroi.area()) - bestroi = p4.getBestROI(); - if (reducedroi==null) - reducedroi = p4.getReducedROI(); - else if (p4.getReducedROI().area()>reducedroi.area()) - reducedroi = p4.getReducedROI(); - } - if (p5!=null && p5.getBestROI()!=null){ - if (bestroi==null) - bestroi = p5.getBestROI(); - else if (p5.getBestROI().area()>bestroi.area()) - bestroi = p5.getBestROI(); - if (reducedroi==null) - reducedroi = p5.getReducedROI(); - else if (p5.getReducedROI().area()>reducedroi.area()) - reducedroi = p5.getReducedROI(); - } - - if (p1!=null){ - prc.setFileLeft90(ValidFile(p1.getFullres()) ? p1.getFullres() : ""); - prc.setCompressedLeft90(ValidFile(p1.getCompressedfile()) ? p1.getCompressedfile() : ""); - if (ValidFile(p1.getFullcrop())){ - // ada crop - prc.setCroppedLeft90(p1.getFullcrop()); - } else { - String xx = image1.CropBestMat(directory,prefix, bestroi); - if (ValidFile(xx)) prc.setCroppedLeft90(xx); - } - if (ValidFile(p1.getCompressedcrop())){ - prc.setCompressedCropLeft90(p1.getCompressedcrop()); - } else { - String xx =image1.CropReducedMat(directory,prefix, reducedroi); - if (ValidFile(xx)) prc.setCompressedCropLeft90(xx); - } - String thumb1 = MakeThumbfile(p1.getFullres(), thumbsize); - if (ValidFile(thumb1)) prc.setThumbLeft90(thumb1); - } - if (p2!=null){ - prc.setFileLeft45(ValidFile(p2.getFullres()) ? p2.getFullres() : ""); - prc.setCompressedLeft45(ValidFile(p2.getCompressedfile()) ? p2.getCompressedfile() : ""); - if (ValidFile(p2.getFullcrop())){ - // ada crop - prc.setCroppedLeft45(p2.getFullcrop()); - } else { - String xx = image2.CropBestMat(directory,prefix, bestroi); - if (ValidFile(xx)) prc.setCroppedLeft45(xx); - } - if (ValidFile(p2.getCompressedcrop())){ - prc.setCompressedCropLeft45(p2.getCompressedcrop()); - } else { - String xx = image2.CropReducedMat(directory,prefix, reducedroi); - if (ValidFile(xx)) prc.setCompressedCropLeft45(xx); - } - String thumb2 = MakeThumbfile(p2.getFullres(), thumbsize); - if (ValidFile(thumb2)) prc.setThumbLeft45(thumb2); - } - if (p3!=null){ - prc.setFileCenter(ValidFile(p3.getFullres()) ? p3.getFullres() : ""); - prc.setCompressedCenter(ValidFile(p3.getCompressedfile()) ? p3.getCompressedfile() : ""); - if (ValidFile(p3.getFullcrop())){ - // ada crop - prc.setCroppedCenter(p3.getFullcrop()); - } else { - String xx = image3.CropBestMat(directory,prefix, bestroi); - if (ValidFile(xx)) prc.setCroppedCenter(xx); - } - if (ValidFile(p3.getCompressedcrop())){ - prc.setCompressedCropCenter(p3.getCompressedcrop()); - } else { - String xx = image3.CropReducedMat(directory,prefix, reducedroi); - if (ValidFile(xx)) prc.setCompressedCropCenter(xx); - } - String thumb3 = MakeThumbfile(p3.getFullres(), thumbsize); - if (ValidFile(thumb3)) prc.setThumbCenter(thumb3); - } - if (p4!=null){ - prc.setFileRight45(ValidFile(p4.getFullres()) ? p4.getFullres() : ""); - prc.setCompressedRight45(ValidFile(p4.getCompressedfile()) ? p4.getCompressedfile() : ""); - if (ValidFile(p4.getFullcrop())){ - // ada crop - prc.setCroppedRight45(p4.getFullcrop()); - } else { - String xx = image4.CropBestMat(directory,prefix, bestroi); - if (ValidFile(xx)) prc.setCroppedRight45(xx); - } - if (ValidFile(p4.getCompressedcrop())){ - prc.setCompressedCropRight45(p4.getCompressedcrop()); - } else { - String xx = image4.CropReducedMat(directory,prefix, reducedroi); - if (ValidFile(xx)) prc.setCompressedCropRight45(xx); - } - String thumb4 = MakeThumbfile(p4.getFullres(), thumbsize); - if (ValidFile(thumb4)) prc.setThumbRight45(thumb4); - } - if (p5!=null){ - prc.setFileRight90(ValidFile(p5.getFullres()) ? p5.getFullres() : ""); - prc.setCompressedRight90(ValidFile(p5.getCompressedfile()) ? p5.getCompressedfile() : ""); - if (ValidFile(p5.getFullcrop())){ - // ada crop - prc.setCroppedRight90(p5.getFullcrop()); - } else { - String xx = image5.CropBestMat(directory,prefix, bestroi); - if (ValidFile(xx)) prc.setCroppedRight90(xx); - } - if (ValidFile(p5.getCompressedcrop())){ - prc.setCompressedCropRight90(p5.getCompressedcrop()); - } else { - String xx= image5.CropReducedMat(directory,prefix, reducedroi); - if (ValidFile(xx)) prc.setCompressedCropRight90(xx); - } - String thumb5 = MakeThumbfile(p5.getFullres(), thumbsize); - if (ValidFile(thumb5)) prc.setThumbRight90(thumb5); - } - - long duration = (System.nanoTime() - nanostart) / 1000000; // in milliseconds - System.out.println("TakePhotos duration: "+duration+" ms"); - - AutoCloseAlert.show("Photos Taken", "Photos Taken", "Photos Taken", 5, null); - - if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_pengambilan_berhasil)) { - audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_pengambilan_berhasil, ps); - } else System.out.println("audioPlayer already playing pengambilan berhasil"); - } - - // file untuk di upload - String[] files = prc.compressed(); - - if (files.length>0){ - InsertSQL(prc); - - Task uploadtask = new Task<>() { - @Override - protected Void call() { - int totalfiles = files.length; - int counter = 0; - for (String ff : files) { - UploadResult ur = erhaAPI.Upload_File(prefix, ff,true); - if (ur != null) { - if (ur.message.startsWith("Record has been created")) { - counter++; - updateMessage("Upload success for " + ff); - } else updateMessage("Upload failed for " + ff+", Message : "+ur.message); - } else updateMessage("Upload failed for " + ff+" because UploadResult is null"); - - } - if (counter == totalfiles) { - super.succeeded(); - } else super.failed(); - return null; - } - }; - - - - uploadtask.messageProperty().addListener((obs, oldval, newval)-> { - System.out.println("UploadTask message: "+newval); - Logger.info(newval); - }); - - - uploadtask.setOnSucceeded(e-> { - System.out.println("UploadTask succeeded"); - if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_upload_berhasil)) { - audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_upload_berhasil, ps); - } else System.out.println("audioPlayer already playing upload berhasil"); - } - AutoCloseAlert.show("Upload Success", "Upload Success", "Upload Success", 5, null); - Platform.runLater(()->{ - barcodeData.setText(""); - medicalRecordID.setText(""); - PatientName.setText(""); - isTakingPhoto.set(false); - }); - }); - - uploadtask.setOnFailed(e-> { - System.out.println("UploadTask failed"); - if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_upload_gagal)) { - audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_upload_gagal, ps); - } else System.out.println("audioPlayer already playing upload gagal"); - - } - AutoCloseAlert.show("Upload Failed", "Upload Failed", "Upload Failed", 5, null); - Platform.runLater(()->{ - barcodeData.setText(""); - medicalRecordID.setText(""); - PatientName.setText(""); - isTakingPhoto.set(false); - }); - }); - - new Thread(uploadtask).start(); - - } else ShowAlert(AlertType.ERROR, "Error", "No Photos Taken", "No Photos Taken, please check camera"); - } else ShowAlert(AlertType.ERROR, "Error", "Invalid Prefix", "Please input valid prefix or scan QR Code"); - } else ShowAlert(AlertType.ERROR,"Error","Invalid Directory","Please select valid directory"); - - } else { AutoCloseAlert.show("Error", "No Face Detected", "No Face Detected", 5, null); if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_posisikan_muka)) { + if (!Objects.equals(audioPlayer.getCurrentFile(),audio_posisikan_muka)) { audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_posisikan_muka, ps); - } else System.out.println("audioPlayer already playing posisikan muka"); + audioPlayer.PlayFile(audio_posisikan_muka, null); + } } } + } + + private void UploadFiles(PhotoReviewClass prc, String prefix){ + String[] files = prc.compressed(); + if (files.length>0){ + InsertSQL(prc); + + Task uploadtask = new Task<>() { + @Override + protected Void call() { + int totalfiles = files.length; + int counter = 0; + for (String ff : files) { + UploadResult ur = erhaAPI.Upload_File(prefix, ff,true); + if (ur != null) { + if (ur.message.startsWith("Record has been created")) { + counter++; + updateMessage("Upload success for " + ff); + } else updateMessage("Upload failed for " + ff+", Message : "+ur.message); + } else updateMessage("Upload failed for " + ff+" because UploadResult is null"); + + } + if (counter == totalfiles) { + super.succeeded(); + } else super.failed(); + return null; + } + }; + + uploadtask.messageProperty().addListener((obs, oldval, newval)-> { + System.out.println("UploadTask message: "+newval); + Logger.info(newval); + }); + + + uploadtask.setOnSucceeded(e-> { + System.out.println("UploadTask succeeded"); + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(), audio_upload_berhasil)){ + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_upload_berhasil, null); + } + } + AutoCloseAlert.show("Upload Success", "Upload Success", "Upload Success", 5, s -> { + isTakingPhoto.set(false); + Platform.runLater(()->{ + barcodeData.setText(""); + medicalRecordID.setText(""); + PatientName.setText(""); + }); + }); + + }); + + uploadtask.setOnFailed(e-> { + System.out.println("UploadTask failed"); + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(), audio_upload_gagal)){ + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_upload_gagal, null); + } + } + AutoCloseAlert.show("Upload Failed", "Upload Failed", "Upload Failed", 5, s -> { + isTakingPhoto.set(false); + Platform.runLater(()->{ + barcodeData.setText(""); + medicalRecordID.setText(""); + PatientName.setText(""); + }); + }); + }); + + new Thread(uploadtask).start(); + + } else ShowAlert(AlertType.ERROR, "Error", "No Photos Taken", "No Photos Taken, please check camera"); } @FXML @@ -589,24 +608,22 @@ public class CaptureView { audio_upload_berhasil = ExtractResource("/upload_berhasil.wav"); audio_upload_gagal = ExtractResource("/upload_gagal.wav"); audio_countdown = ExtractResource("/countdown321.wav"); + audio_camera_shutter = ExtractResource("/camera-shutter-click-01.wav"); audio_tahan_posisi = ExtractResource("/tahan_posisi.wav"); audio_kesalahan_server = ExtractResource("/kesalahan_server.wav"); audio_data_barcode_tidak_ditemukan = ExtractResource("/data_barcode_tidak_ditemukan.wav"); //tambahan 19/03/2025 - barcodeData.textProperty().addListener(new InvalidationListener() { - @Override - public void invalidated(Observable observable) { - String barcode = barcodeData.getText(); - System.out.println("barcodeData invalidated, value: "+barcode); - if (ValidBarCode(barcode)){ - if (AutoCloseAlert.shownTitle.equals("Scan Barcode")){ - AutoCloseAlert.close(); - } - } else { - AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null); + barcodeData.textProperty().addListener(observable -> { + String barcode = barcodeData.getText(); + //System.out.println("barcodeData invalidated, value: "+barcode); + if (ValidBarCode(barcode)){ + if (AutoCloseAlert.shownTitle.equals("Scan Barcode")){ + AutoCloseAlert.close(); } + } else { + AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null); } }); barcodeData.setText(""); @@ -727,59 +744,59 @@ public class CaptureView { config.Save(); } - final PlaybackStatus ps = new PlaybackStatus(){ - - @Override - public void onPlaybackStarted(String filename) { - if (filename.contains(audio_posisikan_muka)){ - Logger.info("Audio Positikan Muka Started"); - } else if (filename.contains(audio_pengambilan_berhasil)){ - Logger.info("Audio Pengambilan Berhasil Started"); - } else if (filename.contains(audio_pengambilan_gagal)){ - Logger.info("Audio Pengambilan Gagal Started"); - } else if (filename.contains(audio_scan_barcode)){ - Logger.info("Audio Scan Barcode Started"); - } else if (filename.contains(audio_upload_berhasil)){ - Logger.info("Audio Upload Berhasil Started"); - } else if (filename.contains(audio_upload_gagal)){ - Logger.info("Audio Upload Gagal Started"); - } - } - - @Override - public void onPlaybackFinished(String filename) { - if (filename.contains(audio_posisikan_muka)){ - Logger.info("Audio Positikan Muka Finished"); - } else if (filename.contains(audio_scan_barcode)){ - Logger.info("Audio Scan Barcode Finished"); - } else if (filename.contains(audio_upload_berhasil)){ - Logger.info("Audio Upload Berhasil Finished"); - } else if (filename.contains(audio_upload_gagal)){ - Logger.info("Audio Upload Gagal Finished"); - } else if (filename.contains(audio_pengambilan_berhasil)){ - Logger.info("Audio Pengambilan Berhasil Finished"); - } else if (filename.contains(audio_pengambilan_gagal)){ - Logger.info("Audio Pengambilan Gagal Finished"); - } - } - - @Override - public void onPlaybackFailure(String filename) { - if (filename.contains(audio_posisikan_muka)){ - Logger.info("Audio Positikan Muka Failure"); - } else if (filename.contains(audio_upload_gagal)){ - Logger.info("Audio Upload Gagal Failure"); - } else if (filename.contains(audio_upload_berhasil)){ - Logger.info("Audio Upload Berhasil Failure"); - } else if (filename.contains(audio_pengambilan_berhasil)){ - Logger.info("Audio Pengambilan Berhasil Failure"); - } else if (filename.contains(audio_pengambilan_gagal)){ - Logger.info("Audio Pengambilan Gagal Failure"); - } else if (filename.contains(audio_scan_barcode)){ - Logger.info("Audio Scan Barcode Failure"); - } - } - }; +// final PlaybackStatus ps = new PlaybackStatus(){ +// +// @Override +// public void onPlaybackStarted(String filename) { +// if (filename.contains(audio_posisikan_muka)){ +// Logger.info("Audio Positikan Muka Started"); +// } else if (filename.contains(audio_pengambilan_berhasil)){ +// Logger.info("Audio Pengambilan Berhasil Started"); +// } else if (filename.contains(audio_pengambilan_gagal)){ +// Logger.info("Audio Pengambilan Gagal Started"); +// } else if (filename.contains(audio_scan_barcode)){ +// Logger.info("Audio Scan Barcode Started"); +// } else if (filename.contains(audio_upload_berhasil)){ +// Logger.info("Audio Upload Berhasil Started"); +// } else if (filename.contains(audio_upload_gagal)){ +// Logger.info("Audio Upload Gagal Started"); +// } +// } +// +// @Override +// public void onPlaybackFinished(String filename) { +// if (filename.contains(audio_posisikan_muka)){ +// Logger.info("Audio Positikan Muka Finished"); +// } else if (filename.contains(audio_scan_barcode)){ +// Logger.info("Audio Scan Barcode Finished"); +// } else if (filename.contains(audio_upload_berhasil)){ +// Logger.info("Audio Upload Berhasil Finished"); +// } else if (filename.contains(audio_upload_gagal)){ +// Logger.info("Audio Upload Gagal Finished"); +// } else if (filename.contains(audio_pengambilan_berhasil)){ +// Logger.info("Audio Pengambilan Berhasil Finished"); +// } else if (filename.contains(audio_pengambilan_gagal)){ +// Logger.info("Audio Pengambilan Gagal Finished"); +// } +// } +// +// @Override +// public void onPlaybackFailure(String filename) { +// if (filename.contains(audio_posisikan_muka)){ +// Logger.info("Audio Positikan Muka Failure"); +// } else if (filename.contains(audio_upload_gagal)){ +// Logger.info("Audio Upload Gagal Failure"); +// } else if (filename.contains(audio_upload_berhasil)){ +// Logger.info("Audio Upload Berhasil Failure"); +// } else if (filename.contains(audio_pengambilan_berhasil)){ +// Logger.info("Audio Pengambilan Berhasil Failure"); +// } else if (filename.contains(audio_pengambilan_gagal)){ +// Logger.info("Audio Pengambilan Gagal Failure"); +// } else if (filename.contains(audio_scan_barcode)){ +// Logger.info("Audio Scan Barcode Failure"); +// } +// } +// }; private void SetupCameraWithController(Cameradetail image, String cameraname, int devicenumber){ if (image!=null){ @@ -947,32 +964,35 @@ public class CaptureView { }); if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_posisikan_muka)) { + if (!Objects.equals(audioPlayer.getCurrentFile(),audio_posisikan_muka)) { audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_posisikan_muka, ps); - } else System.out.println("audioPlayer already playing posisikan muka"); + audioPlayer.PlayFile(audio_posisikan_muka, null); + } } } }); checkpatientID.setOnFailed(event -> { - audioPlayer.PlayFile(audio_data_barcode_tidak_ditemukan,ps); + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(), audio_data_barcode_tidak_ditemukan)) { + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_data_barcode_tidak_ditemukan,null); + } + } Task failed = (Task) event.getSource(); Throwable t = failed.getException(); final String message = t.getMessage(); System.out.println("checkpatientID.setOnFailed message : "+message); - AutoCloseAlert.show("Data Tidak Ditemukan", message, "Pastikan data barcode anda benar", 5, new Consumer() { - @Override - public void accept(String s) { - Platform.runLater(()->{ - medicalRecordID.setText(""); - PatientName.setText(""); - barcodeData.setText(""); - isTakingPhoto.set(false); - }); - } + + + AutoCloseAlert.show("Data Tidak Ditemukan", message, "Pastikan data barcode anda benar", 5, s -> { + isTakingPhoto.set(false); + Platform.runLater(()->{ + medicalRecordID.setText(""); + PatientName.setText(""); + barcodeData.setText(""); + }); }); }); @@ -990,7 +1010,10 @@ public class CaptureView { public void onFrontalFaceDetector(boolean hasface, int width, int height) { if (hasface!= _have_face.get()){ _have_face.set(hasface); - update_status(image); + if (!hasface) { + _have_eye.set(false); + } + //update_status(image); } @@ -1000,15 +1023,18 @@ public class CaptureView { public void onProfileFaceDetector(boolean hasface, int width, int height) { if (hasface!= _have_profile.get()){ _have_profile.set(hasface); - update_status(image); + if (!hasface) { + _have_eye.set(false); + } + //update_status(image); } } @Override - public void onEyeDetector(boolean hasEye, int width, int height) { -// _have_eye.set(hasEye); -// update_status(image); + public void onEyeDetector(boolean hasEye) { + if (_have_face.get() || _have_profile.get()) _have_eye.set(hasEye); + //update_status(image); } @Override @@ -1043,28 +1069,36 @@ public class CaptureView { @Override public void onBlink(int counter) { - if (isTakingPhoto.get()) return; // other camera is taking picture System.out.println("Blink detected at camera "+title+" delay= "+counter); - isTakingPhoto.set(true); - String prefix = medicalRecordID.getText(); - if (!prefix.isEmpty()){ - System.out.println("Prefix valid, taking photo"); - TakePhotos(); - } else { - System.out.println("Prefix invalid, not taking photo"); - isTakingPhoto.set(false); - AutoCloseAlert.show("QR Code Not Available", "", "Please scan QR before continue", 5, null); - if (audioPlayer!=null && audioPlayer.isInited()){ - if (!audioPlayer.getCurrentFile().equals(audio_scan_barcode)) { - audioPlayer.StopCurrentPlayback(); - Wait(200); - audioPlayer.PlayFile(audio_scan_barcode, ps); - } else System.out.println("audioPlayer already playing scan barcode"); + if (isTakingPhoto.get()) return; // other camera is taking picture + String directory = config.getPhotoDirectory(); + String prefix = RemoveSpaces(medicalRecordID.getText()) ; + if (ValidDirectory(directory)){ + if (ValidMedicalRecordId(prefix)){ + isTakingPhoto.set(true); + TakePhotos(directory,prefix); + } else { + System.out.println("Prefix invalid, not taking photo"); + isTakingPhoto.set(false); + AutoCloseAlert.show("QR Code Not Available", "", "Please scan QR before continue", 5, s -> AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null)); + if (audioPlayer!=null && audioPlayer.isInited()){ + if (!Objects.equals(audioPlayer.getCurrentFile(), audio_scan_barcode)) { + audioPlayer.StopCurrentPlayback(); + audioPlayer.PlayFile(audio_scan_barcode, null); + } + } } - + } else { + System.out.println("Photo Directory invalid, not taking photo"); + isTakingPhoto.set(false); + AutoCloseAlert.show("Invalid Photo Directory","Photo Directory not set", "Please set photo directory at Setting", 5, s -> AutoCloseAlert.show("Setting", "Setting", "Please set photo directory", 0, null)); } + } + @Override + public void onStartCapturing() { + update_status(image); } private void update_status(Cameradetail image){ @@ -1076,15 +1110,13 @@ public class CaptureView { sb.append(image.getBestHeight()); sb.append("@"); sb.append(image.getLiveFPS()); - if (_have_face.get()) sb.append(", Face"); - if (_have_profile.get()) sb.append(", Profile"); - if (_have_eye.get()) sb.append(", Eye"); - if (_have_left_eye.get()) sb.append(", Left Eye"); - if (_have_right_eye.get()) sb.append(", Right Eye"); - if (_have_left_ear.get()) sb.append(", Left Ear"); - if (_have_right_ear.get()) sb.append(", Right Ear"); - - + //if (_have_face.get()) sb.append(", Face"); + //if (_have_profile.get()) sb.append(", Face"); + //if (_have_eye.get()) sb.append(", Eye"); +// if (_have_left_eye.get()) sb.append(", Left Eye"); +// if (_have_right_eye.get()) sb.append(", Right Eye"); +// if (_have_left_ear.get()) sb.append(", Left Ear"); +// if (_have_right_ear.get()) sb.append(", Right Ear"); image.setCameraStatus(sb.toString()); }); } diff --git a/src/main/java/id/co/gtc/erhacam/SettingView.java b/src/main/java/id/co/gtc/erhacam/SettingView.java index 2ba0419..3558392 100644 --- a/src/main/java/id/co/gtc/erhacam/SettingView.java +++ b/src/main/java/id/co/gtc/erhacam/SettingView.java @@ -2,8 +2,11 @@ package id.co.gtc.erhacam; import FTP.FTPCheck; import javafx.application.Platform; +import javafx.beans.value.ChangeListener; +import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.scene.control.Alert; +import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.control.TextField; import javafx.stage.DirectoryChooser; @@ -13,6 +16,7 @@ import org.bytedeco.javacv.VideoInputFrameGrabber; import org.tinylog.Logger; import java.io.File; +import java.util.Objects; import static Config.SomeCodes.*; @@ -39,9 +43,18 @@ public class SettingView { @FXML private TextField FTPPath; + @FXML + private TextField Sharpness; + @FXML private TextField PhotoDirectoryPath; + @FXML + private CheckBox MirrorCamera; + + @FXML + private CheckBox FlipCamera; + final FileChooser jfc = new FileChooser(); @@ -68,8 +81,20 @@ public class SettingView { PhotoDirectoryPath.setText(path); } + @FXML + private void SharpnessApply(){ + String str = Sharpness.getText(); + if (ValidDouble(str)){ + config.setSharpnessThreshold(Double.parseDouble(str)); + config.Save(); + } else { + ShowAlert(Alert.AlertType.ERROR, "Sharpness Setting Error", "Sharpness Setting Error", "Sharpness Setting must be a number"); + } + } + @FXML private void CascadeSettingApply(){ + String minsize = cascadeMinSize.getText(); String scalefactor = cascadeScaleFactor.getText(); String maxsize = cascadeMaxSize.getText(); @@ -104,6 +129,7 @@ public class SettingView { } else show_cascade_alert("Max Size must not empty"); } else show_cascade_alert("Min Size must not empty"); + } private void show_cascade_alert(String content){ @@ -123,7 +149,17 @@ public class SettingView { Logger.error("Unable to detect Cameras, Msg : "+e.getMessage()); } + MirrorCamera.selectedProperty().addListener(((observable, oldValue, newValue) -> { + System.out.println("Mirror option changed to : "+newValue); + config.setMirrorCamera(newValue); + config.Save(); + })); + FlipCamera.selectedProperty().addListener((observable, oldValue, newValue) -> { + System.out.println("Flip option changed to : "+newValue); + config.setFlipCamera(newValue); + config.Save(); + }); Platform.runLater(()->{ @@ -166,6 +202,12 @@ public class SettingView { cascadeScaleFactor.setText(String.valueOf(config.getCascadeScaleFactor())); cascadeMinSize.setText(String.valueOf(config.getCascadeMinSize())); cascadeMaxSize.setText(String.valueOf(config.getCascadeMaxSize())); + + MirrorCamera.setSelected(config.isMirrorCamera()); + FlipCamera.setSelected(config.isFlipCamera()); + + Sharpness.setText(String.valueOf(config.getSharpnessThreshold())); + }); } diff --git a/src/main/resources/id/co/gtc/erhacam/cameradetail.fxml b/src/main/resources/id/co/gtc/erhacam/cameradetail.fxml index 668a42b..040a8a7 100644 --- a/src/main/resources/id/co/gtc/erhacam/cameradetail.fxml +++ b/src/main/resources/id/co/gtc/erhacam/cameradetail.fxml @@ -5,7 +5,7 @@ - + @@ -22,6 +22,9 @@ + + + @@ -37,6 +40,23 @@ + + + + + + + + + + + + @@ -68,9 +88,9 @@ - + - +