|
Img2Num C++ (Internal Developer Docs) dev
API Documentation
|
Collaboration diagram for Graph:Public Member Functions | |
| Graph (std::unique_ptr< std::vector< Node_ptr > > &nodes, int width, int height) | |
| bool | add_edge (int32_t node_id1, int32_t node_id2) |
| bool | merge_nodes (const Node_ptr &node_to_keep, const Node_ptr &node_to_remove) |
| void | clear_unconnected_nodes () |
| const std::vector< Node_ptr > & | get_nodes () const |
| const size_t | size () |
| void | discover_edges (const std::vector< int32_t > ®ion_labels, const int32_t width, const int32_t height) |
| void | merge_small_area_nodes (const int32_t min_area, const int32_t min_thickness=0) |
| void | compute_contours () |
Protected Member Functions | |
| void | hash_node_ids (void) |
Protected Attributes | |
| int | m_width |
| int | m_height |
| std::unique_ptr< std::vector< Node_ptr > > | m_nodes |
| std::unordered_map< int32_t, int32_t > | m_node_ids |
|
inline |
@brief Safely retrieves a pixel value from a binary image with bounds checking.
@param img Binary image buffer @param w Image width @param h Image height @param x Pixel x-coordinate @param y Pixel y-coordinate @return Pixel value at (x, y), or 0 if out of bounds @brief Analyzes a skeleton image to detect junction points using 8-neighbor crossing-number.
Scans the skeleton image and marks pixels as junctions where three or more branches meet, using the crossing-number method (counts 0→1 transitions in the 8-neighbor ring).
@param skel Binary skeleton image (nonzero = skeleton pixel) @param w Image width @param h Image height @return Junction mask with nonzero entries marking junction pixels
Definition at line 66 of file graph.h.
|
inline |
| bool Graph::add_edge | ( | int32_t | node_id1, |
| int32_t | node_id2 | ||
| ) |
Definition at line 30 of file graph.cpp.
| void Graph::clear_unconnected_nodes | ( | ) |
| void Graph::compute_contours | ( | ) |
Definition at line 123 of file graph.cpp.
| void Graph::discover_edges | ( | const std::vector< int32_t > & | region_labels, |
| const int32_t | width, | ||
| const int32_t | height | ||
| ) |
Definition at line 89 of file graph.cpp.
|
inline |
|
protected |
| bool Graph::merge_nodes | ( | const Node_ptr & | node_to_keep, |
| const Node_ptr & | node_to_remove | ||
| ) |
Definition at line 47 of file graph.cpp.
| void Graph::merge_small_area_nodes | ( | const int32_t | min_area, |
| const int32_t | min_thickness = 0 |
||
| ) |
Definition at line 258 of file graph.cpp.
|
inline |
|
protected |
|
protected |