eduardolundgren / eduardolundgren/tracking.js
I want to see the similarity percentage between two images using Brief.
- Dominant language
- JavaScript
- Stars
- 9.5k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
I want to see the similarity percentages between the two images using Brief. I can't understand too much by reading Documentation how can I do this. Can anyone help me with this, please?
```
var width = 393;
var height = 295;
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var image1 = document.getElementById('image1');
var image2 = document.getElementById('image2');
window.descriptorLength = 256;
window.matchesShown = 30;
window.blurRadius = 3;
var doMatch = function() {
tracking.Brief.N = window.descriptorLength;
context.drawImage(image1, 0, 0, width, height);
context.drawImage(image2, width, 0, width, height);
var imageData1 = context.getImageData(0, 0, width, height);
var imageData2 = context.getImageData(width, 0, width, height);
var gray1 = tracking.Image.grayscale(tracking.Image.blur(imageData1.data, width, height, blurRadius), width, height);
var gray2 = tracking.Image.grayscale(tracking.Image.blur(imageData2.data, width, height, blurRadius), width, height);
var corners1 = tracking.Fast.findCorners(gray1, width, height);
var corners2 = tracking.Fast.findCorners(gray2, width, height);
var descriptors1 = tracking.Brief.getDescriptors(gray1, width, corners1);
var descriptors2 = tracking.Brief.getDescriptors(gray2, width, corners2);
var matches = tracking.Brief.reciprocalMatch(corners1, descriptors1, corners2, descriptors2);
matches.sort(function(a, b) {
return b.confidence - a.confidence;
});
var similarityPercentage = **What Shoud I Count Here?**;
console.log(similarityPercentage)
};
doMatch();
```
https://trackingjs.com/examples/brief.html
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked Brief example and the doMatch entry point, especially tracking.Brief.reciprocalMatch and the matches confidence values shown in the issue. Determine what similarity percentage should mean and document a reproducible calculation; done means the example or documentation explains the result clearly and produces an understandable percentage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-vision
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100