This repository has been archived by the owner on Jul 6, 2024. It is now read-only.
forked from gsvgit/ImageProcessing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e032f0
commit 034de1d
Showing
8 changed files
with
179 additions
and
0 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
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,16 +1,31 @@ | ||
module Kernels | ||
|
||
/// <summary> | ||
/// Represents a Gaussian blur kernel for filter applying on CPU as a 2D array | ||
/// </summary> | ||
let gaussianBlurKernel = | ||
array2D [ [ 1; 4; 6; 4; 1 ]; [ 4; 16; 24; 16; 4 ]; [ 6; 24; 36; 24; 6 ]; [ 4; 16; 24; 16; 4 ]; [ 1; 4; 6; 4; 1 ] ] | ||
|> Array2D.map (fun x -> (float32 x) / 256.0f) | ||
|
||
/// <summary> | ||
/// Represents a edges kernel for filter applying on CPU as a 2D array | ||
/// </summary> | ||
let edgesKernel = | ||
array2D [ [ 0; 0; -1; 0; 0 ]; [ 0; 0; -1; 0; 0 ]; [ 0; 0; 2; 0; 0 ]; [ 0; 0; 0; 0; 0 ]; [ 0; 0; 0; 0; 0 ] ] | ||
|> Array2D.map float32 | ||
|
||
/// <summary> | ||
/// Represents a darken kernel for filter applying on CPU as a 2D array | ||
/// </summary> | ||
let darkenKernel = array2D [ [ 2 ] ] |> Array2D.map (fun x -> (float32 x) / 10.0f) | ||
|
||
/// <summary> | ||
/// Represents a lighten kernel for filter applying on CPU as a 2D array | ||
/// </summary> | ||
let lightenKernel = array2D [ [ 2 ] ] |> Array2D.map float32 | ||
|
||
/// <summary> | ||
/// Represents a sharpen kernel for filter applying on CPU as a 2D array | ||
/// </summary> | ||
let sharpenKernel = | ||
array2D [ [ 0; -1; 0 ]; [ -1; 5; -1 ]; [ 0; -1; -0 ] ] |> Array2D.map float32 |
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