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

143
Visualizações
Javascript Video Capture

I have the following code. It displays filter video at top and original video at bottom.

How to hide the video at the top?

Thanks

// https://editor.p5js.org/

function setup() {
   createCanvas(320, 260);
   video = createCapture(VIDEO);
   video.size(width,height);
 }
 let video;
 function draw() {
 image(video,0,0,width,height);
 // filter(THRESHOLD); 
//  filter(GRAY);
filter(INVERT);
}
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Thank you @Samathingamajig

The following Code works for me.

let video;

function setup() {
  createCanvas(320, 260);
  video = createCapture(VIDEO);
  video.size(width, height);
  video.hide();
}

function draw() {
  image(video,0,0,width,height);
  // rest of code
}
about 4 years ago · Juan Pablo Isaza Relatório

0

Can we redefine it as below?

// https://editor.p5js.org/

function setup() {
   createCanvas(700, 394);
   video = createCapture(VIDEO);
   
   video.hide();
  // video.show();
 }
 let video;
 function draw() {
 image(video,0,0,width,height);
 // filter(THRESHOLD); 
 //  filter(GRAY);
 // filter(INVERT);
}
about 4 years ago · Juan Pablo Isaza Relatório

0

On the documenation page, it says to do video.hide() to hide the webcam capture.

And if you don't want the filter, then don't call filter(...)

So your code will look like this:

let video;

function setup() {
  createCanvas(320, 260);
  video = createCapture(VIDEO);
  video.size(width, height);
  video.hide();
}

function draw() {
  image(video,0,0,width,height);
  // rest of code
}

If you ever want to reshow the original video, just run video.show().

about 4 years ago · Juan Pablo Isaza Relatório
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