|
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 |
| bool | all_areas_bigger_than (int32_t min_area) |
| 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) |
| void | process_overlapping_edges () |
| uint8_t | getPixel (const std::vector< uint8_t > &img, int w, int h, int x, int y) |
| std::vector< uint8_t > | analyzeJunctions (const std::vector< uint8_t > &skel, int w, int h) |
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 |
|
inline |
| bool Graph::add_edge | ( | int32_t | node_id1, |
| int32_t | node_id2 | ||
| ) |
Definition at line 53 of file graph.cpp.
| bool Graph::all_areas_bigger_than | ( | int32_t | min_area | ) |
|
protected |
@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 221 of file graph.cpp.
References getPixel().
Here is the call graph for this function:| void Graph::clear_unconnected_nodes | ( | ) |
| void Graph::compute_contours | ( | ) |
Definition at line 264 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 112 of file graph.cpp.
|
inline |
|
inlineprotected |
@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
Definition at line 52 of file graph.h.
Referenced by analyzeJunctions().
Here is the caller graph for this function:
|
protected |
| bool Graph::merge_nodes | ( | const Node_ptr & | node_to_keep, |
| const Node_ptr & | node_to_remove | ||
| ) |
Definition at line 70 of file graph.cpp.
| void Graph::merge_small_area_nodes | ( | const int32_t | min_area, |
| const int32_t | min_thickness = 0 |
||
| ) |
Definition at line 399 of file graph.cpp.
|
protected |
Definition at line 146 of file graph.cpp.
|
inline |
|
protected |
|
protected |