Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AP-KINADINOVA-Dariya
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
Dariya Kinadinova
AP-KINADINOVA-Dariya
Commits
1401ac80
Commit
1401ac80
authored
1 year ago
by
Dariya Kinadinova
Browse files
Options
Downloads
Patches
Plain Diff
name change
parent
0df31b29
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projet/codes/block.py
+3
-3
3 additions, 3 deletions
projet/codes/block.py
projet/codes/image_rec.py
+2
-2
2 additions, 2 deletions
projet/codes/image_rec.py
with
5 additions
and
5 deletions
projet/codes/block.py
+
3
−
3
View file @
1401ac80
...
...
@@ -23,7 +23,7 @@ class Block:
$$$ bloc2 = Block(True, (255, 198, 240))
$$$ bloc3 = Block(True, (247, 185, 245))
$$$ bloc4 = Block(True, (235, 179, 245))
$$$ bloc1.are_4_
uniform
(bloc2, bloc3, bloc4)
$$$ bloc1.are_4_
close
(bloc2, bloc3, bloc4)
True
$$$ bloc1.get_average_color(bloc2, bloc3, bloc4)
(244, 187, 246)
...
...
@@ -45,8 +45,8 @@ class Block:
self
.
lower_left_block
=
args
[
3
]
self
.
lower_right_block
=
args
[
4
]
def
are_4_
uniform
(
self
,
block2
:
'
Block
'
,
block3
:
'
Block
'
,
block4
:
'
Block
'
)
->
bool
:
"""
Vérifiez si quatre blocs différents sont
uniform
es.
def
are_4_
close
(
self
,
block2
:
'
Block
'
,
block3
:
'
Block
'
,
block4
:
'
Block
'
)
->
bool
:
"""
Vérifiez si
les couleurs de
quatre blocs différents sont
proch
es.
Précondition : doit fournir 3 blocs en plus du premier bloc
Exemple(s) :
...
...
This diff is collapsed.
Click to expand it.
projet/codes/image_rec.py
+
2
−
2
View file @
1401ac80
...
...
@@ -33,8 +33,8 @@ def rec_algorithm(image: Image, order:int) -> 'Block':
for
block
in
blocks
:
# executer l'algorithme sur chaque sous-bloc en diminuant l'ordre de 1
rec_blocks
.
append
(
rec_algorithm
(
block
,
order
-
1
))
if
rec_blocks
[
0
].
are_4_
uniform
(
rec_blocks
[
1
],
rec_blocks
[
2
],
rec_blocks
[
3
]):
# si les quatre blocs sont uniforms, alors creer un bloc uniforme de couleur \
if
rec_blocks
[
0
].
are_4_
close
(
rec_blocks
[
1
],
rec_blocks
[
2
],
rec_blocks
[
3
]):
# si les quatre blocs sont uniforms
et proches
, alors creer un bloc uniforme de couleur \
# la couleur moyenne des quatre blocs
res
=
Block
(
True
,
rec_blocks
[
0
].
get_average_color
(
rec_blocks
[
1
],
rec_blocks
[
2
],
\
rec_blocks
[
3
]))
...
...
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