Skip to content

Commit

Permalink
chore: Described edge detection and median subtract
Browse files Browse the repository at this point in the history
  • Loading branch information
joda01 committed Dec 2, 2024
1 parent 3de9af9 commit a5f9e3d
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 1 deletion.
29 changes: 29 additions & 0 deletions docs/commands/command_edge_detection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

(command-edge-detection)=
# Edge detection

:::{sidebar} Edge detection

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.

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

:::

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

Edge detection is a function used to highlight the edges within an image.
An edge is defined as a change in grey level.
Larger rates of change in the values lead to a larger output value in the algorithm.

ImageC provides {guilabel}`Sobel` and {guilabel}`Canny` edge detection.


The main advantages of the Sobel operator are that it is simple and time efficient but produces rough edges.
On the other hand, the Canny technique produces smoother edges due to the implementation of non-maxima suppression and thresholding.
The disadvantage of the Canny algorithm is that it is more complex and less time efficient than Sobel.
18 changes: 18 additions & 0 deletions docs/commands/command_image_math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

(command-image-math)=
# Image math

:::{sidebar} Edge detection

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.

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

:::

```{figure} images/image_math_screenshot.png
:class: tiny-image
```
33 changes: 33 additions & 0 deletions docs/commands/command_median_subtract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

(command-median-subtract)=
# Median subtract

:::{sidebar} Rank filter

Rank-order filters belong to the class of non-linear filters in digital image processing.
These are filters that cannot be described by a convolution.

With ranking filters, the gray values of the pixels in a defined area around a pixel are collected, sorted by size and ranked.
A gray value is then selected from this sorted list to replace the gray value of the current pixel.

The choice of position determines the type of ranking filter. With ascending sorting, you get the:

- Minimum filter, for the minimum gray value, first position in the list
- Median filter, for the gray value in the middle of the list
- Maximum filter, for the maximum gray value, last position in the list.

:::

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

Median subtraction is a sort of noise filtering which can be used to reduce background noise similar to the [rolling ball]() algorithm.
Behind the scenes a rank filter is used to calculate the median of the image intensity, which is subtracted afterwards from the original image.

The kernel size defines the window size used for the rank filter to calculate the median.
Bigger kernels reduces more details from the image than smaller ones.

:::{hint}
Bigger filter kernels removes more noise and details from the image.
:::
56 changes: 56 additions & 0 deletions docs/commands/images/edge_detection.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.
Binary file added docs/commands/images/image_math_screenhot.png
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.
3 changes: 2 additions & 1 deletion docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ command_color_filter
command_rolling_ball
command_blur
command_intensity

command_median_subtract
command_edge_detection
:::

(commands-object-segmentation)=
Expand Down

0 comments on commit a5f9e3d

Please sign in to comment.