Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Code Computer Vision
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PolySTAR
RoboMaster
Computer Vision
Code Computer Vision
Commits
63750f07
Commit
63750f07
authored
4 years ago
by
Yasmine Moumou
Browse files
Options
Downloads
Patches
Plain Diff
[robots@robots](armor-lines) Fix import error
parent
874f9623
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
robots-at-robots/research/robots_at_robots/dataset/armor_lines_detector.py
+18
-11
18 additions, 11 deletions
...research/robots_at_robots/dataset/armor_lines_detector.py
with
18 additions
and
11 deletions
robots-at-robots/research/robots_at_robots/dataset/armor_lines_detector.py
+
18
−
11
View file @
63750f07
...
...
@@ -7,9 +7,7 @@ from polystar.common.models.image import Image
from
polystar.common.models.image_annotation
import
ImageAnnotation
from
research.common.dataset.twitch.twitch_roco_datasets
import
TwitchROCODataset
#from ..armor_dataset_factory import
#research.robots_at_robots.dataset.armor_dataset_factory import ArmorDatasetFactory ?? Will not find ArmorDatasetFactory
#from ..code/robots-at-robots/research/robots_at_robots/dataset/armor_dataset_factory.py import ArmorDatasetFactory
from
research.robots_at_robots.dataset.armor_dataset_factory
import
ArmorDatasetFactory
class
ArmorLinesDetector
:
...
...
@@ -43,15 +41,24 @@ class ArmorLinesDetector:
if
__name__
==
"
__main__
"
:
lineDetector
=
ArmorLinesDetector
()
armor_lines
=
[]
for
i
,
(
armor_img
,
armor
,
k
,
p
)
in
enumerate
(
ArmorDatasetFactory
.
from_dataset
(
TwitchROCODataset
.
TWITCH_470158483
)):
armor_lines
[
i
]
=
lineDetector
.
detect_lines
(
armor_img
)
# test = cv2.imread('test.png') # ouverture
# test = cv2.cvtColor(test, cv2.COLOR_BGR2RGB) # conversion des couleurs
# armor_lines = lineDetector.detect_lines(test)
# plt.imshow(armor_lines[7], cmap='gray')
# plt.title('50 lignes principales')
# plt.show()
for
armor
in
enumerate
(
armor_lines
):
plt
.
imshow
(
armor
)
plt
.
show
()
plt
.
clf
()
#for i, (armor_img, armor, k, p) in enumerate(ArmorDatasetFactory.from_dataset(TwitchROCODataset.TWITCH_470158483)):
# armor_lines = lineDetector.detect_lines(armor_img)
test
=
cv2
.
imread
(
'
test.png
'
)
# ouverture
test
=
cv2
.
cvtColor
(
test
,
cv2
.
COLOR_BGR2RGB
)
# conversion des couleurs
armor_lines
=
lineDetector
.
detect_lines
(
test
)
plt
.
imshow
(
armor_lines
,
cmap
=
'
gray
'
)
plt
.
title
(
'
50 lignes principales
'
)
plt
.
show
()
\ No newline at end of file
if
i
==
5
:
break
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment