Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

putText not working for video frame

 Mat m = new Mat (720, 1280, CvType.CV_8UC4);
m.put(0,0,vf.rawData.getBytes());
Imgproc.putText(m, "Welcomeeeeeeeeeeeeeee", new org.opencv.core.Point(400,400),
  Core.FONT_HERSHEY_PLAIN, 1.0 ,new Scalar(255,0,0));
//byte[] buffer = new byte[((int)m.total())*m.channels()];
byte[] buffer = new byte[vf.rawData.getBytes().length];
m.get(0,0,buffer);
FileOutputStream fos = new FileOutputStream("C:/Users/h130954/images/Image-" + BAbsTime.now().getTimeOfDayMillis() +".jpg");
        fos.write(buffer);
        fos.close();