Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Jul 28, 2023
1 parent 9cb4397 commit 752a078
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SlightCapture/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const zoneAsync = (cv) => async (sceneUrl, imgDescription, goodMatchSizeT
} else{
imgCv= sceneUrl;
}
let imgCvCopy = imgCv; //.clone();
let imgCvCopy = imgCv.clone();

// const isGray = isImgGray(cv)(imgCv);

Expand All @@ -88,9 +88,9 @@ export const zoneAsync = (cv) => async (sceneUrl, imgDescription, goodMatchSizeT
//const imgVersoCvTemplateResized = imageResize(cv)(imgVersoCvTemplate, 600).image;
// const youhou = detectAndComputeSerializable(cv)( imgVersoCvTemplateResized);

const result = computeAndComputeHomographyRectangle(cv)(imgDescription, imgResizedAndCropped, goodMatchSizeThreshold);
const result = computeAndComputeHomographyRectangle(cv)(imgDescription, imgResized, goodMatchSizeThreshold);
let angle = 0;
let mat = new cv.Mat(imgResizedAndCropped.rows, imgResizedAndCropped.cols, imgResizedAndCropped.type(), new cv.Scalar());
let mat = new cv.Mat(imgCvCopy.rows, imgCvCopy.cols, imgCvCopy.type(), new cv.Scalar());

if (result && result.lines) {
let i = 0;
Expand Down Expand Up @@ -138,15 +138,15 @@ export const zoneAsync = (cv) => async (sceneUrl, imgDescription, goodMatchSizeT
// url: base64Url,
goodMatchSize: 0,
// isGray,
finalImage: imgResizedAndCropped,
finalImage: null,
outputInfo: null
};
}

const {xmax, xmin, ymax, ymin} = result.rectangle;

const contours = findContours(cv)(mat, 0);
let croppedContours = cropContours(cv)(imgResizedAndCropped, contours);
let croppedContours = cropContours(cv)(imgCv, contours);
let croppedContourImgs = croppedContours.map(cc => rotateImage(cv)(cc.img, angle));
let croppedContoursBase64 = croppedContourImgs.map(cc => {
// let result = imageResize(cv)(cc, 680);
Expand Down

0 comments on commit 752a078

Please sign in to comment.