Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.cycling74.max.*;
- import org.opencv.core.Core;
- import org.opencv.core.CvType;
- import org.opencv.core.Mat;
- import org.opencv.core.Scalar;
- public class TestOpenCV extends MaxObject {
- static { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }
- public TestOpenCV(Atom[] args)
- {
- declareInlets(new int[]{DataTypes.ALL});
- declareOutlets(new int[]{DataTypes.ALL});
- }
- public void bang() {
- Mat m = new Mat(5, 9, CvType.CV_8UC4, new Scalar(0));
- Mat mr1 = m.row(1);
- mr1.setTo(new Scalar(1));
- Mat mc5 = m.col(3);
- mc5.setTo(new Scalar(5));
- post("OpenCV Mat data:\n" + m.dump());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement