opencv4Android

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

opencv4Android

Somnath Mukherjee
    Hello friends,
                           Please can anybody help me in OpenCV Android..
I stuck specifically how to save Mat in activity.and  switch on torch/fl;ash


I have used several types for saving image through opencv camera after
processing

but it is failed.

Please revert if anybody have experienced ti this area.


   public Mat onCameraFrame(CvCameraViewFrame inputFrame)
{
    mRgba = inputFrame.rgba();
    int maxValue = 255;
    int blockSize = 5;
    int meanOffset = 4;
    Imgproc.adaptiveThreshold(inputFrame.gray(), mIntermediateMat,
maxValue, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, blockSize,
meanOffset);
    Imgproc.cvtColor(mIntermediateMat, mRgba, Imgproc.COLOR_GRAY2RGBA, 4);

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
        String currentDateandTime = sdf.format(new Date());
        String fileName = "Image_"+currentDateandTime + ".jpg";

Imgcodecs.imwrite(fileName,mRgba);

return mRgba;
}





   Thanks & Regards
  Somnath Mukherjee
[hidden email]