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.
- package/dist/DocScanner.js +3 -5
- package/package.json +1 -1
- package/src/DocScanner.tsx +3 -5
package/dist/DocScanner.js
CHANGED
|
@@ -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
|
|
187
|
-
if (area <
|
|
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
|
-
|
|
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
package/src/DocScanner.tsx
CHANGED
|
@@ -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
|
|
211
|
-
if (area <
|
|
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
|
-
|
|
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
|
|