GSOC 17: OpenCV for p5.js

Hello, This is Shubham Rathore an open source contributor to processing. I wish to propose a project that basically defines an efficient approach to provide image processing functionalities to p5.js. It aims to target the users of p5.js who wish to operate on the images without importing any module/library other than p5 itself. It would be helpful if get some valuable inputs so that I can improve the workflow and thus improve my proposal.

Cheers! Shubham Rathore(:gabbar1947) Git - GABBAR1947


  • I think there would be a lot of interest from the community in more examples and pathways for implementing computer vision / image processing algorithms with p5.js. I would suggest proposing this as a p5 "add-on" rather than a feature to be incorporated into the library itself. Also, I would take a look at tracking.js as a reference.

  • Oh yes! addon library is what I meant. I aim to bind the opencv library into js using emscripten. What do you think about it ?

  • edited March 2017

    This sounds like a reasonable approach to me. Perhaps an emscripten version of opencv exists already? I would do some research to see what is out there to reference in your proposal. Does it make sense to build something from scratch or build on top of an existing tool or library?

  • It might be worth checking out whether these emscripten JavaScript bindings for OpenCV 3.0 would be useful for the proposed project.

  • It is a wrapping of the current modules. I aim to wrap core, imgproc, video, objdetect, features2D and highgui modules primarily and use the Embind implementation that is supported by Emscripten. I have my proposal ready, I'd like to share it for further amendments. Is it fine to share it here?

  • Sure, go right ahead!

  • edited March 2017


  • Hi is a popular library in nodejs. It is useful IMO.

    And I'm curious about what format you will choose, asm.js or webassembly. I have some experiences about Emscripten. I tried to compile to asm.js, and it did not support safari. That was a problem when I used Emscripten.

  • edited March 2017

    As far as I know it doesn't break on safari, there might have been another issue. Well Webassembly is indeed faster than asm.js, indeed a very good suggestion, thanks. Compiling to WebAssembly is supported by Emscripten along with a compiler flag, thus it becomes good for the projects to target asm.js as well as WebAssembly. Binaryen can be put to use for this. Well again thanks for the suggestion, the proposal can be further changed according to other efficient inputs as well. Lets see what others feel about this ! Cheers !

  • edited March 2017


    Yeah I'm familiar with Native Client in Chrome, but just a beginner in asm.js or wasm. It is just a suggestion :)

    I used to try asm.js in safari and also told me it was not supported in safari. :-??

  • That's not a big issue, it can be taken care of. The primary focus is to add opencv functionalities to p5.js and such issues(if aroused) can be handled later on. Anyways, thanks for showing interest in the project !

  • @shiffman any suggestions or views before I start finalizing the proposal will be of great help ! TIA :

  • I'm looking forward to reading your proposal. One thing that would be helpful beyond how you will create the library is what sort of projects / applications you imagine p5 users will be able to create with your library that they cannot currently with the existing API or other JS libraries.

  • Will surely get into this ! Thanks

  • I've shared my draft proposal on the official summerofcode dashboard. All the valuable views and suggestions are welcome. Cheers !

  • edited March 2017

    @shiffman @lmccart I'd like to know your views on the proposal, for improvisation.

  • hi @gabbar1947 I read over your proposal, it was very thorough and thoughtful. however, I think it's important to note (JS emscripten bindings for opencv), which seems to do much of what you are proposing. can you explain how your approach is different or adds to this work?

  • The ucisysarch/opencvjs supports only 8 modules out of 57, we need more modules that need to be wrapped on the opinion of the community members. Moreover, asm.js comes into use. We can move over to WebAssembly if the community finds it to be good ! Thanks for the reply !

  • Just FYI, is a popular lib in GitHub, which is a a set of headers that make your C++11 library accessible from JavaScript.

    It may be helpful to you :)

  • @gaocegege gracias ! It is indeed helpful. Will go through it !

Sign In or Register to comment.