Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AP BUHYARI Ayoub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Ayoub Buhyari
AP BUHYARI Ayoub
Commits
b5afebd6
Commit
b5afebd6
authored
1 year ago
by
Ayoub Buhyari
Browse files
Options
Downloads
Patches
Plain Diff
Update file image_rec.py
parent
e263bc87
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projet/image_rec.py
+71
-0
71 additions, 0 deletions
projet/image_rec.py
with
71 additions
and
0 deletions
projet/image_rec.py
+
71
−
0
View file @
b5afebd6
#ligne de commande
from
algo_rec
import
*
from
enregistrement_lecture_image
import
*
from
Decoupage
import
*
from
PIL
import
*
if
__name__
==
"
__main__
"
:
"""
applique algorithme recurcive a une image selon un ordre et l
'
enregistre dans une nouvelle image
"""
import
sys
if
len
(
sys
.
argv
)
!=
5
:
print
(
"
usage: image_rec.py image ordre nouvelle_image enregistre-png
"
)
else
:
image
,
ordre
,
nouvelle_image
,
mode
=
sys
.
argv
[
1
:]
if
mode
==
"
enregistre-png
"
:
image
=
str
(
image
)
ordre
=
int
(
ordre
)
nouvelle_image
=
str
(
nouvelle_image
)
bloc
=
image_rec
(
image
,
ordre
)
bloc_to_image
(
nouvelle_image
,
bloc
)
if
__name__
==
"
__main__
"
:
""""
Applique un algorithme récursif à une image selon un ordre et l
'
enregistre dans un document CSV.
"""
import
sys
if
len
(
sys
.
argv
)
!=
5
:
print
(
"
usage: image_rec.py image ordre nouveau_fichier_csv enregistre-csv
"
)
else
:
image
,
ordre
,
nouveau_fichier_csv
,
mode
=
sys
.
argv
[
1
:]
if
mode
==
"
enregistre-csv
"
:
image
=
str
(
image
)
ordre
=
int
(
ordre
)
if
ordre
>
0
:
nouveau_fichier_csv
=
str
(
nouveau_fichier_csv
)
bloc
=
image_rec
(
image
,
ordre
)
image_to_csv
([
bloc
],
nouveau_fichier_csv
+
"
.csv
"
)
if
__name__
==
"
__main__
"
:
"""
applique algorithme recurcive a une image selon un ordre l
'
affiche
"""
import
sys
if
len
(
sys
.
argv
)
!=
4
:
print
(
"
usage: image_rec.py image ordre affiche-png
"
)
else
:
image
,
ordre
,
mode
=
sys
.
argv
[
1
:]
if
mode
==
"
affiche-png
"
:
image
=
str
(
image
)
ordre
=
int
(
ordre
)
res
=
image_rec
(
image
,
ordre
)
afficher_liste_blocs
(
res
)
else
:
print
(
"
usage: image_rec.py image ordre affiche-png
"
)
if
__name__
==
"
__main__
"
:
"""
affiche un fichier csv
"""
import
sys
if
len
(
sys
.
argv
)
!=
3
:
print
(
"
usage: image_rec.py fichier_csv affiche-csv
"
)
else
:
fichier_csv
,
mode
=
sys
.
argv
[
1
:]
if
mode
==
"
affiche-csv
"
:
fichier_csv
=
str
(
fichier_csv
)
res
=
cvs_to_blocks
(
fichier_csv
)
afficher_liste_blocs
(
res
)
\ 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