Count track elements that reference (image_id, point2D_idx) out of range.
(rec: "pycolmap.Reconstruction")
| 63 | |
| 64 | |
| 65 | def _count_dangling(rec: "pycolmap.Reconstruction") -> int: |
| 66 | """Count track elements that reference (image_id, point2D_idx) out of range.""" |
| 67 | dangling = 0 |
| 68 | image_ids = set(rec.images) |
| 69 | for pid, point in rec.points3D.items(): |
| 70 | for el in point.track.elements: |
| 71 | if el.image_id not in image_ids: |
| 72 | dangling += 1 |
| 73 | continue |
| 74 | img = rec.images[el.image_id] |
| 75 | if el.point2D_idx >= len(img.points2D): |
| 76 | dangling += 1 |
| 77 | return dangling |
| 78 | |
| 79 | |
| 80 | class TestUntransformedRoundtrip: |
no test coverage detected