MCPcopy Create free account
hub / github.com/davisking/dlib / number_of_neighbors

Method number_of_neighbors

dlib/test/graph_cuts.cpp:166–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 ) const { return factors1.nr(); }
165
166 unsigned long number_of_neighbors (
167 unsigned long idx
168 ) const
169 {
170 ++count;
171 const point& p = get_loc(idx);
172 if (inner_rect.contains(p))
173 return 4;
174 else if (p == rect.tl_corner() ||
175 p == rect.bl_corner() ||
176 p == rect.tr_corner() ||
177 p == rect.br_corner() )
178 return 2;
179 else
180 return 3;
181 }
182
183 unsigned long get_neighbor_idx (
184 long node_id1,

Callers

nothing calls this directly

Calls 5

containsMethod · 0.45
tl_cornerMethod · 0.45
bl_cornerMethod · 0.45
tr_cornerMethod · 0.45
br_cornerMethod · 0.45

Tested by

no test coverage detected