Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
9734495b
Commit
9734495b
authored
Feb 13, 2020
by
Julia Garriga Ferrer
Browse files
[core][hot pixel removal] Use median filter from silx instead of opencv
parent
ba736506
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/imageOperations.py
View file @
9734495b
...
...
@@ -29,7 +29,7 @@ __license__ = "MIT"
__date__
=
"29/11/2019"
import
numpy
import
cv2
import
silx.math
from
enum
import
Enum
...
...
@@ -145,7 +145,7 @@ def hot_pixel_removal(data, ksize=3):
elif
frame
.
dtype
==
numpy
.
float
:
frame
=
frame
.
astype
(
numpy
.
float32
)
corrected_frame
=
numpy
.
array
(
frame
)
median
=
cv2
.
medianBlur
(
frame
,
ksize
)
median
=
silx
.
math
.
medfilt
(
frame
,
ksize
)
hot_pixels
=
numpy
.
subtract
(
frame
,
median
,
dtype
=
numpy
.
int64
)
threshold
=
numpy
.
std
(
hot_pixels
)
corrected_frame
[
hot_pixels
>
threshold
]
=
median
[
hot_pixels
>
threshold
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment