FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
opencv_tutorials/python/code_075/opencv_075.py at master · HZHCoder1990/opencv_tutorials · GitHub
HZHCoder1990
/
opencv_tutorials
Public
forked from
JimmyHHua/opencv_tutorials
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
opencv_tutorials
/
python
/
code_075
/
opencv_075.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (16 loc) · 487 Bytes
Breadcrumbs
opencv_tutorials
/
python
/
code_075
/
opencv_075.py
Copy path
File metadata and controls
18 lines (16 loc) · 487 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import
cv2
as
cv
src
=
cv
.
imread
(
"master2.jpg"
)
cv
.
imshow
(
"watermark image"
,
src
)
# 提取划痕
hsv
=
cv
.
cvtColor
(
src
,
cv
.
COLOR_BGR2HSV
)
mask
=
cv
.
inRange
(
hsv
, (
100
,
43
,
46
), (
124
,
255
,
255
))
cv
.
imshow
(
"mask"
,
mask
)
cv
.
imwrite
(
"mask.png"
,
mask
)
# 消除
se
=
cv
.
getStructuringElement
(
cv
.
MORPH_RECT
, (
5
,
5
))
mask
=
cv
.
dilate
(
mask
,
se
)
result
=
cv
.
inpaint
(
src
,
mask
,
3
,
cv
.
INPAINT_TELEA
)
cv
.
imshow
(
"result"
,
result
)
cv
.
imwrite
(
"result.png"
,
result
)
cv
.
waitKey
(
0
)
cv
.
destroyAllWindows
()
Back
|
FazBrowse Home
|
New Git URL