Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Augmented Reality Chemistry Laboratory
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
1
Merge Requests
1
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-189
Augmented Reality Chemistry Laboratory
Commits
2f3242c1
Commit
2f3242c1
authored
Jul 05, 2021
by
Charuka_IT18114454
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change preprocess system and preprocess vales.
parent
f6f14a6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
app/src/main/java/com/example/archemistrylab/ImageProcessing/ImageProcess.java
.../example/archemistrylab/ImageProcessing/ImageProcess.java
+1
-1
app/src/main/python/preprosessgreyscale.py
app/src/main/python/preprosessgreyscale.py
+6
-4
No files found.
app/src/main/java/com/example/archemistrylab/ImageProcessing/ImageProcess.java
View file @
2f3242c1
...
...
@@ -215,7 +215,7 @@ public class ImageProcess extends AppCompatActivity {
e
.
printStackTrace
();
}
tessBaseAPI
.
init
(
FinalPathToTESS_BASE_API
,
"eng"
);
tessBaseAPI
.
setVariable
(
TessBaseAPI
.
VAR_CHAR_WHITELIST
,
"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY
zZ1234567890',.?;/=>+
"
);
tessBaseAPI
.
setVariable
(
TessBaseAPI
.
VAR_CHAR_WHITELIST
,
"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyY
Z2346789+-=>
"
);
tessBaseAPI
.
setImage
(
bitmap
);
String
retStr
=
"No Result"
;
try
{
...
...
app/src/main/python/preprosessgreyscale.py
View file @
2f3242c1
...
...
@@ -10,7 +10,8 @@ def main(data):
np_data
=
np
.
fromstring
(
decoded_data
,
np
.
uint8
)
img
=
cv2
.
imdecode
(
np_data
,
cv2
.
IMREAD_UNCHANGED
)
img
=
cv2
.
resize
(
img
,
(
100
,
100
))
img
=
cv2
.
resize
(
img
,
None
,
fx
=
2
,
fy
=
2
,
interpolation
=
cv2
.
INTER_AREA
)
img_gray
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2GRAY
)
...
...
@@ -20,7 +21,7 @@ def main(data):
pil_im
=
cv2
.
morphologyEx
(
pil_im
,
cv2
.
MORPH_OPEN
,
kernel
)
#
pil_im = cv2.morphologyEx(pil_im, cv2.MORPH_CLOSE, kernel)
#
pil_im = cv2.morphologyEx(pil_im, cv2.MORPH_CLOSE, kernel)
#pil_im = ImageEnhance.Brightness(pil_im)
...
...
@@ -33,10 +34,11 @@ def main(data):
#image = Image.open(np_data)
#pil_im = ImageEnhance.Contrast(image)
pil_im
=
cv2
.
GaussianBlur
(
pil_im
,(
5
,
5
),
0
)
#pil_im = cv2.bilateralFilter(img, 15, 75, 75)
pil_im
=
cv2
.
GaussianBlur
(
pil_im
,(
9
,
9
),
9
)
pil_im
=
cv2
.
medianBlur
(
pil_im
,
5
)
pil_im
=
cv2
.
adaptiveThreshold
(
pil_im
,
255
,
cv2
.
ADAPTIVE_THRESH_GAUSSIAN_C
,
cv2
.
THRESH_BINARY
,
11
,
2
)
pil_im
=
cv2
.
adaptiveThreshold
(
pil_im
,
255
,
cv2
.
ADAPTIVE_THRESH_GAUSSIAN_C
,
cv2
.
THRESH_BINARY
,
77
,
10
)
...
...
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