Blob extraction and disjoint collection of blobs (specification). More...
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | blob |
Blob information. More... |
Enumerations | |
enum | blob_strategy { blob_boolean, blob_positive } |
Blob extraction strategy. More... |
Functions | |
struct blob_set * | blob_set_new () |
Create a new empty blob set. | |
void | blob_set_delete (struct blob_set *s) |
Delete a blob set. | |
void | blob_set_insert (struct blob_set *s, const struct blob *blob) |
Insert a blob into a blob set. | |
bool | blob_set_contains (const struct blob_set *s, const struct blob *blob) |
Check if a blob is contained in a blob set. | |
struct blob * | find_blobs0 (int *blob_count, int width, int height, const float *glitched, enum blob_strategy strategy, int i0, int i1, int j0, int j1) |
Extract blobs from an image region using a strategy. | |
struct blob * | find_blobs1 (int *blob_count, int width, int height, const float *glitched) |
Extract blobs from a whole image using blob_boolean strategy. | |
struct blob * | find_blobs2 (int *blob_count, int width, int height, const float *glitched, const struct blob *blob) |
Extract sub-blobs from an image using blob_positive strategy. |
Blob extraction and disjoint collection of blobs (specification).
Definition in file blob_set.h.
struct blob |
Blob information.
Definition at line 19 of file blob_set.h.
Data Fields | ||
---|---|---|
int | count | Number of pixels in the blob. |
float | error | Blob error count. |
int64_t | i | Total of pixel i coordinates. |
int64_t | j | Total of pixel j coordinates. |
int | label | Label for union-find (internal use). |
int | max_i | Maximum pixel i coordinate. |
int | max_j | Maximum pixel j coordinate. |
int | min_i | Minimum pixel i coordinate. |
int | min_j | Minimum pixel j coordinate. |
enum blob_strategy |
Blob extraction strategy.
blob_boolean |
Consider all glitched pixels equal. |
blob_positive |
Consider glitched pixels equal only if their glitch counts are equal too. |
Definition at line 70 of file blob_set.h.
Check if a blob is contained in a blob set.
s | A blob set. |
blob | A blob. |
true
if the blob is in the set, false
otherwise. Definition at line 61 of file blob_set.c.
References blob_set_node::blob, blob::count, blob::i, blob::j, blob_set_node::next, and blob_set::set.
Referenced by find_ref().
void blob_set_delete | ( | struct blob_set * | s | ) |
Delete a blob set.
s | A blob set. |
Definition at line 39 of file blob_set.c.
References blob_set_node::next, and blob_set::set.
Referenced by fpxx_start().
Insert a blob into a blob set.
s | A blob set. |
blob | A blob. |
Definition at line 51 of file blob_set.c.
References blob_set_node::blob, blob::count, blob::i, blob::j, blob::label, blob_set_node::next, and blob_set::set.
Referenced by find_ref().
|
read |
Create a new empty blob set.
Definition at line 35 of file blob_set.c.
Referenced by fpxx_start().
|
read |
Extract blobs from an image region using a strategy.
blob_count | The number of extracted blobs is stored here. |
width | The glitch count image width. |
height | The glitch count image height. |
glitched | The glitch count image. |
strategy | The strategy to use. |
i0 | The lower i coordinate of the image region (eg: 0). |
i1 | The upper i coordinate of the image region (eg: width). |
j0 | The lower j coordinate of the image region (eg: 0). |
j1 | The upper j coordinate of the image region (eg: height). |
Definition at line 170 of file blob_set.c.
References blob_boolean, cmp_blob_count_desc(), cmp_blob_error_desc(), cmp_label(), blob::count, blob::error, label::error, ufs::height, blob::i, label::i, blob::j, label::j, blob::label, label::label, ufs::labels, max(), blob::max_i, blob::max_j, min(), blob::min_i, blob::min_j, ufs::nodes, uf_find(), uf_singleton(), uf_union(), and ufs::width.
Referenced by find_blobs1(), and find_blobs2().
Extract blobs from a whole image using blob_boolean
strategy.
blob_count | The number of extracted blobs is stored here. |
width | The glitch count image width. |
height | The glitch count image height. |
glitched | The glitch count image. |
Definition at line 299 of file blob_set.c.
References blob_boolean, and find_blobs0().
Referenced by find_ref().
|
read |
Extract sub-blobs from an image using blob_positive
strategy.
blob_count | The number of extracted blobs is stored here. |
width | The glitch count image width. |
height | The glitch count image height. |
glitched | The glitch count image. |
blob | The blob determines the region to search within. |
Definition at line 303 of file blob_set.c.
References blob_positive, find_blobs0(), blob::max_i, blob::max_j, blob::min_i, and blob::min_j.
Referenced by find_ref().