OpenCv JavaScript/TypeScript API for Node.js and Browser on top of OpenCv.js, adding support for npm, TypeScript and utilities related to asynchronicity, DOM, etc.

## Contents

<!-- toc -->

- [Summary](#summary)
- [Install](#install)
- [Usage](#usage)

<!-- tocstop -->

## Summary

 * [TypeScript editor playground](https://cancerberosgx.github.io/demos/mirada-ts-playground/). Experience TypeScript code editor with opencv.js TypeScript online with autocomplete, type-checking, online docs, etc.
 * [Video filter demo](https://cancerberosgx.github.io/demos/ojos-demo/videoFilterDemo.html). Filter camera output with many opencv operations real time. Multiple operations can be applied together and their order and parameters can be configured. 
 * Type declarations are generated by [Project doxygen2typescript](../doxygen2typescript/) automatically from opencv doxygen XML documentation output.

## Install

npm i mirada

## Usage

Sorry I don't have docs yet, please take a look to [tests](test). (Working on it)

<!-- mirada / opencv.js don't support image format decoders out of the box so we need to use a library for this. 

The following is a node.js example that uses `jimp` to read and write files from different formats:

```ts
TODO
``` -->

## Reference API

 * [HTML Reference API](https://github.com/cancerberoSgx/demos/tree/master/mirada-opencv-api-md). 
 * [Markdown Reference API ](https://cancerberosgx.github.io/demos/mirada-opencv-api-html/). 


## Extra APIs: project ojos

This project focus on providing type declarations for opencv.js, node.js support, a thin facade for registering image codecs, a thin facade around Mat for easy loading / writing / render from different mediums in node.js and browser. 

But little more. Besides mentioned facades, **this project limits to support existing opencv APIs**, and test both types and implementation works. **It doesn't contain high level APIs or features to keep it simple**. 

Then, the project [ojos](https://www.npmjs.com/package/ojos) provides high level APIs, features and utilities, on top of this project. These are my creation and not present in openCV APIs, some of them just wrappers to existing opencv APIs with defensive checks or defaults, other more elaborated transformations involving several opencv operations. For example, [Video filter demo](https://cancerberosgx.github.io/demos/ojos-demo/videoFilterDemo.html) is based on [ojos](https://www.npmjs.com/package/ojos)


## Command line

See [mirada-cli project page](../mirada-cli).

## TODO
- [ ] cv.CLAHE types
- [ ] move tool and commands to another project
- [ ] docs
- [ ] integrate the new videoCapturer and replace the old one src/browser/videoCapture.ts
- [ ] make a demo with a big canvas , several image editor using http://fabricjs.com/
- [ ] include recording in playgrounds: https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API/Recording_a_media_element
- [ ] make an example FormatProxy for loading svg
- [ ] https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/
- [ ] document std::Vector (http://www.cplusplus.com/reference/vector/vector/)
- [x] the morphing with slide effect but against two different videos ? (like obama and trump speeches and come
  from one to the other and back again with the slider) - see http://overengineer.net/enabling-cors-for-html5-video-element-screenshots
- [x] camera helpers ../mirada-ts-playground/src/examples/toPack/faceDetectionCamera.ts
- [x] ensureDataFile()
- [x] learnopencv.com/non-photorealistic-rendering-using-opencv-python-c/
- [x] don't waste more time manually porting docs. build the doxygen2typescript thing

