rn-opencv-doc-perspective-correction 1.0.1 → 1.0.2
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/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ class DocumentScanner {
|
|
|
34
34
|
let contoursObj = null;
|
|
35
35
|
let hierarchyObj = null;
|
|
36
36
|
try {
|
|
37
|
-
src = react_native_fast_opencv_1.OpenCV.
|
|
37
|
+
src = react_native_fast_opencv_1.OpenCV.base64ToMat(imageBase64);
|
|
38
38
|
gray = react_native_fast_opencv_1.OpenCV.invoke('Mat');
|
|
39
39
|
blurred = react_native_fast_opencv_1.OpenCV.invoke('Mat');
|
|
40
40
|
edges = react_native_fast_opencv_1.OpenCV.invoke('Mat');
|
|
@@ -104,7 +104,7 @@ class DocumentScanner {
|
|
|
104
104
|
const maxHeight = Math.max(Math.round(heightA), Math.round(heightB));
|
|
105
105
|
if (maxWidth === 0 || maxHeight === 0)
|
|
106
106
|
return undefined;
|
|
107
|
-
src = react_native_fast_opencv_1.OpenCV.
|
|
107
|
+
src = react_native_fast_opencv_1.OpenCV.base64ToMat(imageBase64);
|
|
108
108
|
dst = react_native_fast_opencv_1.OpenCV.invoke('Mat');
|
|
109
109
|
const srcPoints = react_native_fast_opencv_1.OpenCV.createObject('Point2fVector', tl.x, tl.y, tr.x, tr.y, br.x, br.y, bl.x, bl.y);
|
|
110
110
|
const dstPoints = react_native_fast_opencv_1.OpenCV.createObject('Point2fVector', 0, 0, maxWidth - 1, 0, maxWidth - 1, maxHeight - 1, 0, maxHeight - 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-opencv-doc-perspective-correction",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A React Native library for document corner detection and perspective correction using react-native-fast-opencv",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -41,7 +41,7 @@ export class DocumentScanner {
|
|
|
41
41
|
let hierarchyObj: any = null;
|
|
42
42
|
|
|
43
43
|
try {
|
|
44
|
-
src = OpenCV.
|
|
44
|
+
src = OpenCV.base64ToMat(imageBase64);
|
|
45
45
|
gray = OpenCV.invoke('Mat');
|
|
46
46
|
blurred = OpenCV.invoke('Mat');
|
|
47
47
|
edges = OpenCV.invoke('Mat');
|
|
@@ -122,7 +122,7 @@ export class DocumentScanner {
|
|
|
122
122
|
|
|
123
123
|
if (maxWidth === 0 || maxHeight === 0) return undefined;
|
|
124
124
|
|
|
125
|
-
src = OpenCV.
|
|
125
|
+
src = OpenCV.base64ToMat(imageBase64);
|
|
126
126
|
dst = OpenCV.invoke('Mat');
|
|
127
127
|
|
|
128
128
|
const srcPoints = OpenCV.createObject('Point2fVector', tl.x, tl.y, tr.x, tr.y, br.x, br.y, bl.x, bl.y);
|