Segmentation

Last modified: February 14, 2023

Contents

cc_analysis

[object] cc_analysis ()

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Performs connected component analysis on the image.

This algorithm assumes 8-connected components, meaning any two pixels are considered "connected" if they are adjacent in any direction, including diagonally.

The original image will have all of its pixels "labeled" with a number representing each connected component. This is so the connected components can share data with their source image and makes things much more efficient.

Returns a list of ccs found in the image. Since all the CC's share the same data with the original image, changing the CC's will affect the original. If you do not want this behavior, use the image_copy function on each of the CCs:

ccs = [x.image_copy() for x in ccs]

Example 1: cc_analysis()

images/OneBit_generic.png

cc_analysis_plugin_00_00 cc_analysis_plugin_00_01 cc_analysis_plugin_00_02 cc_analysis_plugin_00_03 cc_analysis_plugin_00_04

cc_and_cluster

[object] cc_and_cluster (float ratio = 1.00, int distance = 2)

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Performs connected component analysis using cc_analysis and then clusters the CC's according to their similarity.

TODO: We need some more detailed documentation here.


Example 1: cc_and_cluster()

images/OneBit_generic.png

cc_and_cluster_plugin_00_00 cc_and_cluster_plugin_00_01 cc_and_cluster_plugin_00_02 cc_and_cluster_plugin_00_03 cc_and_cluster_plugin_00_04

splitx

[object] splitx (FloatVector center = [0.5])

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom, Karl MacMillan and Christoph Dalitz

Splits an image vertically.

The split point is determined automatically by finding a valley in the projections near center.

This function is overloaded to work both with a single value and a list of splitting point candidates as input.


Example 1: splitx()

images/OneBit_generic.png

splitx_plugin_00_00 splitx_plugin_00_01 splitx_plugin_00_02 splitx_plugin_00_03 splitx_plugin_00_04 splitx_plugin_00_05 splitx_plugin_00_06 splitx_plugin_00_07 splitx_plugin_00_08

splitx_left

[object] splitx_left ()

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Splits an image vertically.

The split point is determined automatically by finding a valley in the projections near the left of the image.


Example 1: splitx_left()

images/OneBit_generic.png

splitx_left_plugin_00_00 splitx_left_plugin_00_01 splitx_left_plugin_00_02 splitx_left_plugin_00_03 splitx_left_plugin_00_04 splitx_left_plugin_00_05 splitx_left_plugin_00_06 splitx_left_plugin_00_07

splitx_max

[object] splitx_max (FloatVector center = [0.5])

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom, Karl MacMillan and Christoph Dalitz

Splits an image vertically.

The split point is determined automatically by finding a peak in the projections near center.

This function is overloaded to work both with a single value and a list of splitting point candidates as input.


Example 1: splitx_max()

images/OneBit_generic.png

splitx_max_plugin_00_00 splitx_max_plugin_00_01 splitx_max_plugin_00_02 splitx_max_plugin_00_03 splitx_max_plugin_00_04 splitx_max_plugin_00_05 splitx_max_plugin_00_06 splitx_max_plugin_00_07 splitx_max_plugin_00_08

splitx_right

[object] splitx_right ()

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Splits an image vertically.

The split point is determined automatically by finding a valley in the projections near the right of the image.


Example 1: splitx_right()

images/OneBit_generic.png

splitx_right_plugin_00_00 splitx_right_plugin_00_01 splitx_right_plugin_00_02 splitx_right_plugin_00_03 splitx_right_plugin_00_04 splitx_right_plugin_00_05 splitx_right_plugin_00_06

splity

[object] splity (FloatVector center = [0.5])

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom, Karl MacMillan and Christoph Dalitz

Splits an image horizontally.

The split point is determined automatically by finding a valley in the projections near center.

This function is overloaded to work both with a single value and a list of splitting point candidates as input.


Example 1: splity()

images/OneBit_generic.png

splity_plugin_00_00 splity_plugin_00_01 splity_plugin_00_02 splity_plugin_00_03 splity_plugin_00_04 splity_plugin_00_05 splity_plugin_00_06

splity_bottom

[object] splity_bottom ()

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Splits an image horizontally.

The split point is determined automatically by finding a valley in the projections near the bottom of the image.


Example 1: splity_bottom()

images/OneBit_generic.png

splity_bottom_plugin_00_00 splity_bottom_plugin_00_01 splity_bottom_plugin_00_02 splity_bottom_plugin_00_03 splity_bottom_plugin_00_04 splity_bottom_plugin_00_05 splity_bottom_plugin_00_06

splity_top

[object] splity_top ()

Operates on:Image [OneBit]
Returns:[object]
Category:Segmentation
Defined in:segmentation.py
Author:Michael Droettboom and Karl MacMillan

Splits an image horizontally.

The split point is determined automatically by finding a valley in the projections near the top of the image.


Example 1: splity_top()

images/OneBit_generic.png

splity_top_plugin_00_00 splity_top_plugin_00_01 splity_top_plugin_00_02 splity_top_plugin_00_03 splity_top_plugin_00_04 splity_top_plugin_00_05