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
5f62c34d
Commit
5f62c34d
authored
Nov 19, 2021
by
samesh97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code error fixes and mapped with tools.
parent
c45f3d70
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
109 deletions
+34
-109
app/build.gradle
app/build.gradle
+2
-0
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+16
-11
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
...a/com/app/smartphotoeditor/activities/EditorActivity.java
+15
-0
app/src/main/java/com/app/smartphotoeditor/activities/EnvironmentChecker.java
...m/app/smartphotoeditor/activities/EnvironmentChecker.java
+1
-98
No files found.
app/build.gradle
View file @
5f62c34d
...
...
@@ -108,5 +108,7 @@ dependencies {
implementation
'com.squareup.retrofit2:retrofit:2.1.0'
implementation
'com.squareup.retrofit2:converter-gson:2.1.0'
implementation
(
"com.squareup.okhttp3:okhttp:4.9.2"
)
implementation
'com.squareup.picasso:picasso:2.71828'
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
5f62c34d
...
...
@@ -22,21 +22,16 @@
android:requestLegacyExternalStorage=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.SmartPhotoEditor"
>
<activity
android:name=
".ImageProcessing.Backgroundupload"
></activity>
<activity
android:name=
".ImageProcessing.Splashedit"
/>
<activity
android:name=
".ImageProcessing.Cut"
/>
<activity
android:name=
".ImageProcessing.Blur"
/>
<activity
android:name=
".ImageProcessing.Selectedit"
/>
<!-- <activity android:name=".ImageProcessing.BackgroundCustomization" />-->
android:theme=
"@style/Theme.Design.NoActionBar"
>
<activity
android:name=
".activities.SetupActivity"
/>
<activity
android:name=
".activities.SpeechTest"
/>
<activity
android:name=
".activities.DenoisingActivity"
/>
<activity
android:name=
".activities.MyGallery"
/>
<activity
android:name=
".activities.CropActivity"
/>
<activity
android:name=
".activities.CustomGallery"
/>
<activity
android:name=
".activities.HeadPoseActivity"
/>
<activity
android:name=
".activities.CameraView"
/>
<activity
android:name=
".activities.EnvironmentChecker"
/>
<activity
android:name=
".
ImageProcessing.BackgroundCustomizatio
n"
android:name=
".
activities.SplashScree
n"
android:screenOrientation=
"portrait"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -66,6 +61,16 @@
android:label=
"Save"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ImageProcessing.Backgroundupload"
/>
<activity
android:name=
".ImageProcessing.Splashedit"
/>
<activity
android:name=
".ImageProcessing.Cut"
/>
<activity
android:name=
".ImageProcessing.Blur"
/>
<activity
android:name=
".ImageProcessing.Selectedit"
/>
<activity
android:name=
".ImageProcessing.MedBlur"
/>
<activity
android:name=
".ImageProcessing.BackgroundCustomization"
/>
<activity
android:name=
".ImageProcessing.Bokeh"
/>
<meta-data
android:name=
"com.google.mlkit.vision.DEPENDENCIES"
android:value=
"face"
/>
...
...
app/src/main/java/com/app/smartphotoeditor/activities/EditorActivity.java
View file @
5f62c34d
...
...
@@ -14,6 +14,11 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.app.smartphotoeditor.ImageProcessing.BackgroundCustomization
;
import
com.app.smartphotoeditor.ImageProcessing.Blur
;
import
com.app.smartphotoeditor.ImageProcessing.Bokeh
;
import
com.app.smartphotoeditor.ImageProcessing.MedBlur
;
import
com.app.smartphotoeditor.ImageProcessing.Splashedit
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.adapters.ToolsAdapter
;
import
com.app.smartphotoeditor.config.ImageList
;
...
...
@@ -104,6 +109,16 @@ public class EditorActivity extends AppCompatActivity
intent
=
new
Intent
(
getApplicationContext
(),
RestorationActivity
.
class
);
else
if
(
clickedPos
==
5
)
intent
=
new
Intent
(
getApplicationContext
(),
LowLightEnhanceActivity
.
class
);
else
if
(
clickedPos
==
6
)
intent
=
new
Intent
(
getApplicationContext
(),
MedBlur
.
class
);
else
if
(
clickedPos
==
7
)
intent
=
new
Intent
(
getApplicationContext
(),
BackgroundCustomization
.
class
);
else
if
(
clickedPos
==
8
)
intent
=
new
Intent
(
getApplicationContext
(),
Blur
.
class
);
else
if
(
clickedPos
==
9
)
intent
=
new
Intent
(
getApplicationContext
(),
Bokeh
.
class
);
else
if
(
clickedPos
==
10
)
intent
=
new
Intent
(
getApplicationContext
(),
Splashedit
.
class
);
if
(
intent
!=
null
)
...
...
app/src/main/java/com/app/smartphotoeditor/activities/EnvironmentChecker.java
View file @
5f62c34d
...
...
@@ -192,103 +192,6 @@ public class EnvironmentChecker extends AppCompatActivity implements OnEyeStatus
}
void
markIrisLocation
(
Mat
eye_cropped
)
{
Mat
gray
=
new
Mat
();
//make gray frame
Imgproc
.
cvtColor
(
eye_cropped
,
gray
,
Imgproc
.
COLOR_BGR2GRAY
);
gray
.
convertTo
(
gray
,-
1
,
brightnessLevel
,
0
);
// gray.convertTo(gray,-1,2,0);
//add Blur
Imgproc
.
blur
(
gray
,
gray
,
new
Size
(
11
,
11
));
//Imgproc.GaussianBlur(gray,gray,new Size(11,11),11);
//gray.convertTo(gray,-1,1.1,0);
//Imgproc.Canny(gray,gray,0,120);
//create binary
Mat
binary
=
new
Mat
();
Imgproc
.
threshold
(
gray
,
binary
,
150
,
255
,
Imgproc
.
THRESH_BINARY
);
//find contours
List
<
MatOfPoint
>
contours
=
new
ArrayList
<>();
Mat
hierarchy
=
new
Mat
();
Imgproc
.
findContours
(
binary
,
contours
,
hierarchy
,
Imgproc
.
RETR_TREE
,
Imgproc
.
CHAIN_APPROX_SIMPLE
);
//Collections.sort(contours, Collections.reverseOrder());
if
(
contours
.
size
()
>=
1
)
{
contours
.
remove
(
0
);
}
// now iterate over all top level contours
double
largestContuorArea
=
0
;
int
position
=
0
;
for
(
int
contourIdx
=
0
;
contourIdx
<
contours
.
size
();
contourIdx
++
)
{
Log
.
d
(
"Contour"
,
""
+
contours
.
size
());
double
contourArea
=
Imgproc
.
contourArea
(
contours
.
get
(
contourIdx
));
if
(
largestContuorArea
<
contourArea
)
{
largestContuorArea
=
contourArea
;
position
=
contourIdx
;
}
}
Log
.
d
(
"ContourArea"
,
""
+
largestContuorArea
);
if
(
contours
.
size
()
>
position
)
{
//draw contour
Imgproc
.
drawContours
(
eye_cropped
,
contours
,
position
,
new
Scalar
(
0
,
255
,
0
),
1
);
//draw circle on middle point
Moments
p
=
Imgproc
.
moments
(
contours
.
get
(
position
));
int
x
=
(
int
)
(
p
.
get_m10
()
/
p
.
get_m00
());
int
y
=
(
int
)
(
p
.
get_m01
()
/
p
.
get_m00
());
Imgproc
.
circle
(
eye_cropped
,
new
Point
(
x
,
y
),
4
,
new
Scalar
(
255
,
49
,
0
,
255
));
//draw horizontal and vertical lines to create a cross
Imgproc
.
line
(
eye_cropped
,
new
Point
(
x
-
20
,
y
),
new
Point
(
x
+
20
,
y
),
new
Scalar
(
0
,
255
,
0
));
Imgproc
.
line
(
eye_cropped
,
new
Point
(
x
,
y
-
20
),
new
Point
(
x
,
y
+
20
),
new
Scalar
(
0
,
255
,
0
));
//draw circle in the gray frame
Imgproc
.
circle
(
binary
,
new
Point
(
x
,
y
),
5
,
new
Scalar
(
0
,
0
,
0
,
255
),
10
);
}
Bitmap
grayFrame
=
matToBitmap
(
gray
);
Bitmap
binaryFrame
=
matToBitmap
(
binary
);
Bitmap
croppedOriginalFrame
=
matToBitmap
(
eye_cropped
);
findTheViewPoint
(
binary
);
if
(
isAccessingEnvironment
)
{
accessEnvironment
(
binary
,
contours
.
size
(),
largestContuorArea
);
}
@Override
public
void
onRight
()
{
...
...
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