Commit 75d0f21f authored by samesh97's avatar samesh97

changes.

parent cd37681a
......@@ -100,7 +100,7 @@ public class CustomGallery extends AppCompatActivity implements
public void updated(Mat rgba,Mat previewMat)
{
computerVision.setMat(rgba);
//setPreviewFrame(previewMat);
setPreviewFrame(previewMat);
}
}).initialize();
......@@ -359,13 +359,13 @@ public class CustomGallery extends AppCompatActivity implements
@Override
public void eyeLeft(Mat mat) {
setPreviewFrame(mat);
//setPreviewFrame(mat);
}
@Override
public void eyeRight(Mat mat) {
setPreviewFrame(mat);
//setPreviewFrame(mat);
}
@Override
......
......@@ -94,6 +94,15 @@ public class ComputerVision
{
Bitmap bitmap = Methods.matToBit(mat);
try
{
Methods.saveImage(activity.getApplicationContext(),bitmap,"Idle");
}
catch (IOException e)
{
e.printStackTrace();
}
gestureDetection.detectGestures(bitmap);
}
......@@ -102,11 +111,14 @@ public class ComputerVision
{
Bitmap bitmap = Methods.matToBit(mat);
// try {
// Methods.saveImage(activity.getApplicationContext(),bitmap,"NewEyeClose");
// } catch (IOException e) {
// e.printStackTrace();
// }
try
{
Methods.saveImage(activity.getApplicationContext(),bitmap,"EyeOpen");
}
catch (IOException e)
{
e.printStackTrace();
}
if(eyeBlinkDetection != null)
eyeBlinkDetection.detectEyeBlinkState(bitmap);
......
......@@ -416,15 +416,24 @@ public class FacialLandmarkDetection
} catch (Exception e) { }
}
public Mat setDefaultValues(Mat srcMat)
{
public Mat setDefaultValues(Mat srcMat) {
// final Bitmap bitmap = Bitmap.createBitmap(srcMat.clone().width(), srcMat.clone().height(), Bitmap.Config.ARGB_8888);
Imgproc.cvtColor(srcMat, srcMat, Imgproc.COLOR_BGR2GRAY, 0);
Mat srcMat1 = srcMat;
Imgproc.GaussianBlur(srcMat1, srcMat1, new Size(1, 1), 0);
//Mat srcMat1 = new Mat(srcMat.rows(), srcMat.cols(), CV_8UC1);
//int kernalsize = 3;
//Imgproc.bilateralFilter(srcMat, srcMat1, kernalsize, kernalsize * 2, kernalsize / 2);
srcMat1.convertTo(srcMat1, 0, 1.9, 1);
srcMat1.convertTo(srcMat1, CvType.CV_8U, 1.9, -255);
//Imgproc.cvtColor(srcMat1, srcMat1, Imgproc.COLOR_GRAY2RGBA, 4);
int whiteCount = 0;
int leftWhiteCount = 0;
......@@ -475,8 +484,10 @@ public class FacialLandmarkDetection
Log.d("cccccccccccccccc","left looked");
listener.onPupilChanged(srcMat1,true,false);
}
// Log.d("cccccccccccccccc","" + leftWhiteCount + "-" + rightWhiteCount);
}
return srcMat;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment