A base project to use computer vision algorithms provided by OpenCV inside the Unity game engine. The plugin was built on MacOS and therefore this project works on either MacOS or as an IOS build. The code for the plugin can be found here. Please refer to the code for details on the implementation.
Saves an image as black and white First we detect the edges of the image. Next, we detect the outer hull and set it as ROI. Finally, rotates, scales and translates an image overlaying it on a new image.For more details on the implementation, please see the code(https://github.com/sonnyky/UnityCvPlugin).
There is no sample image to show, this function will return the similarity value. The lower the better.
Fun fact, OpenCV and Unity has a different axes system, and also RGB order (it's BRG in OpenCV). This is why the input and comparison images are upside down, and the color is wrong. However, the SIFT algorithm is not affected by this and outputs correctly. Only the final matched image was converted to show the correct coloring and orientation.
Check out the plugin code. And make sure to have the bundle in the correct OSX path in Unity. Refer to the project for details.