This commit is contained in:
@@ -91,13 +91,13 @@ public class CameraApp extends JFrame {
|
|||||||
controlsPanel.add(new JLabel("Camera:"), gbc);
|
controlsPanel.add(new JLabel("Camera:"), gbc);
|
||||||
gbc.gridx = 1;
|
gbc.gridx = 1;
|
||||||
cameraSelect = new JComboBox<>();
|
cameraSelect = new JComboBox<>();
|
||||||
cameraSelect.addActionListener(_ -> changeCamera());
|
cameraSelect.addActionListener(e -> changeCamera()); // Fix for Issue 1
|
||||||
controlsPanel.add(cameraSelect, gbc);
|
controlsPanel.add(cameraSelect, gbc);
|
||||||
|
|
||||||
// Detection checkbox
|
// Detection checkbox
|
||||||
gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 2;
|
gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 2;
|
||||||
detectionCheckbox = new JCheckBox("Enable Object Detection", true);
|
detectionCheckbox = new JCheckBox("Enable Object Detection", true);
|
||||||
detectionCheckbox.addActionListener(_ -> toggleDetection());
|
detectionCheckbox.addActionListener(e -> toggleDetection()); // Fix for Issue 1
|
||||||
controlsPanel.add(detectionCheckbox, gbc);
|
controlsPanel.add(detectionCheckbox, gbc);
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
@@ -695,7 +695,7 @@ class DetectionThread extends SwingWorker<Mat, Void> {
|
|||||||
int offset = i * out.cols();
|
int offset = i * out.cols();
|
||||||
float confidence = data[offset + 4];
|
float confidence = data[offset + 4];
|
||||||
|
|
||||||
if (confidence > 0.5) {
|
if (confidence > 0.2) {
|
||||||
// Find class with maximum score
|
// Find class with maximum score
|
||||||
int classId = 0;
|
int classId = 0;
|
||||||
float maxScore = 0;
|
float maxScore = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user