diff --git a/CHANGELOG.md b/CHANGELOG.md index 2de91c8..4c91dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,12 @@ # Changelog - All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0] - 2023-09-16 +## [Unreleased] ### Added - Implemented image rotation on the CPU, three new CPU filters, enabled console control over image processing parameters. (https://github.com/PolinaSavelyeva/ImageProcessing/pull/1) - Implemented image processing agents for sets of images, supporting sequential and parallel options. (https://github.com/PolinaSavelyeva/ImageProcessing/pull/3) - Implemented GPU kernels for image rotations and reflections, standardized agent functionality for CPU and GPU, and added a logging agent for event tracking.(https://github.com/PolinaSavelyeva/ImageProcessing/pull/4) -[Unreleased]: https://github.com/PolinaSavelyeva/ImageProcessing/compare/v1.0.0...HEAD -[1.0.0]: https://github.com/PolinaSavelyeva/ImageProcessing/releases/tag/v1.0.0 diff --git a/docs/coverage/ImageProcessing.PolinaSavelyeva_Agents.html b/docs/coverage/ImageProcessing.PolinaSavelyeva_Agents.html index ddbe93f..81d5473 100644 --- a/docs/coverage/ImageProcessing.PolinaSavelyeva_Agents.html +++ b/docs/coverage/ImageProcessing.PolinaSavelyeva_Agents.html @@ -179,7 +179,7 @@
117
MailboxProcessor.Start initial
37
| Transformations _ -> "List of available transformations."
40
0
15
16
let pixelProcessing p =
17
18
let pw = p % image.Width
19
let ph = p / image.Width
18
let pw = p % image.Width
19
let ph = p / image.Width
20
21
let dataToHandle =
22
[| for i in ph - filterDiameter .. ph + filterDiameter do
23
for j in pw - filterDiameter .. pw + filterDiameter do
24
if i < 0 || i >= image.Height || j < 0 || j >= image.Width then
25
float32 image.Data[p]
26
else
27
float32 image.Data[i * image.Width + j] |]
21
let dataToHandle =
22
[| for i in ph - filterDiameter .. ph + filterDiameter do
23
for j in pw - filterDiameter .. pw + filterDiameter do
24
if i < 0 || i >= image.Height || j < 0 || j >= image.Width then
25
float32 image.Data[p]
26
else
27
float32 image.Data[i * image.Width + j] |]
28
29
Array.fold2 (fun acc x y -> acc + x * y) 0.0f filter dataToHandle
29
Array.fold2 (fun acc x y -> acc + x * y) 0.0f filter dataToHandle
30
31
MyImage(Array.mapi (fun p _ -> byte (pixelProcessing p)) image.Data, image.Width, image.Height, image.Name)
31
MyImage(Array.mapi (fun p _ -> byte (pixelProcessing p)) image.Data, image.Width, image.Height, image.Name)
32
33
/// <summary>
34
/// Rotates an input image either clockwise or counterclockwise
41
let buffer = Array.zeroCreate (image.Width * image.Height)
42
let weight = System.Convert.ToInt32 isClockwise
43
44
for j in 0 .. image.Width - 1 do
45
for i in 0 .. image.Height - 1 do
44
for j in 0 .. image.Width - 1 do
45
for i in 0 .. image.Height - 1 do
46
47
let pw = j * weight + (image.Width - 1 - j) * (1 - weight)
48
let ph = i * (1 - weight) + (image.Height - 1 - i) * weight
47
let pw = j * weight + (image.Width - 1 - j) * (1 - weight)
48
let ph = i * (1 - weight) + (image.Height - 1 - i) * weight
49
50
buffer[ph + pw * image.Height] <- image.Data[j + i * image.Width]
50
buffer[ph + pw * image.Height] <- image.Data[j + i * image.Width]
51
52
MyImage(buffer, image.Height, image.Width, image.Name)
53
62
let buffer = Array.zeroCreate (image.Height * image.Width)
63
let weight = System.Convert.ToInt32 isVertical
64
65
for j in 0 .. image.Width - 1 do
66
for i in 0 .. image.Height - 1 do
65
for j in 0 .. image.Width - 1 do
66
for i in 0 .. image.Height - 1 do
67
68
let pw = (image.Width - j - 1) * weight + j * (1 - weight)
69
let ph = i * weight + (image.Height - i - 1) * (1 - weight)
68
let pw = (image.Width - j - 1) * weight + j * (1 - weight)
69
let ph = i * weight + (image.Height - i - 1) * (1 - weight)
70
71
buffer[pw + ph * image.Width] <- image.Data[j + i * image.Width]
71
buffer[pw + ph * image.Width] <- image.Data[j + i * image.Width]
72
73
MyImage(buffer, image.Width, image.Height, image.Name)
231
MyImage.MyImage(result, image.Width, image.Height, image.Name)
7
/// <returns>A 1D array containing all the elements of the input 2D array</returns>
8
let toFlatArray array2D =
9
seq {
10
for x in [ 0 .. (Array2D.length1 array2D) - 1 ] do
11
for y in [ 0 .. (Array2D.length2 array2D) - 1 ] do
12
yield array2D[x, y]
10
for x in [ 0 .. (Array2D.length1 array2D) - 1 ] do
11
for y in [ 0 .. (Array2D.length2 array2D) - 1 ] do
12
yield array2D[x, y]
13
}
14
|> Array.ofSeq
15
23
System.IO.Path.Combine(outputDirectory, imageName)
31
array2D [ [ 0; -1; 0 ]; [ -1; 5; -1 ]; [ 0; -1; -0 ] ] |> Array2D.map float32
37
/// <param name="filePath">Path to the directory where the image will be saved</param>
38
let save (image: MyImage) filePath =
39
40
let image = Image.LoadPixelData<L8>(image.Data, image.Width, image.Height)
40
let image = Image.LoadPixelData<L8>(image.Data, image.Width, image.Height)
41
42
image.Save filePath