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

314
Visualizações
using LUT & applyColorMap with opencv.js

I'd like to use LUT & applyColorMap in opencv.js. By default, they are not included, thus I tried doing a custom build, but I'm getting runtime errors when trying to use them:

LUT:

Uncaught (in promise) 6705216

That's pretty much all the information on the error there is.

applyColorMap:

Uncaught (in promise) TypeError: Cannot convert "[object Object]" to int

It seems only the first overload of applyColorMap is supported, but I need the second one with a custom userColor matrix (see docs).

Steps to reproduce
  1. add 'LUT' to core section in ./platforms/js/opencv_js.config.py
  2. add 'applyColorMap' to imgproc section in ./platforms/js/opencv_js.config.py
  3. Build opencv.js with the following command:
$ emcmake python ./platforms/js/build_js.py build_wasm --build_wasm
  1. call the functions in javascript, e.g. like this:
import cv_ from "./opencv.js"

(async () {
  const cv = await cv_

  // provide some `imgEl` here
  const img = cv.imread(imgEl)
  const lut = new cv.Mat.zeros(256, 4, cv.CV_8UC4)
  const out = new cv.Mat()
  // error is thrown here:
  cv.LUT(img, lut, out)
  // cv.applyColorMap(img, out, lut)
  lut.delete()
})()
System information
  • OpenCV: 4.5.5
  • OS: NixOS 22.05
  • emscripten: 2.0.10
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