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
9ea93f93
Commit
9ea93f93
authored
Nov 23, 2021
by
samesh97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning files.
parent
6297cc0f
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
262 additions
and
1150 deletions
+262
-1150
app/src/main/java/com/app/smartphotoeditor/activities/AddEffects.java
.../java/com/app/smartphotoeditor/activities/AddEffects.java
+30
-84
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
...com/app/smartphotoeditor/activities/AdjustBrightness.java
+30
-99
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
...com/app/smartphotoeditor/activities/AdjustSaturation.java
+32
-98
app/src/main/java/com/app/smartphotoeditor/activities/CustomGallery.java
...va/com/app/smartphotoeditor/activities/CustomGallery.java
+0
-8
app/src/main/java/com/app/smartphotoeditor/activities/DenoisingActivity.java
...om/app/smartphotoeditor/activities/DenoisingActivity.java
+30
-82
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
...a/com/app/smartphotoeditor/activities/EditorActivity.java
+29
-11
app/src/main/java/com/app/smartphotoeditor/activities/HeadPoseActivity.java
...com/app/smartphotoeditor/activities/HeadPoseActivity.java
+0
-450
app/src/main/java/com/app/smartphotoeditor/activities/LowLightEnhanceActivity.java
.../smartphotoeditor/activities/LowLightEnhanceActivity.java
+30
-96
app/src/main/java/com/app/smartphotoeditor/activities/RestorationActivity.java
.../app/smartphotoeditor/activities/RestorationActivity.java
+30
-96
app/src/main/java/com/app/smartphotoeditor/activities/SpeechTest.java
.../java/com/app/smartphotoeditor/activities/SpeechTest.java
+0
-126
app/src/main/res/layout/activity_adjust_brightness.xml
app/src/main/res/layout/activity_adjust_brightness.xml
+10
-0
app/src/main/res/layout/activity_adjust_saturation.xml
app/src/main/res/layout/activity_adjust_saturation.xml
+10
-0
app/src/main/res/layout/activity_denoising.xml
app/src/main/res/layout/activity_denoising.xml
+10
-0
app/src/main/res/layout/activity_low_light_enhance.xml
app/src/main/res/layout/activity_low_light_enhance.xml
+11
-0
app/src/main/res/layout/activity_restoration.xml
app/src/main/res/layout/activity_restoration.xml
+10
-0
No files found.
app/src/main/java/com/app/smartphotoeditor/activities/AddEffects.java
View file @
9ea93f93
...
...
@@ -74,8 +74,6 @@ public class AddEffects extends AppCompatActivity
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
View
lastLookedView
=
null
;
private
ComputerVision
computerVision
;
...
...
@@ -317,80 +315,6 @@ public class AddEffects extends AppCompatActivity
});
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
public
void
opened
()
{
...
...
@@ -407,21 +331,43 @@ public class AddEffects extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary,int x, int y,int range,int pupilX)
// {
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
View file @
9ea93f93
...
...
@@ -40,12 +40,8 @@ public class AdjustBrightness extends AppCompatActivity
float
brightnessValue
=
0.0f
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
TickSeekBar
seekBar
;
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
...
...
@@ -162,93 +158,6 @@ public class AdjustBrightness extends AppCompatActivity
}
Back
(
null
);
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
...
...
@@ -265,21 +174,43 @@ public class AdjustBrightness extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
View file @
9ea93f93
...
...
@@ -3,7 +3,6 @@ package com.app.smartphotoeditor.activities;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.ImageView
;
...
...
@@ -40,11 +39,8 @@ public class AdjustSaturation extends AppCompatActivity
float
saturationLevel
=
0.0f
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
TickSeekBar
seekBar
;
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
...
...
@@ -159,92 +155,6 @@ public class AdjustSaturation extends AppCompatActivity
}
Back
(
null
);
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
...
...
@@ -261,19 +171,43 @@ public class AdjustSaturation extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
@Override
public
void
eyeLeft
(
Mat
mat
)
{
}
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/CustomGallery.java
View file @
9ea93f93
...
...
@@ -350,22 +350,14 @@ public class CustomGallery extends AppCompatActivity implements
});
}
// @Override
// public void onPupilChanged(Mat binary,int x, int y,int range,int pupilX)
// {
// setPreviewFrame(binary);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
//setPreviewFrame(mat);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
//setPreviewFrame(mat);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/DenoisingActivity.java
View file @
9ea93f93
...
...
@@ -56,10 +56,7 @@ public class DenoisingActivity extends AppCompatActivity
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
@Override
...
...
@@ -218,78 +215,6 @@ public class DenoisingActivity extends AppCompatActivity
}
Back
(
null
);
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
public
void
opened
()
{
...
...
@@ -306,20 +231,43 @@ public class DenoisingActivity extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
View file @
9ea93f93
...
...
@@ -530,25 +530,43 @@ public class EditorActivity extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary,int x, int y,int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
viewsInDisplay
.
get
(
1
).
setBackgroundColor
(
Color
.
RED
);
viewsInDisplay
.
get
(
0
).
setBackgroundColor
(
Color
.
BLACK
);
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
viewsInDisplay
.
get
(
0
).
setBackgroundColor
(
Color
.
RED
);
viewsInDisplay
.
get
(
1
).
setBackgroundColor
(
Color
.
BLACK
);
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/HeadPoseActivity.java
deleted
100644 → 0
View file @
6297cc0f
This diff is collapsed.
Click to expand it.
app/src/main/java/com/app/smartphotoeditor/activities/LowLightEnhanceActivity.java
View file @
9ea93f93
...
...
@@ -79,10 +79,7 @@ public class LowLightEnhanceActivity extends AppCompatActivity
private
EqualizeHistogram
equalizeHistogram
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
...
...
@@ -257,93 +254,6 @@ public class LowLightEnhanceActivity extends AppCompatActivity
revertButton
.
setText
(
"TURN OFF"
);
}
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
...
...
@@ -360,20 +270,44 @@ public class LowLightEnhanceActivity extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/RestorationActivity.java
View file @
9ea93f93
...
...
@@ -50,10 +50,7 @@ public class RestorationActivity extends AppCompatActivity
private
Handler
handler
=
null
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
...
...
@@ -218,93 +215,6 @@ public class RestorationActivity extends AppCompatActivity
}
Back
(
null
);
}
void
findViewPoint
(
int
x
,
int
y
)
{
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
view
.
setBackgroundColor
(
Color
.
RED
);
cursor
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
cursor
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
...
...
@@ -321,20 +231,44 @@ public class RestorationActivity extends AppCompatActivity
}
// @Override
// public void onPupilChanged(Mat binary, int x, int y, int range, int pupilX) {
//
// findViewPoint(x,y);
// }
@Override
public
void
eyeLeft
(
Mat
mat
)
{
public
void
eyeLeft
(
Mat
mat
)
{
moveCursor
(
1
);
}
@Override
public
void
eyeRight
(
Mat
mat
)
{
moveCursor
(
0
);
}
public
void
moveCursor
(
int
pos
)
{
View
selectedView
=
viewsInDisplay
.
get
(
pos
);
for
(
View
view
:
viewsInDisplay
)
{
if
(
selectedView
==
view
)
{
view
.
setBackgroundColor
(
Color
.
RED
);
continue
;
}
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
int
[]
location
=
new
int
[
2
];
selectedView
.
getLocationOnScreen
(
location
);
int
x
=
location
[
0
];
int
y
=
location
[
1
];
ImageView
cursor
=
findViewById
(
R
.
id
.
cursor
);
cursor
.
animate
().
x
(
x
);
cursor
.
animate
().
y
(
y
);
}
@Override
...
...
app/src/main/java/com/app/smartphotoeditor/activities/SpeechTest.java
deleted
100644 → 0
View file @
6297cc0f
package
com.app.smartphotoeditor.activities
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.core.app.ActivityCompat
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.pm.PackageManager
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.speech.RecognitionListener
;
import
android.speech.RecognizerIntent
;
import
android.speech.SpeechRecognizer
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.services.MyService
;
import
java.util.ArrayList
;
import
static
android
.
Manifest
.
permission
.
RECORD_AUDIO
;
public
class
SpeechTest
extends
AppCompatActivity
{
private
SpeechRecognizer
speechRecognizer
;
//private Intent intentRecognizer;
//private TextView textView;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_speech_test
);
ActivityCompat
.
requestPermissions
(
this
,
new
String
[]{
RECORD_AUDIO
},
PackageManager
.
PERMISSION_GRANTED
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
Intent
.
ACTION_BOOT_COMPLETED
);
registerReceiver
(
new
BroadcastReceiver
()
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
Toast
.
makeText
(
context
,
"Hello"
,
Toast
.
LENGTH_SHORT
).
show
();
}
},
filter
);
startForegroundService
(
new
Intent
(
SpeechTest
.
this
,
MyService
.
class
));
}
else
{
startService
(
new
Intent
(
SpeechTest
.
this
,
MyService
.
class
));
}
// textView = findViewById(R.id.textView);
// intentRecognizer = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
// intentRecognizer.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
//
// speechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);
// speechRecognizer.setRecognitionListener(new RecognitionListener() {
// @Override
// public void onReadyForSpeech(Bundle bundle) {
//
// }
//
// @Override
// public void onBeginningOfSpeech() { }
//
// @Override
// public void onRmsChanged(float v) { }
//
// @Override
// public void onBufferReceived(byte[] bytes) {
//
// }
//
// @Override
// public void onEndOfSpeech() { }
//
// @Override
// public void onError(int i) { }
//
// @Override
// public void onResults(Bundle bundle) {
//
// ArrayList<String> matches = bundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
// String string = "";
// if(matches!=null)
// {
// string = matches.get(0);
// textView.setText(string);
// speechRecognizer.startListening(intentRecognizer);
// }
// }
//
// @Override
// public void onPartialResults(Bundle bundle) {
//
// }
//
// @Override
// public void onEvent(int i, Bundle bundle)
// {
//
// }
// });
// speechRecognizer.startListening(intentRecognizer);
}
// public void Enable(View view)
// {
// speechRecognizer.startListening(intentRecognizer);
// }
//
// public void Disable(View view)
// {
// speechRecognizer.stopListening();
// }
}
\ No newline at end of file
app/src/main/res/layout/activity_adjust_brightness.xml
View file @
9ea93f93
...
...
@@ -151,4 +151,14 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
<ImageView
android:id=
"@+id/cursor"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/cursor"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_adjust_saturation.xml
View file @
9ea93f93
...
...
@@ -151,4 +151,14 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
<ImageView
android:id=
"@+id/cursor"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/cursor"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_denoising.xml
View file @
9ea93f93
...
...
@@ -128,4 +128,14 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
<ImageView
android:id=
"@+id/cursor"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/cursor"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_low_light_enhance.xml
View file @
9ea93f93
...
...
@@ -145,4 +145,15 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
<ImageView
android:id=
"@+id/cursor"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/cursor"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_restoration.xml
View file @
9ea93f93
...
...
@@ -129,4 +129,14 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
<ImageView
android:id=
"@+id/cursor"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:src=
"@drawable/cursor"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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