Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Jul 22, 2023
1 parent 64bd17a commit 2b6b067
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Opencv/templateMatching.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const findMatch = (cv) => (template, image) => {
let colorRed = new cv.Scalar(255, 100, 200, 255);
cv.putText(image, "" + numberPoint, new cv.Point(10, 30), cv.FONT_HERSHEY_SIMPLEX, 1.0, colorRed, 1, cv.LINE_AA);

if(maxPoint.x > 0 && maxPoint.y > 0 && Math.abs(maxPoint.x - point1.x) < 20 && Math.abs(maxPoint.y - point1.y) < 20 ) {
if(maxPoint.x > 0 && maxPoint.y > 0 && Math.abs(maxPoint.x - point1.x) < 10 && Math.abs(maxPoint.y - point1.y) < 10 ) {
const lineSize = average < 0.1 ? 1 : parseInt(average * 10, 10);
//console.log("lineSize")
//console.log(lineSize)
Expand Down
2 changes: 1 addition & 1 deletion src/Opencv/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const loadVideoAsync = (cv) => (transformImage) => {
audio: false,
video: {
width: { ideal: 2600 },
height: { ideal: 2000 },
height: { ideal: 2600 },
facingMode: {
//ideal: 'face'
ideal: 'environment'
Expand Down
6 changes: 3 additions & 3 deletions src/TemplateVideo.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const transformImage = (stateImgCvTemplateResized, imgDescription) => {
// const imgDescription = JSON.parse(state.jsonContent)
// const limiteRate = parseInt((state.confidenceRate + state.confidenceRate / 8), 10);
// console.log("limiteRate", limiteRate)
/*promise = zoneAsync(cv)(imgCv, imgDescription, 30).then(result => {
promise = zoneAsync(cv)(imgCv, imgDescription, 30).then(result => {

try {
console.log("result", result);
if (result && result?.goodMatchSize > state.confidenceRate -30 ) {
if (result && result?.goodMatchSize > state.confidenceRate) {
const bestOutput = toImageBase64(cv)(imgCv);
const newState = {
...state,
Expand Down Expand Up @@ -77,7 +77,7 @@ const transformImage = (stateImgCvTemplateResized, imgDescription) => {
}

}
);*/
);

/*
const result = await computeAndApplyHomography(cv)(imgDescription, imgCv, state.confidenceRate);
Expand Down

0 comments on commit 2b6b067

Please sign in to comment.