commit 27/2025

Tambah Crop Setting
This commit is contained in:
2025-05-27 14:47:52 +07:00
parent 957d642f5d
commit 0728ae3ca2
4 changed files with 11 additions and 14 deletions

View File

@@ -1063,7 +1063,7 @@ public class Cameradetail {
// 30 fps means 33 ms per frame // 30 fps means 33 ms per frame
// so if grab is quicker than 30 ms , its stale frame // so if grab is quicker than 30 ms , its stale frame
try{ try{
if (mGrabber==null) throw new FrameGrabber.Exception("Grabber is null"); if (mGrabber==null) throw new Exception("Grabber is null");
Frame frame = mGrabber.grab(); // grab frame Frame frame = mGrabber.grab(); // grab frame
delta = System.currentTimeMillis() - now; delta = System.currentTimeMillis() - now;
now = System.currentTimeMillis(); now = System.currentTimeMillis();
@@ -1093,7 +1093,8 @@ public class Cameradetail {
if (Capturing.get()) { if (Capturing.get()) {
try{ try{
if (mGrabber==null) continue; if (mGrabber==null) throw new Exception("Grabber is null");
frame = mGrabber.grab(); frame = mGrabber.grab();
} catch (Exception e){ } catch (Exception e){
if (Capturing.get()){ if (Capturing.get()){

View File

@@ -815,8 +815,8 @@ public class CaptureView {
photoheight = ObsbotMeet2.ModeBest.getHeight(); photoheight = ObsbotMeet2.ModeBest.getHeight();
livewidth = ObsbotMeet2.ModeLive.getWidth(); livewidth = ObsbotMeet2.ModeLive.getWidth();
liveheight = ObsbotMeet2.ModeLive.getHeight(); liveheight = ObsbotMeet2.ModeLive.getHeight();
reducewidth = ObsbotMeet2.Mode3.getWidth(); reducewidth = ObsbotMeet2.Mode2.getWidth();
reduceheight = ObsbotMeet2.Mode3.getHeight(); reduceheight = ObsbotMeet2.Mode2.getHeight();
} }
image.SetGrabber(devicenumber,grabber, livewidth,liveheight,photowidth,photoheight,reducewidth,reduceheight, true); image.SetGrabber(devicenumber,grabber, livewidth,liveheight,photowidth,photoheight,reducewidth,reduceheight, true);
@@ -979,6 +979,7 @@ public class CaptureView {
checkpatientID.setOnFailed(event -> { checkpatientID.setOnFailed(event -> {
PlayFileWithoutEvent(audio_data_barcode_tidak_ditemukan); PlayFileWithoutEvent(audio_data_barcode_tidak_ditemukan);
clear();
Task<?> failed = (Task<?>) event.getSource(); Task<?> failed = (Task<?>) event.getSource();
Throwable t = failed.getException(); Throwable t = failed.getException();
final String message = t.getMessage(); final String message = t.getMessage();

View File

@@ -193,12 +193,12 @@ public class Detectors {
if (detector!=null && !detector.empty()){ if (detector!=null && !detector.empty()){
if (graymat!=null && graymat.channels()==1 && !graymat.empty()){ if (graymat!=null && graymat.channels()==1 && !graymat.empty()){
if (minSize!=null && maxSize!=null){ if (minSize!=null && maxSize!=null){
if (minSize.width()<= maxSize.width() && minSize.height() <= maxSize.height()){ if (minSize.width()< maxSize.width() && minSize.height() < maxSize.height()){
if (graymat.cols()> minSize.width() && graymat.rows() > minSize.height()) { if (graymat.cols()> minSize.width() && graymat.rows() > minSize.height()) {
try { try {
RectVector detected = new RectVector(); RectVector detected = new RectVector();
// try defaulting minSize and maxSize // try defaulting minSize and maxSize
detector.detectMultiScale(graymat, detected, scaleFactor, minNeighbors, flags, minSize, maxSize); detector.detectMultiScale(graymat, detected, scaleFactor, minNeighbors, flags, minSize, new Size());
return detected; return detected;
} catch (Exception e) { } catch (Exception e) {

View File

@@ -22,6 +22,7 @@ import static Config.SomeCodes.config;
public class MainApplication extends Application { public class MainApplication extends Application {
final String version = "27052025-012";
PhotoCleaner photoCleaner; PhotoCleaner photoCleaner;
@Override @Override
public void start(Stage stage) throws IOException { public void start(Stage stage) throws IOException {
@@ -49,7 +50,7 @@ public class MainApplication extends Application {
Screen screen = Screen.getPrimary(); Screen screen = Screen.getPrimary();
Rectangle2D screenbound = screen.getBounds(); Rectangle2D screenbound = screen.getBounds();
Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight()); Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight());
stage.setTitle("MultiCam Capture App for ERHA 27052025-006"); stage.setTitle("MultiCam Capture App for ERHA "+version);
stage.setScene(scene); stage.setScene(scene);
stage.setResizable(true); stage.setResizable(true);
stage.setMaximized(true); stage.setMaximized(true);
@@ -68,6 +69,7 @@ public class MainApplication extends Application {
AutoCloseAlert.init(); AutoCloseAlert.init();
Logger.info("Application started"); Logger.info("Application started");
System.out.println("Application version : " + version+" started");
sd.setEvent(new SecureDongleEvent() { sd.setEvent(new SecureDongleEvent() {
@Override @Override
public void onDongleMissing() { public void onDongleMissing() {
@@ -108,13 +110,6 @@ public class MainApplication extends Application {
} }
@Override
public void stop() throws Exception {
Logger.info("Application stopped");
super.stop();
}
public static void main(String[] args) { public static void main(String[] args) {
SomeCodes.ExtractResource("/tinylog.properties"); SomeCodes.ExtractResource("/tinylog.properties");
launch(); launch();