Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-129
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-129
2021-129
Commits
75d0f21f
Commit
75d0f21f
authored
Nov 21, 2021
by
samesh97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes.
parent
cd37681a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
10 deletions
+33
-10
app/src/main/java/com/app/smartphotoeditor/activities/CustomGallery.java
...va/com/app/smartphotoeditor/activities/CustomGallery.java
+3
-3
app/src/main/java/com/app/smartphotoeditor/services/ComputerVision.java
...ava/com/app/smartphotoeditor/services/ComputerVision.java
+17
-5
app/src/main/java/com/app/smartphotoeditor/vision/FacialLandmarkDetection.java
.../app/smartphotoeditor/vision/FacialLandmarkDetection.java
+13
-2
No files found.
app/src/main/java/com/app/smartphotoeditor/activities/CustomGallery.java
View file @
75d0f21f
...
...
@@ -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
...
...
app/src/main/java/com/app/smartphotoeditor/services/ComputerVision.java
View file @
75d0f21f
...
...
@@ -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
);
...
...
app/src/main/java/com/app/smartphotoeditor/vision/FacialLandmarkDetection.java
View file @
75d0f21f
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment