# \#javascript

**URL:** https://forum.opencv.org/tag/javascript/38.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [Corners identification with OpenCV.js](https://forum.opencv.org/t/corners-identification-with-opencv-js/20768)

<div class="topic-metadata">

**Author:** [@jmspaggi](https://forum.opencv.org/u/jmspaggi)\
**Replies:** 17\
**Last updated:** [April 9, 2025, 3:36pm UTC](https://forum.opencv.org/t/corners-identification-with-opencv-js/20768 "2025-04-09T15:36:06Z")

</div>

Hi, I hope Javascript and Java are falling the the same category. Using OpenCV.js I’m trying to identify the corners of a card mask in a picture. I asked 3 different LLM to generate the code for that but they all fail. …

---

## [\[Opencv.js\] Loading tensorflow model into opencv.js](https://forum.opencv.org/t/opencv-js-loading-tensorflow-model-into-opencv-js/3422)

<div class="topic-metadata">

**Author:** [@eastemployeer](https://forum.opencv.org/u/eastemployeer)\
**Replies:** 6\
**Last updated:** [February 8, 2025, 6:55pm UTC](https://forum.opencv.org/t/opencv-js-loading-tensorflow-model-into-opencv-js/3422 "2025-02-08T18:55:26Z")

</div>

Hi there, I would like to ask whether there is any possibility to load tensorflow model (frozen\_inference\_graph.pb and corresponding .pbtxt file) into opencv.js? I’m struggling with it from several days. It appears that…

---

## [I'm getting a CORS error while using OpenCV](https://forum.opencv.org/t/im-getting-a-cors-error-while-using-opencv/19121)

<div class="topic-metadata">

**Author:** [@iremkesj](https://forum.opencv.org/u/iremkesj)\
**Replies:** 2\
**Last updated:** [October 26, 2024, 3:36pm UTC](https://forum.opencv.org/t/im-getting-a-cors-error-while-using-opencv/19121 "2024-10-26T15:36:27Z")

</div>

I’m experiencing CORS issues when uploading images and videos in a web-based project. How can I fix this?

---

## [UndistortPoints() in opencv.js](https://forum.opencv.org/t/undistortpoints-in-opencv-js/19108)

<div class="topic-metadata">

**Author:** [@alxxn](https://forum.opencv.org/u/alxxn)\
**Replies:** 0\
**Last updated:** [October 24, 2024, 9:23pm UTC](https://forum.opencv.org/t/undistortpoints-in-opencv-js/19108 "2024-10-24T21:23:02Z")

</div>

Hi, I am wondering if anyone has a solution for undistorting points in opencv.js. From looking at this file opencv-js/src/types/opencv/calib3d.ts at main · TechStark/opencv-js · GitHub, I thought that cv.undistortPoints …

---

## [Help to add true typescript support for opencv.js](https://forum.opencv.org/t/help-to-add-true-typescript-support-for-opencv-js/18111)

<div class="topic-metadata">

**Author:** [@Roman\_Fedorov](https://forum.opencv.org/u/Roman_Fedorov)\
**Replies:** 2\
**Last updated:** [June 28, 2024, 5:25pm UTC](https://forum.opencv.org/t/help-to-add-true-typescript-support-for-opencv-js/18111 "2024-06-28T17:25:47Z")

</div>

I’m preparing a production solution for opencv with wasm for node and web environments, already got it to work with docker and environments, but we are missing types. Repo with all bash scripts, package build scripts an…

---

## [Cannot load Haarcascade file in a Firefox Extension](https://forum.opencv.org/t/cannot-load-haarcascade-file-in-a-firefox-extension/16200)

<div class="topic-metadata">

**Author:** [@TimD](https://forum.opencv.org/u/TimD)\
**Replies:** 0\
**Last updated:** [January 18, 2024, 3:29pm UTC](https://forum.opencv.org/t/cannot-load-haarcascade-file-in-a-firefox-extension/16200 "2024-01-18T15:29:24Z")

</div>

Hello everyone, I’m new to OpenCV and I’m trying to make use of the Haar-cascade face detection in an extension for Firefox. I declared the xml file as a web accessible resource in the JSON file and I also set the runt…

---

## [Undoing a perspective transform results in the initial image but warped](https://forum.opencv.org/t/undoing-a-perspective-transform-results-in-the-initial-image-but-warped/14968)

<div class="topic-metadata">

**Author:** [@WJ\_Lee](https://forum.opencv.org/u/WJ_Lee)\
**Replies:** 7\
**Last updated:** [November 22, 2023, 10:10am UTC](https://forum.opencv.org/t/undoing-a-perspective-transform-results-in-the-initial-image-but-warped/14968 "2023-11-22T10:10:05Z")

</div>

Building a front-end only image processing application and I am struggling to perform an un-transform logic for my image. FYI, I am using https://docs.opencv.org/4.7.0/opencv.js I have a canvas that shows an image from…

---

## [Opencv.js (Javascript) How can I create a contour (Mat) object with vertices coordinates in an array](https://forum.opencv.org/t/opencv-js-javascript-how-can-i-create-a-contour-mat-object-with-vertices-coordinates-in-an-array/14046)

<div class="topic-metadata">

**Author:** [@brotherseven](https://forum.opencv.org/u/brotherseven)\
**Replies:** 0\
**Last updated:** [July 28, 2023, 6:40am UTC](https://forum.opencv.org/t/opencv-js-javascript-how-can-i-create-a-contour-mat-object-with-vertices-coordinates-in-an-array/14046 "2023-07-28T06:40:07Z")

</div>

Hi there, This is a question about using opencv.js (Javascript): How can I properly create a contour (Mat) object with vertices coordinates in an array, such as \[\[1,2\],\[3,4\],\[5,6\],\[7,8\]\]? Regards Richard

---

## [Removing lines that are very close to each other](https://forum.opencv.org/t/removing-lines-that-are-very-close-to-each-other/13952)

<div class="topic-metadata">

**Author:** [@arkonique](https://forum.opencv.org/u/arkonique)\
**Replies:** 0\
**Last updated:** [July 19, 2023, 9:08pm UTC](https://forum.opencv.org/t/removing-lines-that-are-very-close-to-each-other/13952 "2023-07-19T21:08:53Z")

</div>

I am using opencv.js to detect some lines in an image using the houghp transform. This is the result I am getting - And here is the function call - let lines = new cv.Mat(); cv.HoughLinesP(canny, lines, 1, Math.PI /…

---

## [Using aruco from opencv.js](https://forum.opencv.org/t/using-aruco-from-opencv-js/13277)

<div class="topic-metadata">

**Author:** [@nicbkw](https://forum.opencv.org/u/nicbkw)\
**Replies:** 7\
**Last updated:** [June 9, 2023, 10:17pm UTC](https://forum.opencv.org/t/using-aruco-from-opencv-js/13277 "2023-06-09T22:17:31Z")

</div>

I built a current version of opencv.js using: git clone https://github.com/opencv/opencv.git cd opencv git clone https://github.com/opencv/opencv\_contrib.git docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) e…

---

## [Is there a way to load base64 string Image?](https://forum.opencv.org/t/is-there-a-way-to-load-base64-string-image/13146)

<div class="topic-metadata">

**Author:** [@halil.hpolat](https://forum.opencv.org/u/halil.hpolat)\
**Replies:** 0\
**Last updated:** [May 11, 2023, 6:27pm UTC](https://forum.opencv.org/t/is-there-a-way-to-load-base64-string-image/13146 "2023-05-11T18:27:28Z")

</div>

Hello, I am developing a project with the Ionic Angular platform. In my project, I am using the Cordova Camera Preview plugin to continuously process images from the phone camera with OpenCV. Is there a way to load Image…

---

## [Issue occurred when trying to build opencv node binding prebuilt using github windows 2019 runner](https://forum.opencv.org/t/issue-occurred-when-trying-to-build-opencv-node-binding-prebuilt-using-github-windows-2019-runner/13021)

<div class="topic-metadata">

**Author:** [@lw007](https://forum.opencv.org/u/lw007)\
**Replies:** 3\
**Last updated:** [May 2, 2023, 4:44pm UTC](https://forum.opencv.org/t/issue-occurred-when-trying-to-build-opencv-node-binding-prebuilt-using-github-windows-2019-runner/13021 "2023-05-02T16:44:23Z")

</div>

Hi all. I am facing an issue trying to build a prebuilt of opencv node binding using github windows 2019 Runner. Here is the error. I have no clue to figure out the error 'a' is not recognized as an internal or extern…

---

## [Failed to allocate 1240308 bytes in function 'OutOfMemoryError'](https://forum.opencv.org/t/failed-to-allocate-1240308-bytes-in-function-outofmemoryerror/11850)

<div class="topic-metadata">

**Author:** [@halil.hpolat](https://forum.opencv.org/u/halil.hpolat)\
**Replies:** 8\
**Last updated:** [February 22, 2023, 12:47pm UTC](https://forum.opencv.org/t/failed-to-allocate-1240308-bytes-in-function-outofmemoryerror/11850 "2023-02-22T12:47:22Z")

</div>

Hello, I am developing a project with the Ionic Angular platform. In my project, I am using the Cordova Camera Preview plugin to continuously process images from the phone camera with OpenCV. That is, images from the pho…

---

## [Are Build OpenCV.js docs outdated? Failed build from Source](https://forum.opencv.org/t/are-build-opencv-js-docs-outdated-failed-build-from-source/11834)

<div class="topic-metadata">

**Author:** [@Alex\_R](https://forum.opencv.org/u/Alex_R)\
**Replies:** 4\
**Last updated:** [February 8, 2023, 8:18pm UTC](https://forum.opencv.org/t/are-build-opencv-js-docs-outdated-failed-build-from-source/11834 "2023-02-08T20:18:35Z")

</div>

I’ve followed the instructions, but received an error. emcmake sh -c 'echo ${EMSCRIPTEN}' configure: sh -c "echo ${EMSCRIPTEN}" -DCMAKE\_TOOLCHAIN\_FILE=/Users/rose/dev/emsdk/upstream/emscripten/cmake/Modules/Platform…

---

## [How to perform math operations with OpenCV Matrix and a point-like value in Javascript?](https://forum.opencv.org/t/how-to-perform-math-operations-with-opencv-matrix-and-a-point-like-value-in-javascript/11155)

<div class="topic-metadata">

**Author:** [@martinicus](https://forum.opencv.org/u/martinicus)\
**Replies:** 1\
**Last updated:** [November 30, 2022, 12:35pm UTC](https://forum.opencv.org/t/how-to-perform-math-operations-with-opencv-matrix-and-a-point-like-value-in-javascript/11155 "2022-11-30T12:35:38Z")

</div>

I want to scale a contour in OpenCV.js. I have a valid contour in cnt variable of type cv.Mat (verified it by using drawContours). I found a function in Python that does everything I need but I have problems converting …

---

## [How to load any of this tracking algorithm in opencvjs(BOOSTING, MIL, KCF, TLD, MEDIANFLOW, GOTURN, MOSSE or CSRT)](https://forum.opencv.org/t/how-to-load-any-of-this-tracking-algorithm-in-opencvjs-boosting-mil-kcf-tld-medianflow-goturn-mosse-or-csrt/8006)

<div class="topic-metadata">

**Author:** [@Pablo\_Padilla](https://forum.opencv.org/u/Pablo_Padilla)\
**Replies:** 3\
**Last updated:** [October 12, 2022, 8:20am UTC](https://forum.opencv.org/t/how-to-load-any-of-this-tracking-algorithm-in-opencvjs-boosting-mil-kcf-tld-medianflow-goturn-mosse-or-csrt/8006 "2022-10-12T08:20:20Z")

</div>

Hello, I wanted to load any of these tracking algorithms in javascript using opencvjs. please suggest me or giving some links to do the same. I tried to refer this c++ and Python code link : https://learnopencv.com/ob…

---

## [How can create and use tracker in JavaScript code](https://forum.opencv.org/t/how-can-create-and-use-tracker-in-javascript-code/10524)

<div class="topic-metadata">

**Author:** [@Vaibhav\_Pitale](https://forum.opencv.org/u/Vaibhav_Pitale)\
**Replies:** 0\
**Last updated:** [October 12, 2022, 8:13am UTC](https://forum.opencv.org/t/how-can-create-and-use-tracker-in-javascript-code/10524 "2022-10-12T08:13:27Z")

</div>

Hi , I want to create CSRT tracker for object detection in JavaScript but getting undefined object. I use below code let tracker = this.$cv.TrackerCSRT\_create;

---

## [Perspective Transformed Image Edge Becomes Crisp](https://forum.opencv.org/t/perspective-transformed-image-edge-becomes-crisp/9741)

<div class="topic-metadata">

**Author:** [@David\_Lee21](https://forum.opencv.org/u/David_Lee21)\
**Replies:** 7\
**Last updated:** [August 12, 2022, 5:58am UTC](https://forum.opencv.org/t/perspective-transformed-image-edge-becomes-crisp/9741 "2022-08-12T05:58:39Z")

</div>

Hi~! I am trying to get an image perspectively transformed. I followed the exact step on this tutorial page on opencv. If you look at the warped image closely, diagonal lines become really crisp. I used the very s…

---

## [TypeError: cv.findNonZero is not a function](https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126)

<div class="topic-metadata">

**Author:** [@Justin\_Kiff](https://forum.opencv.org/u/Justin_Kiff)\
**Replies:** 1\
**Last updated:** [June 12, 2022, 8:09am UTC](https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126 "2022-06-12T08:09:02Z")

</div>

Hello, with latest 4.6.0 version of opencv.js i have the following error when using findNonZero function: let src = cv.imread('canvasInput'); let dst = new cv.Mat(); cv.threshold(src, dst, 177, 200, cv.THRESH\_BINARY); l…

---

## [Is there a way to convert opencv object (mat object) to blob in javascript?](https://forum.opencv.org/t/is-there-a-way-to-convert-opencv-object-mat-object-to-blob-in-javascript/7051)

<div class="topic-metadata">

**Author:** [@vnodrajendran](https://forum.opencv.org/u/vnodrajendran)\
**Replies:** 5\
**Last updated:** [May 25, 2022, 5:19pm UTC](https://forum.opencv.org/t/is-there-a-way-to-convert-opencv-object-mat-object-to-blob-in-javascript/7051 "2022-05-25T17:19:30Z")

</div>

Currently I am figuring out how can we convert directly opencv object to blob without using canvas? Any help here

---

## [\[JS\] VideoCapture().read() in iPhone 13 Pro (only this phone) returns saturated image](https://forum.opencv.org/t/js-videocapture-read-in-iphone-13-pro-only-this-phone-returns-saturated-image/8771)

<div class="topic-metadata">

**Author:** [@apraglez](https://forum.opencv.org/u/apraglez)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 10:01am UTC](https://forum.opencv.org/t/js-videocapture-read-in-iphone-13-pro-only-this-phone-returns-saturated-image/8771 "2022-05-13T10:01:03Z")

</div>

Hi! I’ve been developing a browser-based app that opens the camera in a mobile phone and processes the images using OpenCV. Currently, I’m facing a particular problem with a specific phone, which leads me to think that t…

---

## [Can I get any tips about migrating cv project from python to nodejs?](https://forum.opencv.org/t/can-i-get-any-tips-about-migrating-cv-project-from-python-to-nodejs/7334)

<div class="topic-metadata">

**Author:** [@David\_Jung](https://forum.opencv.org/u/David_Jung)\
**Replies:** 1\
**Last updated:** [January 29, 2022, 8:21am UTC](https://forum.opencv.org/t/can-i-get-any-tips-about-migrating-cv-project-from-python-to-nodejs/7334 "2022-01-29T08:21:17Z")

</div>

I’m using python because when I have started the current project, I didn’t know I can do it using JS. I’m more friendly with JS than python and I have no reason to migrate the project. So Do you have any tips for me?

---

## [Detecting a smartphone screen](https://forum.opencv.org/t/detecting-a-smartphone-screen/6829)

<div class="topic-metadata">

**Author:** [@akiva](https://forum.opencv.org/u/akiva)\
**Replies:** 2\
**Last updated:** [December 22, 2021, 3:32pm UTC](https://forum.opencv.org/t/detecting-a-smartphone-screen/6829 "2021-12-22T15:32:44Z")

</div>

Hi, I’m trying to detect a smartphone screen in an image. I have control over the phone’s screen, so I can put a very visible pattern on the screen before capturing, which I would assume makes this doable. First, it lo…

---

## [Convert keypoints to point2f to store in a file or localstorage](https://forum.opencv.org/t/convert-keypoints-to-point2f-to-store-in-a-file-or-localstorage/5713)

<div class="topic-metadata">

**Author:** [@jeremias](https://forum.opencv.org/u/jeremias)\
**Replies:** 11\
**Last updated:** [October 20, 2021, 3:41pm UTC](https://forum.opencv.org/t/convert-keypoints-to-point2f-to-store-in-a-file-or-localstorage/5713 "2021-10-20T15:41:30Z")

</div>

Hi! :slight\_smile: according to the documentation, its possible to convert an KeyPoint into a point2f… Well im trying to convert an array of keyPoints from cvOrb. let orb = new cv.ORB(); orb.setMaxFeatures(MAX\_FEA…

---

## [Place an image over another image using OpenCV.js](https://forum.opencv.org/t/place-an-image-over-another-image-using-opencv-js/5389)

<div class="topic-metadata">

**Author:** [@n4beel](https://forum.opencv.org/u/n4beel)\
**Replies:** 3\
**Last updated:** [September 29, 2021, 1:16pm UTC](https://forum.opencv.org/t/place-an-image-over-another-image-using-opencv-js/5389 "2021-09-29T13:16:30Z")

</div>

Hello I have been struggling with OpenCV.js for a while now. Thanks to @berak I am closer to the solution now. I am trying to build a Javascript library using OpenCV.js which takes an image as input and provides an outpu…

---

## [Blurring skin in image](https://forum.opencv.org/t/blurring-skin-in-image/5368)

<div class="topic-metadata">

**Author:** [@n4beel](https://forum.opencv.org/u/n4beel)\
**Replies:** 7\
**Last updated:** [September 28, 2021, 10:41am UTC](https://forum.opencv.org/t/blurring-skin-in-image/5368 "2021-09-28T10:41:15Z")

</div>

Hello, I am building a Javascript library which takes an image as an input, the output image will have all the human skin blurred like below. I have got this script in python, which is working perfectly (example below)…

---

## [Docker build opencv.js cannot work as expected](https://forum.opencv.org/t/docker-build-opencv-js-cannot-work-as-expected/5255)

<div class="topic-metadata">

**Author:** [@Mervyn\_Zhan](https://forum.opencv.org/u/Mervyn_Zhan)\
**Replies:** 0\
**Last updated:** [September 16, 2021, 2:13pm UTC](https://forum.opencv.org/t/docker-build-opencv-js-cannot-work-as-expected/5255 "2021-09-16T14:13:04Z")

</div>

I followed the guide to build the opencv.js with docker, but opencv.js cannot work. It’s some environment or info below: The source code is 41a2eb5245583403f4a26ca24ec7ba736d2cca5e of the master branch, System: macos b…

---

## [Detect paper in image using Javascript](https://forum.opencv.org/t/detect-paper-in-image-using-javascript/2404)

<div class="topic-metadata">

**Author:** [@dmikester1](https://forum.opencv.org/u/dmikester1)\
**Replies:** 2\
**Last updated:** [March 28, 2021, 2:29am UTC](https://forum.opencv.org/t/detect-paper-in-image-using-javascript/2404 "2021-03-28T02:29:47Z")

</div>

We have a web application I built for our company on React and NodeJS all in Javascript/CSS/HTML. We want to add a feature for the user to capture an image of a label with the ipad they are using. So I am looking for a…

---

## [Opencv building from source : emcc error code 1 (Emscripten.cmake)](https://forum.opencv.org/t/opencv-building-from-source-emcc-error-code-1-emscripten-cmake/2205)

<div class="topic-metadata">

**Author:** [@cbaba](https://forum.opencv.org/u/cbaba)\
**Replies:** 18\
**Last updated:** [March 27, 2021, 4:23pm UTC](https://forum.opencv.org/t/opencv-building-from-source-emcc-error-code-1-emscripten-cmake/2205 "2021-03-27T16:23:40Z")

</div>

System information (version) OpenCV =\> 4.5.0 Operating System / Platform =\> Windows 10 / 64 Bit Compiler =\> Visual Studio 2021 1.54 Cmake 3.20.0-rc2 Emscripten 1.38.31 Detailed description In a Windows CMD terminal, wh…

---

## [I can't use opencv extra modules like Eigenfaces, Fisherfaces etc](https://forum.opencv.org/t/i-cant-use-opencv-extra-modules-like-eigenfaces-fisherfaces-etc/1780)

<div class="topic-metadata">

**Author:** [@murilors](https://forum.opencv.org/u/murilors)\
**Replies:** 5\
**Last updated:** [February 27, 2021, 4:23pm UTC](https://forum.opencv.org/t/i-cant-use-opencv-extra-modules-like-eigenfaces-fisherfaces-etc/1780 "2021-02-27T16:23:09Z")

</div>

Hello, I’m trying to use opencv with the npm package opencv4nodejs, the installation process works fine but the problem is when I try to use some extra module of opencv like eigenfaces and fisherfaces. When I try to use…

[Next page](https://forum.opencv.org/tag/javascript/38.md?match_all_tags=true&page=1&tags%5B%5D=javascript)
