src/svm.js
function getDescriptors(images) {
  const result = [];
  for (let image of images) {
    result.push(extractHOG(image));
  }

  const heights = images.map((img) => img.height);
  const maxHeight = Math.max.apply(null, heights);
  const minHeight = Math.min.apply(null, heights);
  for (let i = 0; i < images.length; i++) {
    const img = images[i];
    let bonusFeature = 1;
    if (minHeight !== maxHeight) {
      bonusFeature = (img.height - minHeight) / (maxHeight - minHeight);
    }
    result[i].push(bonusFeature);
  }
  return result;
}
function getDescriptors(images) {
  const result = [];
  for (let image of images) {
    result.push(extractHOG(image));
  }

  const heights = images.map((img) => img.height);
  const maxHeight = Math.max.apply(null, heights);
  const minHeight = Math.min.apply(null, heights);
  for (let i = 0; i < images.length; i++) {
    const img = images[i];
    let bonusFeature = 1;
    if (minHeight !== maxHeight) {
      bonusFeature = (img.height - minHeight) / (maxHeight - minHeight);
    }
    result[i].push(bonusFeature);
  }
  return result;
}
function getDescriptors ( images ) { const result = [ ] ; for ( let image of images ) { result . push ( extractHOG ( image ) ) ; } const heights = images . map ( ( img ) => img . height ) ; const maxHeight = Math . max . apply ( null , heights ) ; const minHeight = Math . min . apply ( null , heights ) ; for ( let i = 0 ; i < images . length ; i ++ ) { const img = images [ i ] ; let bonusFeature = 1 ; if ( minHeight !== maxHeight ) { bonusFeature = ( img . height - minHeight ) / ( maxHeight - minHeight ) ; } result [ i ] . push ( bonusFeature ) ; } return result ; }
Get descriptors for images from 1 identity card
Get descriptors for images from 1 identity card