Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
Count similarity percentage of two images by using Tracking.js Feature Descriptor (Brief)

For those who don't know about what is Tracking.js, The tracking.js library brings different computer vision algorithms and techniques into the browser environment. Using modern HTML5 specifications, it enables you to do real-time color tracking, face detection, and much more. Learn more about it on https://trackingjs.com/

But my problem is I want to see the percentage similarity of the two images by using Tracking.js Feature Descriptor (Brief). I read the documentation but can't understand properly.

  window.onload = function() {
    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();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!