eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

Face alignment position is a bit of problem #247

Open geekplux opened 7 years ago

geekplux commented 7 years ago

screen shot 2017-08-31 at 10 38 45

In face alignment in images example, the position of face rect and landmarks is wrong, but in video and webcam examples is right. I reviewed the code but can not find the solution. do you have any idea? @jeromeetienne

geekplux commented 7 years ago

screen shot 2017-08-31 at 10 49 39

it's right in this picture.

SelaO commented 7 years ago

Your canvas size might be too small, you need to set the width and height of it.

geekplux commented 7 years ago

@SelaO I've tried it on three different screens. I don't think it caused by this.

SelaO commented 7 years ago

Not screens, the canvas has a width and height props.

You can see that it finds something similar to a head but its scaled down.

geekplux commented 7 years ago

@SelaO ...really not, you can clone and run it.

murat-aka commented 6 years ago

I had similar problem with java and OpenCV.

Here it finds a face like shape and focuses on that area.

OpenCV had options like minimum area to look for.

murat-aka commented 6 years ago
  /**
   * Sets the minimum dimension to classify a rectangle.
   * @param {number} minDimension
   */
  tracking.ColorTracker.prototype.setMinDimension = function(minDimension) {
    this.minDimension = minDimension;
  };

HERE

dinesh124 commented 6 years ago

hey how can we train the landmark and regressor for dtecteting other than face ,like hands

tetreault commented 6 years ago

Same issue - canvas has set height and width similar to the demo. demo works flawlessly on the site and in my demo for images, but for webcam stream the boxes for eye regions is always offset too much. I can fudge it a little bit with some percentages of the rect x, y, w, and h like so: context.strokeRect(rect.x * 0.5, rect.y * 0.5, rect.width * 0.3, rect.height * 0.3); and it is better but I feel like this wont work all the time.

karneaud commented 6 years ago

+1