-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
12 changed files
with
84 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,28 +4,21 @@ authors = ["Johnny Chen <[email protected]>"] | |
version = "0.1.2" | ||
|
||
[deps] | ||
ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4" | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534" | ||
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5" | ||
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" | ||
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | ||
|
||
[compat] | ||
ColorVectorSpace = "0.7, 0.8, 0.9" | ||
Distributions = "0.19, 0.20, 0.21, 0.22, 0.23, 0.24" | ||
ImageCore = "0.8.4" | ||
ImageFiltering = "0.5, 0.6" | ||
MappedArrays = "0.2, 0.3" | ||
OffsetArrays = "0.10, 0.11, 1" | ||
Distributions = "0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25" | ||
ImageCore = "0.9" | ||
Reexport = "0.2, 1.0" | ||
julia = "1" | ||
julia = "1.6" | ||
|
||
[extras] | ||
BM3DDenoise = "95fb3b36-088a-43fb-bb1b-b1f34fadbd7d" | ||
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19" | ||
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" | ||
ImageQualityIndexes = "2996bd0c-7a13-11e9-2da2-2f5ce47296a9" | ||
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795" | ||
|
@@ -34,4 +27,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | |
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990" | ||
|
||
[targets] | ||
test = ["BM3DDenoise", "ImageMagick", "ImageQualityIndexes", "ImageTransformations", "ReferenceTests", "Test", "TestImages"] | ||
test = ["BM3DDenoise", "ImageIO", "ImageMagick", "ImageQualityIndexes", "ImageTransformations", "ReferenceTests", "Test", "TestImages"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
# --- | ||
# title: Non-local Mean Filter | ||
# id: nlmf-demo | ||
# cover: assets/nlmean_cover.png | ||
# description: This demo shows how to use Non-local Mean filter to reduce gaussian noise | ||
# date: 2019-12-22 | ||
# author: Johnny Chen | ||
# description: Use Non-local Mean filter to reduce gaussian noise | ||
# --- | ||
|
||
using ImageNoise, TestImages, ImageShow, ImageCore, ImageQualityIndexes | ||
using ImageNoise | ||
using TestImages, ImageShow, ImageCore, ImageQualityIndexes, ImageTransformations | ||
using FileIO, Random #src | ||
|
||
# First, load an image and and add gaussian noise to it | ||
|
||
gray_img = testimage("cameraman") .|> float32 | ||
gray_img = float.(imresize(testimage("cameraman"), ratio=0.5)) | ||
n = AdditiveWhiteGaussianNoise(0.1) | ||
noisy_img = apply_noise(gray_img, n) | ||
|
||
# Then calling the standard `reduce_noise` API | ||
|
||
f_nlmean = NonlocalMean(0.1) | ||
denoised_img = reduce_noise(noisy_img, f_nlmean) | ||
|
||
[gray_img noisy_img denoised_img] | ||
mosaicview(gray_img, noisy_img, denoised_img; nrow=1) | ||
|
||
#+ | ||
# Get the PSNR using ImageQualityIndexes package: | ||
|
||
psnr(gray_img, denoised_img) | ||
assess_psnr(gray_img, denoised_img) | ||
|
||
save("assets/nlmean_cover.png", denoised_img) #src | ||
mkpath("assets") #src | ||
save("assets/nlmean_cover.png", denoised_img) #src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.