Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-81
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
2022-81
2022-81
Commits
e8c778b3
Commit
e8c778b3
authored
Nov 13, 2022
by
P.Y.D Jayasinghe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update WeedMain.java
parent
37679f73
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
4 deletions
+57
-4
app/src/main/java/com/example/eketha/WeedMain.java
app/src/main/java/com/example/eketha/WeedMain.java
+57
-4
No files found.
app/src/main/java/com/example/eketha/WeedMain.java
View file @
e8c778b3
...
...
@@ -38,7 +38,7 @@ public class WeedMain extends AppCompatActivity {
Button
camera
,
gallery
;
ImageView
imageView
;
TextView
result
;
TextView
result
,
solution
;
int
imageSize
=
224
;
@Override
...
...
@@ -49,7 +49,8 @@ public class WeedMain extends AppCompatActivity {
camera
=
findViewById
(
R
.
id
.
btnTakePictureWeed
);
gallery
=
findViewById
(
R
.
id
.
btnLaunchGalleryweed
);
result
=
findViewById
(
R
.
id
.
classifiedWeed
);
solution
=
findViewById
(
R
.
id
.
solutionWeed
);
result
=
findViewById
(
R
.
id
.
resultWeed
);
imageView
=
findViewById
(
R
.
id
.
imageViewWeed
);
camera
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -147,8 +148,60 @@ public class WeedMain extends AppCompatActivity {
// result.setText(classes[maxPos]);
probability
.
sort
(
Comparator
.
comparing
(
Category:
:
getScore
,
Comparator
.
reverseOrder
()));
for
(
int
i
=
0
;
i
<
3
;
i
++)
result
.
setText
(
probability
.
get
(
i
).
getLabel
()
+
" : "
+
probability
.
get
(
i
).
getScore
());
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
result
.
setText
(
probability
.
get
(
i
).
getLabel
());
// +" : " + probability.get(i).getScore());
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Snake Weed"
))
{
solution
.
setText
(
"destock paddocks where snakeweed is a problem promote pasture growth; native pasture is usually not\n"
+
"competitive enough once snakeweed has established"
+
"itself; improved pasture grasses may have to be sown"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Siam Weed"
))
{
solution
.
setText
(
"Applying herbicide at the correct rates, and before flowering, "
+
"will provide effective control if carried out regularly. "
+
"Incorrect application can lead to chemical pruning, which will allow plant to re-shoot."
+
" Always read label before using any herbicide."
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Rubber Vine"
))
{
solution
.
setText
(
"Infestations can be controlled by burning. For best results,"
+
" fuel loads must be prepared and managed before burning,"
+
" and sites must receive follow-up treatment after burning.\n"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Prickly acacia"
))
{
solution
.
setText
(
"Ideal for large areas of scattered to medium-density infestations. "
+
"Wheeled tractors are usually used with a scoop or grubbing attachment. "
+
"This method requires a tractor of around 80hp. "
+
"Trees greater than 15cm in diameter can be difficult to grub out. "
+
"Grubbing is best undertaken May–September or before pod drop.\n"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Parthenium"
))
{
solution
.
setText
(
"Treat small and/or isolated infestations immediately. "
+
"Herbicide control will involve a knockdown herbicide to kill plants that are present"
+
" and a residual herbicide to control future germinations."
+
" Repeated spraying may be required even within a single growing season to prevent"
+
" further seed production"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Parkinsonia"
))
{
solution
.
setText
(
"Aerial application is undertaken by purpose-built\n"
+
"applicators by helicopter. This is useful for dense, strategic\n"
+
"infestations although it may be expensive on a broad scale"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Negative"
))
{
solution
.
setText
(
"Not Recognized"
);
}
else
if
(
probability
.
get
(
i
).
getLabel
().
equalsIgnoreCase
(
"Lantana"
))
{
solution
.
setText
(
"basal bark spraying and cut-stump methods also give good results at any time of "
+
"year (but best when the plant is actively growing). "
+
"On multi-stemmed varieties, obtain best results by "
+
"carefully applying herbicide to each stem"
);
}
else
{
solution
.
setText
(
"Foliar spraying of seedlings and young plants to 2m may be undertaken using "
+
"registered herbicides mixed with water and a wetting agent. "
+
"Thoroughly spray plants to point of run-off when they are actively growing.\n"
);
}
}
// Releases model resources if no longer used.
model
.
close
();
...
...
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