(mark, mesh, node)
| 719 | return mesh |
| 720 | |
| 721 | def judge_dangle(mark, mesh, node): |
| 722 | if not (1 <= node[0] < mesh.graph['H']-1) or not(1 <= node[1] < mesh.graph['W']-1): |
| 723 | return mark |
| 724 | mesh_neighbors = [*mesh.neighbors(node)] |
| 725 | mesh_neighbors = [xx for xx in mesh_neighbors if 0 < xx[0] < mesh.graph['H'] - 1 and 0 < xx[1] < mesh.graph['W'] - 1] |
| 726 | if len(mesh_neighbors) >= 3: |
| 727 | return mark |
| 728 | elif len(mesh_neighbors) <= 1: |
| 729 | mark[node[0], node[1]] = (len(mesh_neighbors) + 1) |
| 730 | else: |
| 731 | dan_ne_node_a = mesh_neighbors[0] |
| 732 | dan_ne_node_b = mesh_neighbors[1] |
| 733 | if abs(dan_ne_node_a[0] - dan_ne_node_b[0]) > 1 or \ |
| 734 | abs(dan_ne_node_a[1] - dan_ne_node_b[1]) > 1: |
| 735 | mark[node[0], node[1]] = 3 |
| 736 | |
| 737 | return mark |
| 738 | |
| 739 | def remove_dangling(mesh, edge_ccs, edge_mesh, info_on_pix, image, depth, config): |
| 740 |
nothing calls this directly
no outgoing calls
no test coverage detected