Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
how to use pixfinder to detect specific pixels

I'm currently using https://www.npmjs.com/package/pixfinder to try and detect holes in my paper targets to automatically score my target. I placed it against a red backer board, took a picture of it and I was trying to find the "red" in the image.

target

Component code.

import * as pix from 'pixfinder';

@Component({
  selector: 'app-find-bullets',
  templateUrl: './find-bullets.component.html',
  styleUrls: ['./find-bullets.component.scss']
})
export class FindBulletsComponent implements AfterViewInit {

  bulletCount: number = 0;
  @ViewChild('img') img!: ElementRef<HTMLImageElement>;

  constructor() { }

  ngAfterViewInit(): void {
    var holes = pix.findAll({
      img: this.img.nativeElement,
      distance: 2,
      colors: ['#6e0917'], //red
      clearNoise: 10,
    });
    console.log(holes)
    this.bulletCount = holes.length;
  }
}

bulletCount is always "1", with the points being essentially the whole target if I'm reading this right:

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda