Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf
Created July 13, 2017 00:14
Show Gist options
  • Save olokobayusuf/9b711c529fdf5475ac9cfbc8bf9a615f to your computer and use it in GitHub Desktop.
Save olokobayusuf/9b711c529fdf5475ac9cfbc8bf9a615f to your computer and use it in GitHub Desktop.
This is an example script that demonstrates using the new OpenCVBehaviour in NatCam Professional 1.6.
using UnityEngine;
using NatCamU.Core;
using NatCamU.Professional;
using OpenCVForUnity;
public class DrawLine : OpenCVBehaviour {
public override void OnMatrix () {
// Draw a diagonal line on our image
Imgproc.line(matrix, new Point(0, 0), new Point(matrix.cols(), matrix.rows()), new Scalar(255, 0, 0, 255), 4);
// Display it
preview.texture = texture;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment