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
743e1cc3
Commit
743e1cc3
authored
1 year ago
by
Kinadinova Dariya
Browse files
Options
Downloads
Patches
Plain Diff
liste_col
parent
6735258c
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/Decouper_Image.py
+7
-5
7 additions, 5 deletions
projet/Decouper_Image.py
projet/color.py
+3
-13
3 additions, 13 deletions
projet/color.py
with
10 additions
and
18 deletions
projet/Decouper_Image.py
+
7
−
5
View file @
743e1cc3
from
PIL
import
Image
,
ImageDraw
# im = Image.open("calbuth.png")
# im_rgb = im.convert('RGB')
def
decouper
(
im
:
Image
,
file
:
str
)
:
"""
à_remplacer_par_ce_que_fait_la_fonction
def
decouper
(
file
:
str
)
->
list
[
Image
]
:
"""
splits image into four blocks
Précondition :
Exemple(s) :
...
...
@@ -23,4 +21,8 @@ def decouper(im: Image, file: str):
crop3
=
(
0
,
(
h
//
2
),
(
w
//
2
),
h
)
block_3
=
im
.
crop
(
crop3
)
crop4
=
((
h
//
2
),
(
w
//
2
),
h
,
w
)
block_4
=
im
.
crop
(
crop4
)
\ No newline at end of file
block_4
=
im
.
crop
(
crop4
)
l
=
[
block_1
,
block_2
,
block_3
,
block_4
]
return
l
This diff is collapsed.
Click to expand it.
projet/color.py
+
3
−
13
View file @
743e1cc3
...
...
@@ -28,23 +28,13 @@ def avg_col(l:list[int]) -> list[int]:
avg3
=
c3
/
n_col
return
(
avg1
,
avg2
,
avg3
)
def
is
_close
(
c1
:
int
,
c2
:
int
,
seuil
:
int
)
->
bool
:
"""
savoir si deux couleurs sont proches
def
l
is
te_col
(
im
:
Image
,
left_top
:
tuple
(
int
)
,
right_bottom
:
tuple
(
int
)
)
->
list
[
int
]
:
"""
à_remplacer_par_ce_que_fait_la_fonction
Précondition :
Exemple(s) :
$$$
"""
dist_2
=
0
for
i
in
range
(
3
):
dist_2
=
dist_2
+
(
c1
[
i
]
-
c2
[
i
])
**
2
distance
=
dist_2
**
0.5
return
distance
<
seuil
\ No newline at end of file
\ 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