+ /// Fsdocs.build (fun p -> { p with Clean = Some(true); Strict = Some(true) })
+ ///
+ ///
+ /// Fsdocs.watch (fun p -> { p with Port = Some(3005) })
+ ///
+ /// 
In this tutorial, we will look at how to work with the ImageProcessing library using code rather than console commands.
+ |
+ NOTE: The library uses .NET 7.0. Make sure your application complies with this requirement. +
+Load your image using the loadAsImage function from the MyImage module.
|
For CPU and GPU the list of transforms is identical, decide what you want to process your image on and select the appropriate function to process from the CpuProcessing module or the GpuProcessing module respectively.
Apply the fisheye filter to the uploaded image.
+ |
Don't forget to save the processed image using the saveImage function from the MyImage module!
|
In the case of GPU processing, you have to go through a few extra steps to achieve your goal:
+Prepare OpenCl context and queue(from Brahma.FSharp module):
|
Compile the kernel to apply the filter using the fishEyeKernel function from the GpuKernels module:
|
Process the image using the fishEye function from the GpuProcessing module:
|
Don't forget to save the new image:
+ |
+ For more info about GPU processing please check Brahma +
+In this tutorial we will look at how to get started with the ImageProcessing library and process your first images.
+ |
Decide on the image you want to process. You can also process several images at once, in which case specify the path to the directory with your images.
+In the command line parameter "-i" use the path to the image, for "-o" use the path where you want to save the image. +
+NOTE: Do not use the same directory as your images for saving, if you do, you will lose the original images! +
+Decide on the modifications you want to apply to the image. Here is a complete list of available modifications:
+Use the selected modification or modification list for the "-mod" parameter.
+By default, all processing will be done at the expense of the CPU. If you want to process images using GPGPU, use the "-gpu" parameter (if the device has a video card):
+In the case of processing a large number of images, it would be logical to utilize the parallel processing power of your device. To do this, use the "-ag" or "-sag" parameter. The "-ag" parameter will split image processing and saving tasks into two separate computational threads. The "-sag" parameter will allocate the number of threads you need to process and save images independently. For this parameter you should specify the number of threads you need.
+The end result may look like the following:
+ |
| Class: | Agents |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\Agents.fs |
| Covered lines: | 0 |
| Uncovered lines: | 39 |
| Coverable lines: | 39 |
| Total lines: | 59 |
| Line coverage: | 0% (0 of 39) |
| Covered branches: | 0 |
| Total branches: | 4 |
| Branch coverage: | 0% (0 of 4) |
| Covered methods: | 0 |
| Total methods: | 12 |
| Method coverage: | 0% (0 of 12) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| listAllFiles(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| imgSaver(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 6 | 2 | 2 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| imgProcessor(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 6 | 2 | 2 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Class: | Arguments |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\Arguments.fs |
| Covered lines: | 8 |
| Uncovered lines: | 5 |
| Coverable lines: | 13 |
| Total lines: | 37 |
| Line coverage: | 61.5% (8 of 13) |
| Covered branches: | 7 |
| Total branches: | 11 |
| Branch coverage: | 63.6% (7 of 11) |
| Covered methods: | 1 |
| Total methods: | 2 |
| Method coverage: | 50% (1 of 2) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| modificationParser(...) | 100% | 7 | 7 | 7 | 100% |
| Argu.IArgParserTemplate.get_Usage() | 0% | 20 | 4 | 4 | 0% |
| Class: | CpuImageProcessing |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\CpuImageProcessing.fs |
| Covered lines: | 62 |
| Uncovered lines: | 7 |
| Coverable lines: | 69 |
| Total lines: | 167 |
| Line coverage: | 89.8% (62 of 69) |
| Covered branches: | 48 |
| Total branches: | 50 |
| Branch coverage: | 96% (48 of 50) |
| Covered methods: | 15 |
| Total methods: | 17 |
| Method coverage: | 88.2% (15 of 17) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| .ctor(...) | 0% | 1 | 1 | 0 | 100% |
| loadAs2DArray(...) | 77.78% | 5 | 5 | 16 | 100% |
| loadAsImage(...) | 0% | 1 | 1 | 0 | 100% |
| flat2dArray(...) | 0% | 1 | 1 | 0 | 100% |
| GenerateNext(...) | 100% | 8 | 8 | 4 | 100% |
| save2DByteArrayAsImage(...) | 0% | 2 | 1 | 0 | 0% |
| saveImage(...) | 0% | 2 | 1 | 0 | 0% |
| applyFilter(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 100% | 9 | 9 | 64 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| applyFilterToImage(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 100% | 9 | 9 | 64 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| rotate90Degrees(...) | 100% | 6 | 6 | 32 | 100% |
| rotate90DegreesImage(...) | 100% | 3 | 3 | 4 | 100% |
| Class: | CpuProcessing |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\CpuProcessing.fs |
| Covered lines: | 42 |
| Uncovered lines: | 0 |
| Coverable lines: | 42 |
| Total lines: | 72 |
| Line coverage: | 100% (42 of 42) |
| Covered branches: | 32 |
| Total branches: | 32 |
| Branch coverage: | 100% (32 of 32) |
| Covered methods: | 8 |
| Total methods: | 8 |
| Method coverage: | 100% (8 of 8) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| applyFilter(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 100% | 9 | 9 | 64 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| Invoke(...) | 0% | 1 | 1 | 0 | 100% |
| rotate(...) | 100% | 3 | 3 | 4 | 100% |
| mirror(...) | 100% | 3 | 3 | 4 | 100% |
| fishEye(...) | 100% | 6 | 6 | 32 | 100% |
| Invoke(...) | 100% | 2 | 2 | 2 | 100% |
| Class: | GpuKernels |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\GpuKernels.fs |
| Covered lines: | 0 |
| Uncovered lines: | 97 |
| Coverable lines: | 97 |
| Total lines: | 134 |
| Line coverage: | 0% (0 of 97) |
| Covered branches: | 0 |
| Total branches: | 4 |
| Branch coverage: | 0% (0 of 4) |
| Covered methods: | 0 |
| Total methods: | 12 |
| Method coverage: | 0% (0 of 12) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| applyFilterKernel(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| rotateKernel(...) | 0% | 6 | 2 | 2 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| mirrorKernel(...) | 0% | 6 | 2 | 2 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| fishEyeKernel(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Class: | GpuProcessing |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\GpuProcessing.fs |
| Covered lines: | 0 |
| Uncovered lines: | 72 |
| Coverable lines: | 72 |
| Total lines: | 116 |
| Line coverage: | 0% (0 of 72) |
| Covered branches: | 0 |
| Total branches: | 0 |
| Covered methods: | 0 |
| Total methods: | 12 |
| Method coverage: | 0% (0 of 12) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| applyFilter(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| rotate(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| mirror(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| fishEye(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Class: | ImageArrayProcessing |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\ImageArrayProcessing.fs |
| Covered lines: | 0 |
| Uncovered lines: | 14 |
| Coverable lines: | 14 |
| Total lines: | 42 |
| Line coverage: | 0% (0 of 14) |
| Covered branches: | 0 |
| Total branches: | 6 |
| Branch coverage: | 0% (0 of 6) |
| Covered methods: | 0 |
| Total methods: | 4 |
| Method coverage: | 0% (0 of 4) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| listAllFiles(...) | 0% | 2 | 1 | 0 | 0% |
| Invoke(...) | 0% | 20 | 4 | 0 | 0% |
| arrayOfImagesProcessing(...) | 0% | 20 | 4 | 8 | 0% |
| Invoke(...) | 0% | 2 | 1 | 0 | 0% |
| Class: | Kernels |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | |
| Covered lines: | 0 |
| Uncovered lines: | 0 |
| Coverable lines: | 0 |
| Total lines: | 0 |
| Line coverage: | 100% (0 of 0) |
| Covered branches: | 0 |
| Total branches: | 0 |
| Covered methods: | 0 |
| Total methods: | 0 |
| Method coverage: |
No files found. This usually happens if a file isn't covered by a test or the class does not contain any sequence points (e.g. a class that only contains auto properties).
-| Class: | ImageProcessing.Main |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\Main.fs |
| Covered lines: | 0 |
| Uncovered lines: | 17 |
| Coverable lines: | 17 |
| Total lines: | 37 |
| Line coverage: | 0% (0 of 17) |
| Covered branches: | 0 |
| Total branches: | 8 |
| Branch coverage: | 0% (0 of 8) |
| Covered methods: | 0 |
| Total methods: | 1 |
| Method coverage: | 0% (0 of 1) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| main(...) | 0% | 30 | 5 | 16 | 0% |
| Class: | MyImage |
|---|---|
| Assembly: | ImageProcessing |
| File(s): | C:\Users\Леонид\ImageProcessing\src\ImageProcessing\MyImage.fs |
| Covered lines: | 8 |
| Uncovered lines: | 2 |
| Coverable lines: | 10 |
| Total lines: | 30 |
| Line coverage: | 80% (8 of 10) |
| Covered branches: | 0 |
| Total branches: | 0 |
| Covered methods: | 2 |
| Total methods: | 3 |
| Method coverage: | 66.6% (2 of 3) |
| Method | Branch coverage | Crap Score | Cyclomatic complexity | NPath complexity | Sequence coverage |
|---|---|---|---|---|---|
| .ctor(...) | 0% | 1 | 1 | 0 | 100% |
| loadAsImage(...) | 0% | 1 | 1 | 0 | 100% |
| saveImage(...) | 0% | 2 | 1 | 0 | 0% |
| Generated on: | 16.03.2023 - 20:32:58 |
|---|---|
| Parser: | OpenCoverParser |
| Assemblies: | 1 |
| Classes: | 5 |
| Files: | 5 |
| Covered lines: | 70 |
| Uncovered lines: | 82 |
| Coverable lines: | 152 |
| Total lines: | 342 |
| Line coverage: | 46% (70 of 152) |
| Covered branches: | 55 |
| Total branches: | 79 |
| Branch coverage: | 69.6% (55 of 79) |
| Covered methods: | 16 |
| Total methods: | 36 |
| Method coverage: | 44.4% (16 of 36) |
| Assembly | -Class | -Method | -Cyclomatic complexity | -NPath complexity | -Crap Score | -
|---|---|---|---|---|---|
| ImageProcessing | -ImageProcessing.Main | -main(...) | 5 | -16 | -30 | -
| ImageProcessing | -Arguments | -Argu.IArgParserTemplate.get_Usage() | 4 | -4 | -20 | -
| ImageProcessing | -ImageArrayProcessing | -arrayOfImagesProcessing(...) | 4 | -8 | -20 | -
| ImageProcessing | -ImageArrayProcessing | -Invoke(...) | 4 | -0 | -20 | -
| Name | Covered | Uncovered | Coverable | Total | Line coverage | Covered | Total | Branch coverage | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ImageProcessing | 70 | 82 | 152 | 342 | 46% | 55 | 79 | 69.6% | ||||||
| Agents | 0 | 39 | 39 | 59 | 0% | 0 | 4 | 0% | ||||||
| Arguments | 8 | 5 | 13 | 37 | 61.5% | 7 | 11 | 63.6% | ||||||
| CpuImageProcessing | 62 | 7 | 69 | 167 | 89.8% | 48 | 50 | 96% | ||||||
| ImageArrayProcessing | 0 | 14 | 14 | 42 | 0% | 0 | 6 | 0% | ||||||
| ImageProcessing.Main | 0 | 17 | 17 | 37 | 0% | 0 | 8 | 0% | ||||||
| Generated on: | 16.03.2023 - 20:32:58 |
|---|---|
| Parser: | OpenCoverParser |
| Assemblies: | 1 |
| Classes: | 5 |
| Files: | 5 |
| Covered lines: | 70 |
| Uncovered lines: | 82 |
| Coverable lines: | 152 |
| Total lines: | 342 |
| Line coverage: | 46% (70 of 152) |
| Covered branches: | 55 |
| Total branches: | 79 |
| Branch coverage: | 69.6% (55 of 79) |
| Covered methods: | 16 |
| Total methods: | 36 |
| Method coverage: | 44.4% (16 of 36) |
| Assembly | -Class | -Method | -Cyclomatic complexity | -NPath complexity | -Crap Score | -
|---|---|---|---|---|---|
| ImageProcessing | -ImageProcessing.Main | -main(...) | 5 | -16 | -30 | -
| ImageProcessing | -Arguments | -Argu.IArgParserTemplate.get_Usage() | 4 | -4 | -20 | -
| ImageProcessing | -ImageArrayProcessing | -arrayOfImagesProcessing(...) | 4 | -8 | -20 | -
| ImageProcessing | -ImageArrayProcessing | -Invoke(...) | 4 | -0 | -20 | -
| Name | Covered | Uncovered | Coverable | Total | Line coverage | Covered | Total | Branch coverage | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ImageProcessing | 70 | 82 | 152 | 342 | 46% | 55 | 79 | 69.6% | ||||||
| Agents | 0 | 39 | 39 | 59 | 0% | 0 | 4 | 0% | ||||||
| Arguments | 8 | 5 | 13 | 37 | 61.5% | 7 | 11 | 63.6% | ||||||
| CpuImageProcessing | 62 | 7 | 69 | 167 | 89.8% | 48 | 50 | 96% | ||||||
| ImageArrayProcessing | 0 | 14 | 14 | 42 | 0% | 0 | 6 | 0% | ||||||
| ImageProcessing.Main | 0 | 17 | 17 | 37 | 0% | 0 | 8 | 0% | ||||||
A library for image processing using GPGPU and agents for parallel computing.
+How to get started with ImageProcessing
+Learn how to work with the ImageProcessing library directly in your code
+Learn about the structure of the library
++ + Module with implementation of agents for image processing + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ imgProcessor filter imgSaver logger
+ + + Parameters: +
MyImage -> MyImage
+ -
+ Filter for application
+
+ + + + imgSaver + + : + MailboxProcessor<Msg>
+ -
+ Saving Agent
+
+ + + + logger + + : + MailboxProcessor<Msg>
+ -
+ Logging Agent
+
+ + + + Returns: + MailboxProcessor<Msg>
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ imgSaver outDir logger
+ + + Parameters: +
string
+ -
+ Path to save
+
+ + + + logger + + : + MailboxProcessor<Msg>
+ -
+ Logging Agent
+
+ + + + Returns: + MailboxProcessor<Msg>
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ listAllFiles dir
+ + + Parameters: +
string
+
+ + + + Returns: + string list
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ msgLogger ()
+ + + Parameters: +
unit
+
+ + + + Returns: + MailboxProcessor<Msg>
+
+ + |
+ + + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ outFile imgName outDir
+ + + Parameters: +
string
+
+ + + + outDir + + : + string
+
+ + + + Returns: + string
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ superAgent outputDir conversion logger
+ + + Parameters: +
string
+ -
+ Path to save
+
+ + + + conversion + + : + MyImage -> MyImage
+ -
+ Image transformation
+
+ + + + logger + + : + MailboxProcessor<Msg>
+ -
+ Logging Agent
+
+ + + + Returns: + MailboxProcessor<Msg>
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ superImageProcessing inputDir outputDir conversion countOfAgents
+ + + Parameters: +
string
+ -
+ Path to image or images
+
+ + + + outputDir + + : + string
+ -
+ Path to save
+
+ + + + conversion + + : + MyImage -> MyImage
+ -
+ Image transformation
+
+ + + + countOfAgents + + : + int
+ -
+ Count of superAgents to processing
+
+ + + |
+
+
+
+ + ++ + |
+
+ +
+| + Union case + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Agents
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ InputPath inputPath
+ + + Parameters: +
string
+
+ + + |
+
+
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ Modifications modifications
+ + + Parameters: +
List<Modifications>
+
+ + + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ OutputPath outputPath
+ + + Parameters: +
string
+
+ + + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ SuperAgents count
+ + + Parameters: +
int
+
+ + + |
+
+
|
+
+ + Module with implementation of work via console commands + +
+| + Type + | ++ Description + | +
|
+ + + + CliArguments + + + + |
+ + + | +
| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+ |
+ + + | +
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ first (x, arg2, arg3, arg4)
+ + + Parameters: +
'a
+
+ + + + arg1 + + : + 'b
+
+ + + + arg2 + + : + 'c
+
+ + + + arg3 + + : + 'd
+
+ + + + Returns: + 'a
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ fourth (arg1, arg2, arg3, x)
+ + + Parameters: +
'a
+
+ + + + arg1 + + : + 'b
+
+ + + + arg2 + + : + 'c
+
+ + + + x + + : + 'd
+
+ + + + Returns: + 'd
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ modificationGpuParser modification (arg2, arg3, arg4, arg5)
+ + + Parameters: +
Modifications
+
+ + + + arg1 + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<float32> -> int -> ClArray<byte> -> unit)>
+
+ + + + arg2 + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + arg3 + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + arg4 + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + Returns: + ClContext -> int -> MailboxProcessor<Msg> -> MyImage -> MyImage
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ modificationParser modification
+ + + Parameters: +
Modifications
+
+ + + + Returns: + MyImage -> MyImage
+
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ second (arg1, x, arg3, arg4)
+ + + Parameters: +
'a
+
+ + + + x + + : + 'b
+
+ + + + arg2 + + : + 'c
+
+ + + + arg3 + + : + 'd
+
+ + + + Returns: + 'b
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ third (arg1, arg2, x, arg4)
+ + + Parameters: +
'a
+
+ + + + arg1 + + : + 'b
+
+ + + + x + + : + 'c
+
+ + + + arg3 + + : + 'd
+
+ + + + Returns: + 'c
+
+ + |
+
+
|
+
+ + Module with functions for image processing on the CPU + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+ |
+ + + | +
|
+
+
+
+
+
+ |
+ + + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ mirror side image
+ + + Parameters: +
MirrorDirection
+ -
+ The side to which the image will be reflected
+
+ + + + image + + : + MyImage
+ -
+ Image with type MyImage
+
+ + + + Returns: + MyImage
+
+ Image with type MyImage
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+ |
+ + + | +
+ + Module with kernels for image processing on the GPU + +
+| + Function or value + | ++ Description + | +
| + + | ++ + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ applyFilterProcessor kernel localWorkSize commandQueue filter filterD img imgH imgW result
+ + + Parameters: +
ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<float32> -> int -> ClArray<byte> -> unit)>
+
+ + + + localWorkSize + + : + int
+
+ + + + commandQueue + + : + MailboxProcessor<Msg>
+
+ + + + filter + + : + ClArray<float32>
+
+ + + + filterD + + : + int
+
+ + + + img + + : + ClArray<byte>
+
+ + + + imgH + + : + int
+
+ + + + imgW + + : + int
+
+ + + + result + + : + ClArray<byte>
+
+ + + + Returns: + ClArray<byte>
+
+ + |
+
+
+
+ + ++
|
+
| + + | ++ + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ fishEyeKernelProcessor kernel localWorkSize commandQueue img imgH imgW result
+ + + Parameters: +
ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + localWorkSize + + : + int
+
+ + + + commandQueue + + : + MailboxProcessor<Msg>
+
+ + + + img + + : + ClArray<byte>
+
+ + + + imgH + + : + int
+
+ + + + imgW + + : + int
+
+ + + + result + + : + ClArray<byte>
+
+ + + + Returns: + ClArray<byte>
+
+ + |
+
+
+
+ + ++
|
+
| + + | ++ + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ mirrorKernelProcessor kernel localWorkSize side commandQueue img imgH imgW result
+ + + Parameters: +
ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + localWorkSize + + : + int
+
+ + + + side + + : + MirrorDirection
+
+ + + + commandQueue + + : + MailboxProcessor<Msg>
+
+ + + + img + + : + ClArray<byte>
+
+ + + + imgH + + : + int
+
+ + + + imgW + + : + int
+
+ + + + result + + : + ClArray<byte>
+
+ + + + Returns: + ClArray<byte>
+
+ + |
+
+
+
+ + ++
|
+
| + + | ++ + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ rotateKernelProcessor kernel localWorkSize side commandQueue img imgH imgW result
+ + + Parameters: +
ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+
+ + + + localWorkSize + + : + int
+
+ + + + side + + : + Side
+
+ + + + commandQueue + + : + MailboxProcessor<Msg>
+
+ + + + img + + : + ClArray<byte>
+
+ + + + imgH + + : + int
+
+ + + + imgW + + : + int
+
+ + + + result + + : + ClArray<byte>
+
+ + + + Returns: + ClArray<byte>
+
+ + |
+
+
+
+ + ++
|
+
+ + Module with functions for image processing on the GPU + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ applyFilter filter kernel clContext localWorkSize queue
+ + + Parameters: +
float32[][]
+ -
+ A two-dimensional array applied to an image as a filter
+
+ + + + kernel + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<float32> -> int -> ClArray<byte> -> unit)>
+ -
+ Compiled kernel for filter application
+
+ + + + clContext + + : + ClContext
+ -
+ Abstraction over OpenCL context
+
+ + + + localWorkSize + + : + int
+ -
+ Local workgroup size
+
+ + + + queue + + : + MailboxProcessor<Msg>
+ -
+ Command queue capable of handling messages of type Msg
+
+ + + + Returns: + MyImage -> MyImage
+
+ Image with type MyImage
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ fishEye kernel clContext localWorkSize queue
+ + + Parameters: +
ClProgram<Range1D, (ClArray<byte> -> int -> int -> ClArray<byte> -> unit)>
+ -
+ Compiled kernel for fisheye filter application
+
+ + + + clContext + + : + ClContext
+ -
+ Abstraction over OpenCL context
+
+ + + + localWorkSize + + : + int
+ -
+ Local workgroup size
+
+ + + + queue + + : + MailboxProcessor<Msg>
+ -
+ Command queue capable of handling messages of type Msg
+
+ + + + Returns: + MyImage -> MyImage
+
+ Image with type MyImage
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ mirror side kernel clContext localWorkSize queue
+ + + Parameters: +
MirrorDirection
+ -
+ The side to which the image will be reflected
+
+ + + + kernel + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+ -
+ Compiled kernel for reflection application
+
+ + + + clContext + + : + ClContext
+ -
+ Abstraction over OpenCL context
+
+ + + + localWorkSize + + : + int
+ -
+ Local workgroup size
+
+ + + + queue + + : + MailboxProcessor<Msg>
+ -
+ Command queue capable of handling messages of type Msg
+
+ + + + Returns: + MyImage -> MyImage
+
+ Image with type MyImage
+ + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ rotate side kernel clContext localWorkSize queue
+ + + Parameters: +
Side
+ -
+ The side to which the image will be rotated
+
+ + + + kernel + + : + ClProgram<Range1D, (ClArray<byte> -> int -> int -> int -> ClArray<byte> -> unit)>
+ -
+ Compiled kernel for rotation application
+
+ + + + clContext + + : + ClContext
+ -
+ Abstraction over OpenCL context
+
+ + + + localWorkSize + + : + int
+ -
+ Local workgroup size
+
+ + + + queue + + : + MailboxProcessor<Msg>
+ -
+ Command queue capable of handling messages of type Msg
+
+ + + + Returns: + MyImage -> MyImage
+
+ Image with type MyImage
+ + |
+
+
+
+ + ++
|
+
+ + Module with implementation of processing array of images + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ arrayOfImagesProcessing inputDir outputDir conversion agentMod
+ + + Parameters: +
string
+ -
+ Path to the folder with images
+
+ + + + outputDir + + : + string
+ -
+ Path to save
+
+ + + + conversion + + : + MyImage -> MyImage
+ -
+ Image transformation
+
+ + + + agentMod + + : + AgentStatus
+ -
+ Processing with or without agent assistance
+
+ + + |
+
+
+
+ + ++
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ extensions
+ + + + Returns: + string[]
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ listAllFiles dir
+ + + Parameters: +
string
+
+ + + + Returns: + string list
+
+ + |
+
+
+
+ + ++
|
+
+ + Module with kernels for image processing + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ edgesKernel
+ + + + Returns: + float32[][]
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ embossKernel
+ + + + Returns: + float32[][]
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ gaussianBlur7x7Kernel
+ + + + Returns: + float32[][]
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ gaussianBlurKernel
+ + + + Returns: + float32[][]
+
+ + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ sharpenKernel
+ + + + Returns: + float32[][]
+
+ + |
+
+
|
+
+ + Module for processing console commands + +
+| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ main argv
+ + + Parameters: +
string[]
+
+ + + + Returns: + int
+
+ + |
+
+
|
+
+ + Type to represent images + +
+| + Record Field + | ++ Description + | +
| + + | +
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Height
+ + + + Field type: + int
+
+ + |
+
+
|
+
| + + | +
+
|
+
| + + | +
+
|
+
| + Constructor + | ++ Description + | +
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ MyImage(data, width, height, name)
+ + + Parameters: +
byte array
+
+ + + + width + + : + int
+
+ + + + height + + : + int
+
+ + + + name + + : + string
+
+ + + + Returns: + MyImage
+
+ + |
+
+
|
+
+ + Module for working with images + +
+| + Type + | ++ Description + | +
|
+ + + + MyImage + + + + |
+ + + | +
| + Function or value + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ loadAsImage file
+ + + Parameters: +
string
+
+ + + + Returns: + MyImage
+
+ + |
+ + + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ saveImage image file
+ + + Parameters: +
MyImage
+
+ + + + file + + : + string
+
+ + + |
+ + + | +
+ + Type for determining the status of an agent + +
++ + Type for defining the executor of transformations + +
+| + Union case + | ++ Description + | +
| + + | +
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ AnyGpu
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
| + + | +
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Nvidia
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
+ + Type for determining the direction of image reflection + +
+| + Union case + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Horizontal
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Vertical
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
+ + Type for determining the applied image transformation + +
+| + Union case + | ++ Description + | +
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ ClockwiseRotation
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ CounterClockwiseRotation
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
| + + | +
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Emboss
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ FishEye
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Gauss5x5
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Gauss7x7
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ MirrorHorizontal
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ MirrorVertical
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Sharpen
+ + + |
+
+
+
+
+
+
+
+ + + + |
+
+ + Type to define a message to be forwarded between agents + +
+| + Union case + | ++ Description + | +
|
+
+
+
+
+
+
+
+
+ Full Usage:
+
+ EOS AsyncReplyChannel<unit>
+ + + Parameters: +
AsyncReplyChannel<unit>
+
+ + + |
+
+
|
+
|
+
+
+
+
+
+
+ |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Message string
+ + + Parameters: +
string
+
+ + + |
+
+
|
+
|
+
+
+
+
+
+
+
+ Full Usage:
+
+ Path string
+ + + Parameters: +
string
+
+ + + |
+
+
|
+
+ + Type for determining the rotation side of the image + +
++ + Module with necessary algebraic types + +
+| + Type + | ++ Description + | +
|
+ + + + AgentStatus + + + + |
+ + + | +
|
+ + + + Devices + + + + |
+ + + | +
|
+ + + + MirrorDirection + + + + |
+ + + | +
|
+ + + + Modifications + + + + |
+ + + | +
| + + | ++ + | +
| + + | ++ + | +
| + Modules + | ++ Description + | +
|
+ + + + Agents + + + + |
+ + + | +
|
+ + + + Arguments + + + + |
+ + + | +
|
+ + + + CpuProcessing + + + + |
+ + + | +
|
+ + + + GpuKernels + + + + |
+ + + | +
|
+ + + + GpuProcessing + + + + |
+ + + | +
|
+ + + + ImageArrayProcessing + + + + |
+ + + | +
|
+ + + + Kernels + + + + |
+ + + | +
| + + | ++ + | +
|
+ + + + MyImage + + + + |
+ + + | +
| + + | ++ + | +
| + Namespace + | ++ Description + | +
| + + ImageProcessing + + | ++ |
+ NOTE: The library uses .NET 7.0. Make sure your application complies with this requirement. +
++ For more info about GPU processing please check Brahma +
++ NOTE: Do not use the same directory as your images for saving, if you do, you will lose the original images! +
+How to get started with ImageProcessing
+Learn how to work with the ImageProcessing library directly in your code
+Learn about the structure of the library
+