react-native-rectangle-doc-scanner 0.30.0 → 0.31.0

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.
@@ -183,8 +183,8 @@ const DocScanner = ({ onCapture, overlayColor = '#e7a649', autoCapture = true, m
183
183
  step = `contour_${i}_area_abs`;
184
184
  reportStage(step);
185
185
  const { value: area } = react_native_fast_opencv_1.OpenCV.invoke('contourArea', contour, false);
186
- // Skip extremely small contours below an absolute pixel threshold
187
- if (area < 500) {
186
+ // Skip extremely small contours, but keep threshold very low to allow distant documents
187
+ if (area < 200) {
188
188
  continue;
189
189
  }
190
190
  step = `contour_${i}_area`; // ratio stage
@@ -193,9 +193,7 @@ const DocScanner = ({ onCapture, overlayColor = '#e7a649', autoCapture = true, m
193
193
  if (__DEV__) {
194
194
  console.log('[DocScanner] area', area, 'ratio', areaRatio);
195
195
  }
196
- // Filter by area: document should be at least 0.01% and at most 99% of frame
197
- // This prevents detecting tiny noise or the entire frame
198
- if (areaRatio < 0.0001 || areaRatio > 0.99) {
196
+ if (areaRatio < 0.00002 || areaRatio > 0.99) {
199
197
  continue;
200
198
  }
201
199
  step = `contour_${i}_arcLength`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {
@@ -207,8 +207,8 @@ export const DocScanner: React.FC<Props> = ({
207
207
  reportStage(step);
208
208
  const { value: area } = OpenCV.invoke('contourArea', contour, false);
209
209
 
210
- // Skip extremely small contours below an absolute pixel threshold
211
- if (area < 500) {
210
+ // Skip extremely small contours, but keep threshold very low to allow distant documents
211
+ if (area < 200) {
212
212
  continue;
213
213
  }
214
214
 
@@ -220,9 +220,7 @@ export const DocScanner: React.FC<Props> = ({
220
220
  console.log('[DocScanner] area', area, 'ratio', areaRatio);
221
221
  }
222
222
 
223
- // Filter by area: document should be at least 0.01% and at most 99% of frame
224
- // This prevents detecting tiny noise or the entire frame
225
- if (areaRatio < 0.0001 || areaRatio > 0.99) {
223
+ if (areaRatio < 0.00002 || areaRatio > 0.99) {
226
224
  continue;
227
225
  }
228
226