Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

there are 2 problems:

  1. the Mat you draw to needs to have a size and a type, a simple new Mat() won't do.
  2. if you import java.awt classes, there will be ambiguities for things like Point, Rect, List (remember that ?) and such, you need to explicitly specify, what you mean:

Mat ocv = new Mat(400,400,16,Scalar.all(127));
Imgproc.putText(ocv, "Original Image",
                new org.opencv.core.Point(ocv.cols() / 4, ocv.rows() / 2),
                Core.FONT_HERSHEY_COMPLEX, 1, new Scalar(255, 255, 255));

image description