Commit 75d0f21f authored by samesh97's avatar samesh97

changes.

parent cd37681a
...@@ -100,7 +100,7 @@ public class CustomGallery extends AppCompatActivity implements ...@@ -100,7 +100,7 @@ public class CustomGallery extends AppCompatActivity implements
public void updated(Mat rgba,Mat previewMat) public void updated(Mat rgba,Mat previewMat)
{ {
computerVision.setMat(rgba); computerVision.setMat(rgba);
//setPreviewFrame(previewMat); setPreviewFrame(previewMat);
} }
}).initialize(); }).initialize();
...@@ -359,13 +359,13 @@ public class CustomGallery extends AppCompatActivity implements ...@@ -359,13 +359,13 @@ public class CustomGallery extends AppCompatActivity implements
@Override @Override
public void eyeLeft(Mat mat) { public void eyeLeft(Mat mat) {
setPreviewFrame(mat); //setPreviewFrame(mat);
} }
@Override @Override
public void eyeRight(Mat mat) { public void eyeRight(Mat mat) {
setPreviewFrame(mat); //setPreviewFrame(mat);
} }
@Override @Override
......
...@@ -94,6 +94,15 @@ public class ComputerVision ...@@ -94,6 +94,15 @@ public class ComputerVision
{ {
Bitmap bitmap = Methods.matToBit(mat); Bitmap bitmap = Methods.matToBit(mat);
try
{
Methods.saveImage(activity.getApplicationContext(),bitmap,"Idle");
}
catch (IOException e)
{
e.printStackTrace();
}
gestureDetection.detectGestures(bitmap); gestureDetection.detectGestures(bitmap);
} }
...@@ -102,11 +111,14 @@ public class ComputerVision ...@@ -102,11 +111,14 @@ public class ComputerVision
{ {
Bitmap bitmap = Methods.matToBit(mat); Bitmap bitmap = Methods.matToBit(mat);
// try { try
// Methods.saveImage(activity.getApplicationContext(),bitmap,"NewEyeClose"); {
// } catch (IOException e) { Methods.saveImage(activity.getApplicationContext(),bitmap,"EyeOpen");
// e.printStackTrace(); }
// } catch (IOException e)
{
e.printStackTrace();
}
if(eyeBlinkDetection != null) if(eyeBlinkDetection != null)
eyeBlinkDetection.detectEyeBlinkState(bitmap); eyeBlinkDetection.detectEyeBlinkState(bitmap);
......
...@@ -416,15 +416,24 @@ public class FacialLandmarkDetection ...@@ -416,15 +416,24 @@ public class FacialLandmarkDetection
} catch (Exception e) { } } 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); Imgproc.cvtColor(srcMat, srcMat, Imgproc.COLOR_BGR2GRAY, 0);
Mat srcMat1 = srcMat; Mat srcMat1 = srcMat;
Imgproc.GaussianBlur(srcMat1, srcMat1, new Size(1, 1), 0); 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, 0, 1.9, 1);
srcMat1.convertTo(srcMat1, CvType.CV_8U, 1.9, -255); srcMat1.convertTo(srcMat1, CvType.CV_8U, 1.9, -255);
//Imgproc.cvtColor(srcMat1, srcMat1, Imgproc.COLOR_GRAY2RGBA, 4);
int whiteCount = 0; int whiteCount = 0;
int leftWhiteCount = 0; int leftWhiteCount = 0;
...@@ -475,8 +484,10 @@ public class FacialLandmarkDetection ...@@ -475,8 +484,10 @@ public class FacialLandmarkDetection
Log.d("cccccccccccccccc","left looked"); Log.d("cccccccccccccccc","left looked");
listener.onPupilChanged(srcMat1,true,false); listener.onPupilChanged(srcMat1,true,false);
} }
// Log.d("cccccccccccccccc","" + leftWhiteCount + "-" + rightWhiteCount);
} }
return srcMat; 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