capacitor-plugin-camera-forked 3.1.123 → 3.1.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,9 +68,9 @@ public class BlurDetectionHelper {
68
68
  private static final double AT_LEAST_N_PERCENT_OF_AVERAGE_CONFIDENCE = 0.85; // 85% of average confidence
69
69
 
70
70
  // Method based confidence threshold
71
- private static final double MIN_SHARP_CONFIDENCE_FOR_OBJECT_DETECTION = 0.75; // 75% confidence threshold
72
- private static final double MIN_SHARP_CONFIDENCE_FOR_TEXT_DETECTION = 0.15; // 15% confidence threshold
73
- private static final double MIN_SHARP_CONFIDENCE_FOR_FULL_IMAGE = 0.75; // 70% confidence threshold
71
+ private static final double MIN_SHARP_CONFIDENCE_FOR_OBJECT_DETECTION = 0.45; // 45% confidence threshold
72
+ private static final double MIN_SHARP_CONFIDENCE_FOR_TEXT_DETECTION = 0.09; // 9% confidence threshold
73
+ private static final double MIN_SHARP_CONFIDENCE_FOR_FULL_IMAGE = 0.65; // 65% confidence threshold
74
74
 
75
75
  // TFLite components
76
76
  private Interpreter tflite;
@@ -802,6 +802,13 @@ public class BlurDetectionHelper {
802
802
 
803
803
  Log.d(TAG, "Combined " + boundingBoxes.size() + " text areas into single bounding box: " +
804
804
  "(" + minLeft + ", " + minTop + ", " + maxRight + ", " + maxBottom + ")");
805
+
806
+ // Minimum width and height
807
+ int minWidth = 100;
808
+ int minHeight = 40;
809
+ if (combinedRect.width() < minWidth || combinedRect.height() < minHeight) {
810
+ return new ArrayList<>();
811
+ }
805
812
 
806
813
  List<Rect> result = new ArrayList<>();
807
814
  result.add(combinedRect);
@@ -27,9 +27,9 @@ class BlurDetectionHelper {
27
27
  private static let AT_LEAST_N_PERCENT_OF_AVERAGE_CONFIDENCE: Double = 0.85 // 85% of average confidence
28
28
 
29
29
  // Method based confidence threshold
30
- private static let MIN_SHARP_CONFIDENCE_FOR_OBJECT_DETECTION: Double = 0.75 // 75% confidence threshold
31
- private static let MIN_SHARP_CONFIDENCE_FOR_TEXT_DETECTION: Double = 0.15 // 15% confidence threshold
32
- private static let MIN_SHARP_CONFIDENCE_FOR_FULL_IMAGE: Double = 0.75 // 75% confidence threshold
30
+ private static let MIN_SHARP_CONFIDENCE_FOR_OBJECT_DETECTION: Double = 0.45 // 45% confidence threshold
31
+ private static let MIN_SHARP_CONFIDENCE_FOR_TEXT_DETECTION: Double = 0.09 // 9% confidence threshold
32
+ private static let MIN_SHARP_CONFIDENCE_FOR_FULL_IMAGE: Double = 0.65 // 65% confidence threshold
33
33
 
34
34
  private var interpreter: Interpreter?
35
35
  private var isInitialized = false
@@ -728,6 +728,13 @@ class BlurDetectionHelper {
728
728
  }
729
729
 
730
730
  let combinedRect = CGRect(x: minX, y: minY, width: maxX - minX, height: maxY - minY)
731
+
732
+ // Minimum width and height
733
+ let minWidth = 100.0
734
+ let minHeight = 40.0
735
+ if combinedRect.width < minWidth || combinedRect.height < minHeight {
736
+ return []
737
+ }
731
738
 
732
739
  print("\(Self.TAG): Combined \(rects.count) text areas into single bounding box: " +
733
740
  "(\(minX), \(minY), \(maxX), \(maxY))")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-camera-forked",
3
- "version": "3.1.123",
3
+ "version": "3.1.125",
4
4
  "description": "A capacitor camera plugin - A custom Capacitor camera plugin with additional features.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",