Skip to content

Commit

Permalink
feat: Described image cache
Browse files Browse the repository at this point in the history
  • Loading branch information
joda01 committed Jan 9, 2025
1 parent 607ed2b commit a4324a3
Show file tree
Hide file tree
Showing 7 changed files with 1,064 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/commands/command_image_math.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
(command-image-math)=
# Image math

:::{sidebar} Edge detection
:::{sidebar} Pixel operations

Edge detection is the process of finding edges in an image and converting them to a gradient representation.
Sharper changes in the intensity values lead to a higher gradient.
An image is represented as a matrix of pixel intensity values.
When calculating with images a matrix operation is performed which uses the pixel value at `(n,m)` from both matrixes and applying the operator on that.
The resulting matrix after applying the operator on all elements of the matrix is the resulting image.

```{figure} images/edge_detection.drawio.svg
```{figure} images/image_math.drawio.svg
:class: full-image
```

Expand All @@ -16,3 +17,8 @@ Sharper changes in the intensity values lead to a higher gradient.
```{figure} images/image_math_screenshot.png
:class: tiny-image
```

The image math command can be used to combine two images using one of the provided mathematical operations.
Input image one is the image from the last pipeline step, the second image is the image configured in the {guilabel}`Input image channel` settings.
For the second image either an image channel can be used or an image stored in the cache from a previous pipeline.
If {guilabel}`From cache` is not {guilabel}`None` the channel settings are ignored and the image from the selected cache slot is loaded.
31 changes: 31 additions & 0 deletions docs/commands/command_store_to_cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

(command-store-to-cache)=
# Store to cache

:::{sidebar} Cache

ImageC cache is reserved place in the RAM of the computer.
Storing an image to the cache stores the actual image to this place in RAM.
Other commands can load these images from the RAM in an efficient way and apply further processing steps on it.

```{figure} images/store_to_cache.drawio.svg
:class: full-image
```

:::

```{figure} images/image_math_screenshot.png
:class: tiny-image
```

The store image to cache command stores an actual image at any time to the cache.
Image cache allows using a preprocessed image as base for further preprocessing steps in an other pipeline or in the same pipeline in a future step.
Possible applications might be to preprocess a background for subtraction and use this preprocessed background together with the image math subtract command in other pipelines to remove it.

:::{note}
Cache scope is the processing step of an image. For each image a separate cache storage is created.
:::

:::{note}
Once an image is stored to the cache it is not edited any more. Loading from the cache creates a new local copy of the image and the pipeline is working on this local copy but not on the cached image.
:::
898 changes: 898 additions & 0 deletions docs/commands/images/image_math.drawio.svg
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.
123 changes: 123 additions & 0 deletions docs/commands/images/store_to_cache.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ command_blur
command_intensity
command_median_subtract
command_edge_detection
command_image_math
command_store_to_cache
:::

(commands-object-segmentation)=
Expand Down

0 comments on commit a4324a3

Please sign in to comment.