Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import com.cycling74.max.*;
  2. import org.opencv.core.Core;
  3. import org.opencv.core.CvType;
  4. import org.opencv.core.Mat;
  5. import org.opencv.core.Scalar;
  6.  
  7. public class TestOpenCV extends MaxObject {
  8.   static { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
  9.  
  10.   public TestOpenCV(Atom[] args)
  11.   {
  12.     declareInlets(new int[]{DataTypes.ALL});
  13.     declareOutlets(new int[]{DataTypes.ALL});  
  14.   }
  15.  
  16.   public void bang() {
  17.     Mat m = new Mat(5, 9, CvType.CV_8UC4, new Scalar(0));
  18.     Mat mr1 = m.row(1);
  19.     mr1.setTo(new Scalar(1));
  20.     Mat mc5 = m.col(3);
  21.     mc5.setTo(new Scalar(5));
  22.     post("OpenCV Mat data:\n" + m.dump());
  23.   }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement