Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Image-Editor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Marc Feger
Image-Editor
Commits
34d41bc7
Commit
34d41bc7
authored
6 years ago
by
Marc Feger
Browse files
Options
Downloads
Patches
Plain Diff
Remove wrong file of example images
parent
c633cf62
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
images/Example/White_Plain_In_White_Sky/Laplacian.py
+0
-40
0 additions, 40 deletions
images/Example/White_Plain_In_White_Sky/Laplacian.py
with
0 additions
and
40 deletions
images/Example/White_Plain_In_White_Sky/Laplacian.py
deleted
100644 → 0
+
0
−
40
View file @
c633cf62
from
tokenize
import
String
from
skimage
import
io
from
pixel
import
*
class
Editor
(
object
):
def
__init__
(
self
,
origin_path
:
String
,
edit_path
:
String
):
"""
This class is the editor which edits a given image and stores a new one.
:param origin_path: The original image which should be edited.
:param edit_path: The edited image which should be stored.
"""
self
.
image_path
=
origin_path
self
.
edit_path
=
edit_path
def
do_convolution_with
(
self
,
option
:
String
)
->
None
:
"""
This method iterates over the image and changes each pixel by a given method.
Notice, that the image must be a RGB-image (MxNx3).
:param option: The options defined in FILTER.
:return: None
"""
image
=
io
.
imread
(
fname
=
self
.
image_path
)
height
,
width
,
_
=
image
.
shape
# len(image), len(image[0, 0:, 0:]) wont work for .png-images.
edited_image
=
np
.
zeros
((
height
,
width
,
3
),
dtype
=
np
.
float64
)
edited_pixels
=
0
for
v
in
range
(
height
):
for
u
in
range
(
width
):
pixel
=
Pixel
(
image
,
v
,
u
)
edited_image
[
v
,
u
]
=
pixel
.
filter_with
(
option
)
edited_pixels
+=
1
if
edited_pixels
%
10000
==
0
:
print
(
'
Finished with:
'
+
str
(
edited_pixels
)
+
'
of
'
+
str
(
width
*
height
))
io
.
imsave
(
arr
=
edited_image
,
fname
=
self
.
edit_path
)
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