# Extention using OpenCV

**URL:** <https://discourse.mozilla.org/t/extention-using-opencv/62869>\
**Category:** Development\
**Tags:** learning\
**Created:** [June 29, 2020, 8:50pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869 "2020-06-29T20:50:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Homlet](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@Homlet](https://discourse.mozilla.org/u/Homlet)\
**Post date:** [June 29, 2020, 8:50pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869/1 "2020-06-29T20:50:03Z")

</div>

Hello,

I’m very new to javascript and extension development, and I wanted to know if I was possible to use OpenCV in an extension? I’ve seen that opencv works in some capacity with javascript, so I thought that maybe it was possible. I haven’t been able to find anything about it though

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![jscher2000](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jscher2000/32/28202_2.png) [@jscher2000](https://discourse.mozilla.org/u/jscher2000)\
**Post date:** [June 29, 2020, 10:43pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869/2 "2020-06-29T22:43:59Z")

</div>

C and C++ libraries that are compiled to WebAssembly (AKA wasm) can be called from JavaScript. I see some results for searches of _OpenCV wasm_ out on the web, but don’t know which ones would be good choices to consider.

If you include any compiled code in your extension, you also need to supply the source files, and this will increase the time for review. I’m not the best person to discuss that aspect.

---

<div class="post-metadata">

**Author:** ![Homlet](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@Homlet](https://discourse.mozilla.org/u/Homlet)\
**Post date:** [June 30, 2020, 1:02pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869/3 "2020-06-30T13:02:48Z")

</div>

Alright thank you, I’ll be looking into it. Do you know if I could just use opencv.js ([https://docs.opencv.org/4.1.1/d5/d10/tutorial\_js\_root.html](https://docs.opencv.org/4.1.1/d5/d10/tutorial_js_root.html))? I don’t mean to be spoonfed, but perhaps including the file ([https://docs.opencv.org/4.1.1/opencv.js](https://docs.opencv.org/4.1.1/opencv.js)) and importing it could work?  
I’m familiar with OpenCV on C++, but webdev stuff looks alien to me

---

<div class="post-metadata">

**Author:** ![jscher2000](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jscher2000/32/28202_2.png) [@jscher2000](https://discourse.mozilla.org/u/jscher2000)\
**Post date:** [June 30, 2020, 2:51pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869/4 "2020-06-30T14:51:04Z")

</div>

Unfortunately, I don’t think either of us could say whether that will work in an extension without trying it.

---

<div class="post-metadata">

**Author:** ![Homlet](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@Homlet](https://discourse.mozilla.org/u/Homlet)\
**Post date:** [June 30, 2020, 3:13pm UTC](https://discourse.mozilla.org/t/extention-using-opencv/62869/5 "2020-06-30T15:13:36Z")

</div>

Fair enough, I’ll give it a shot. Thank you 🙂
