tests/fixtures/spectre_truth.json, test_reference.py, docs/reference.md: the rendered roof's accuracy read from takes searched off the answer (72, six families of seed), stated as what holds: worst corner within 1.18 x the worst traced point x the coarser view's pixel, the test at 1.42; the rms-noise bound dropped; START pinned between a plate that blocks (0.831, 16.5 degrees) and one refused (1.241, 11 degrees) and its comment corrected; FAIR's table with its refused draws (cut trace-block, Soul s2)
bound-premise-seeded-by-truth: the fixture keeps the truth-seeded strokes for the fairness readings and says what they are; takes are the same search from a seed moved 0.5 to 1.5 px as one or 1 to 3 px a vertex. 62 of 72 block, no family stands out of the bound: the draws Soul's probe read at 3.5 to 6.5 had grown a side, and the probe read the vertex after a grown side's inner point as the next corner; by the crown's chains they stand at 0.40 to 0.75 (135 blocked draws of his 168: 1.19 at most). start-unpinned-and-comment-stale: START 0.6 and 0.8 refuse the 16.5 degree plate, 2.0, 2.6 and 3.3 block the 11. fair-table-drops-refusals: 19 to 27 of 168 refused, rising with FAIR; Soul's seeds named. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
e98b6a4da1
commit
5dee3c685a
4 changed files with 134 additions and 72 deletions
|
|
@ -748,7 +748,7 @@ def fit_sheet(document, cage, frame, traces, cams, share=0.1, tol=TOL):
|
|||
FAIR = 0.2 # a side's second differences of this share of its chord cost what one pixel of miss does (0.02 held a bowed side straight; docs/reference.md)
|
||||
K_MAX = 6 # points a side grows to before its trace is refused as fit_runs refuses it
|
||||
SQUARE = 0.4 # the cosine between a plane's normal and a sight line under which a trace is not lifted onto it: past 66 degrees the lift stretches over 2.5 times
|
||||
START = 1.0 # a corner's views start it where one pixel moves their meeting point less than this x share x the plate's extent, the prior's own scale: past it the views alone hold the corner looser than the plane would (tests/test_reference.py BlockTests reads 0.50 at 19 degrees and 1.90 at 5, Paladin's lens and range)
|
||||
START = 1.0 # a corner's views start it where one pixel moves their meeting point less than this x share x the plate's extent, the prior's own scale: past it the views alone hold the corner looser than the plane would. 1 is the prior's own unit, not a derived value: tests/test_reference.py BlockTests pins it between a plate that must block (its third corner starts at 0.831, views 16.5 degrees apart at Paladin's lens and range) and one that must be refused (1.241, 11 degrees)
|
||||
VIEWS = 0.2 # a prior_share under this: the views decide the point (fit_shell's line)
|
||||
FLARE, DROP, DOME = 0.05, 0.06, 0.017 # of the crown's extent (its two furthest points): a plate's skirt out from and back of its crown, and its centre's rise. A template's proportions, not readings: the crown is what is solved
|
||||
TRACE_KEYS = ("camera", "box", "frame", "from", "to", "side", "line")
|
||||
|
|
|
|||
|
|
@ -294,9 +294,13 @@ Where a corner's depth comes from, in this order:
|
|||
|
||||
- **the views**, where two or more see it and one pixel moves the point their sight lines meet at less than
|
||||
`share` x the plate's extent, the prior's own scale. Past that the views alone hold the corner looser than the
|
||||
plane would and are not used as its start. The line is metres a pixel, so it moves with lens and range: a
|
||||
1.2 m plate 17.6 m off at 663 px reads 0.74 of the scale at 19 degrees and 2.77 at 5, where its corners landed
|
||||
0.25 to 1.5 m off; through a lens three times as long it reads 0.66 at 7 degrees and blocks.
|
||||
plane would and are not used as its start. That factor of 1 is the prior's own unit, not a derived value; the
|
||||
tests pin it between a plate that blocks and one that is refused. The line is metres a pixel, so it moves
|
||||
with lens and range: a 1.2 m plate 17.6 m off at 663 px has three corners started at 0.72 of the scale with
|
||||
its views 19 degrees apart, 0.83 at 16.5, 1.24 at 11 and 2.73 at 5. With no plane given it blocks down to
|
||||
16.5 degrees (73 mm from the truth) and is refused at 11, where it would have stood 104 mm off: the line
|
||||
switches blocking and refusal, it is no cliff in accuracy. At 5 degrees its corners landed 0.25 to 1.5 m off;
|
||||
through a lens three times as long it starts at 0.65 at 7 degrees and blocks.
|
||||
- **the mirror plane**, for a seam corner whose sight line crosses x = 0 at 24 degrees or more.
|
||||
- **a plane**, for the rest: `plane` (`x,y,z; nx,ny,nz`, a point and the normal, in the frame), or with none given
|
||||
the plane through the corners the views and the seam decide, three or more. A corner one view sees is lifted
|
||||
|
|
@ -342,36 +346,62 @@ from the others (name it in `seam`, or trace it where the views agree), a side n
|
|||
sheet the cage's parser does not take, and a result that could pass the 16000 characters a receipt carries.
|
||||
|
||||
Measured against a known truth (`tests/test_reference.py` BlockTests, Python 3.13 on Starfire;
|
||||
`tests/fixtures/spectre_truth.json`). SPECTRE's pass-3 roof, a hard mirrored cage of 11 vertices, was built by
|
||||
`brokkr_kitbash.shell`, rendered in Blender 5.3 through SPECTRE's two solved cameras at the sheet's pixel size,
|
||||
and its edges traced off the renders: the ridge in the side view, the lip, outer edge and rear edge in the
|
||||
hero's mirrored half and the side view, 62 degrees apart. The side view's pixel is 27.6 mm across at the plate.
|
||||
`tests/fixtures/spectre_truth.json`), on one plate through one pair of views. SPECTRE's pass-3 roof, a hard
|
||||
mirrored cage of 11 vertices, was built by `brokkr_kitbash.shell` and rendered in Blender 5.3 through SPECTRE's
|
||||
two solved cameras at the sheet's pixel size. Its edges were traced off the renders: the ridge in the side
|
||||
view, the lip, outer edge and rear edge in the hero's mirrored half and the side view, 62 degrees apart. The
|
||||
side view's pixel is 27.6 mm across at the plate.
|
||||
|
||||
| traces | worst corner from the truth |
|
||||
| --- | --- |
|
||||
| as taken off the renders (up to 2.5 px from the truth's projection) | 39 mm |
|
||||
| every point 1 px off, 12 draws | 69 mm median, 96 mm at most |
|
||||
| every point 2 px off, 12 draws | 125 mm median, 190 mm at most |
|
||||
How the traces were taken. No hand drew them. A search follows a seed polyline, takes the strongest brightness
|
||||
step within a window across each edge, lays a straight stroke through the steps found on each segment, and ends
|
||||
each stroke where it crosses its neighbours. The seed is the truth's projection moved off the answer, twelve
|
||||
draws a family: the whole seed by 0.5, 1 or 1.5 px in a drawn direction (a 2.5 px window), or each of its
|
||||
vertices by a normal draw of 1 or 2 px (3.5 px) or 3 px (6 px). The takes' points end up 2.1 to 30.7 px from the
|
||||
truth's projection, 6.8 at the median: two strokes that run nearly along each other cross far from the corner.
|
||||
Every corner is named.
|
||||
|
||||
With every corner named, the worst corner of a blocked plate stood within 3.5 x the noise x the coarser view's
|
||||
pixel, on a floor of 1.4 of that pixel from the render itself. That is one plate through one pair of views, not
|
||||
a law. It is not a multiple of `m_per_px`: the same readings are 4.6 to 7.5 x noise x a view-decided corner's
|
||||
`m_per_px`, and a seam corner 98 mm off reports 0.0008 m a pixel, because `m_per_px` is depth along the sight
|
||||
line and most of this error lies across it. With only four corners named, the roof's ridge and outer edge are
|
||||
one side each and are built as smooth runs through their hard knees: explained within `tol`, 196 mm from the
|
||||
true edges (5.2 px is 144 mm there). Name a hard corner as a corner.
|
||||
| seed | window | blocked of 12 | worst traced point, px: median, most | worst corner, mm: median, most | worst corner over worst point x 27.6 mm, at most |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| moved 0.5 px as one | 2.5 px | 12 | 6.5, 30.7 | 173, 929 | 1.12 |
|
||||
| moved 1 px as one | 2.5 px | 12 | 7.1, 30.4 | 225, 916 | 1.16 |
|
||||
| moved 1.5 px as one | 2.5 px | 11 | 6.6, 16.5 | 148, 450 | 1.18 |
|
||||
| each vertex 1 px | 3.5 px | 10 | 4.8, 15.9 | 79, 458 | 1.04 |
|
||||
| each vertex 2 px | 3.5 px | 10 | 5.3, 17.6 | 131, 342 | 1.06 |
|
||||
| each vertex 3 px | 6 px | 7 | 10.2, 20.1 | 215, 436 | 1.11 |
|
||||
|
||||
What holds: the worst corner of a blocked plate stood within about 1.2 x the furthest any traced point stood
|
||||
from the truth's projection x the coarser view's pixel (1.18 over the 62 that blocked, which the test holds to
|
||||
1.42). No family stands out of it, and the three draws that grew a side read 0.51, 0.75 and 1.08. It is a
|
||||
reading on one plate and one pair of views, not a law, and it says a plate is as good as its worst traced
|
||||
point: one stroke end 30 px off puts a corner 0.9 m off, and nothing in the report says so, because that trace
|
||||
is explained. The ten not blocked were refused, nine at a side not explained at six points and one at the
|
||||
cage's parser. No bound is given in the traces' rms: against it the same readings run 0.57 to 5.3. The same
|
||||
search seeded on the truth's projection itself, with a 2.5 px window, reads 39 mm; that is the window ending
|
||||
every stroke within 2.5 px of the answer, and it is not an accuracy.
|
||||
|
||||
The error is not a multiple of `m_per_px` either: a seam corner 98 mm off reports 0.0008 m a pixel, because
|
||||
`m_per_px` is depth along the sight line and most of this error lies across it. With only four corners named,
|
||||
the roof's ridge and outer edge are one side each and are built as smooth runs through their hard knees:
|
||||
explained within `tol`, 196 mm from the true edges (5.2 px is 144 mm there). Name a hard corner as a corner.
|
||||
|
||||
Fairness, 0.2 x a side's chord, is set by known truth at traced noise. Over ten cells at 1 and 2 px (the rendered
|
||||
roof with four corners named, with and without closing strokes moved 3 px, and a bowed pentagon at 60 and 30
|
||||
degrees and in one view), the mean of the cells' 90th percentiles and the worst draw, in mm:
|
||||
roof with four corners named, its strokes those of the search seeded on the truth with the noise added, with
|
||||
and without closing strokes moved 3 px, and a bowed pentagon at 60 and 30 degrees and in one view), 168 draws:
|
||||
the mean of the cells' 90th percentiles and the worst draw, in mm, over the draws that blocked, and the draws
|
||||
refused, which no percentile counts:
|
||||
|
||||
| FAIR | 0.1 | 0.15 | 0.2 | 0.25 | 0.3 | 0.4 | 0.5 | 1 |
|
||||
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||
| mean 90th percentile | 194 | 184 | 178 | 178 | 179 | 186 | 193 | 196 |
|
||||
| worst draw | 301 | 275 | 273 | 272 | 312 | 382 | 494 | 577 |
|
||||
| refused of 168 | 19 | 20 | 23 | 24 | 24 | 25 | 26 | 27 |
|
||||
|
||||
From exact traces weaker fairness is nearer the truth (a pentagon bowed 35% of its sides: 42 mm at 0.2, 16 at
|
||||
0.5, 12 with none).
|
||||
A higher FAIR, which is weaker fairness, refuses more draws, so each column's percentiles are
|
||||
over a different set. On other seeds (Soul's probe, verdict cut-trace-block.s2, FAIR 0.1, 0.2, 0.3, 0.5) the
|
||||
mean 90th percentile read 216, 188, 216, 250, the worst draw 542, 855, 679, 807 and the refused 18, 21, 26,
|
||||
27: 0.2 is lowest by the 90th percentile on both sets of seeds and not by the worst draw on the second. From
|
||||
exact traces weaker fairness is nearer the truth (a pentagon bowed 35% of its sides: 42 mm at 0.2, 16 at 0.5,
|
||||
12 with none).
|
||||
|
||||
Agreement with other fits, which is not accuracy. SPECTRE's second-pass roof from its hand traces: the ridge
|
||||
7.3 mm at most and the brow a median of 8.4 mm from the cage `fit_shell` had fitted to the same pixels; with
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -778,14 +778,16 @@ def blocked_plate(views, traces, **more):
|
|||
return core.block_plate(views, {"corners": PLATE}, traces, kit.sheet, **more)
|
||||
|
||||
|
||||
def rendered(name, corners, sigma=0.0, close=0.0, seed=0):
|
||||
def rendered(name, corners, sigma=0.0, close=0.0, seed=0, take=None):
|
||||
"""(views, plate, traces, the true sides, the fixture's plate) of a plate of tests/fixtures/spectre_truth.json
|
||||
with `corners` of its loop named: each stroke traced from the renders is cut at the named corners it passes
|
||||
through, every point `sigma` px off, a closing stroke moved `close` px as one."""
|
||||
through, every point `sigma` px off, a closing stroke moved `close` px as one. The strokes are the fixture's
|
||||
own, searched from the truth's projection, or those of its `take`, searched from a seed off it."""
|
||||
fixture = json.loads((Path(__file__).resolve().parent / "fixtures" / "spectre_truth.json").read_text(encoding="utf-8"))
|
||||
plate, rng, views, traces = fixture["plates"][name], np.random.default_rng(seed), [], []
|
||||
for stroke in plate["strokes"]:
|
||||
line = np.array(stroke["line"]) + (rng.normal(0, sigma, (len(stroke["line"]), 2)) if sigma else 0.0)
|
||||
for k, stroke in enumerate(plate["strokes"]):
|
||||
line = np.array(stroke["line"] if take is None else plate["takes"][take]["lines"][k])
|
||||
line = line + (rng.normal(0, sigma, line.shape) if sigma else 0.0)
|
||||
if stroke["closing"] and close:
|
||||
turn = rng.uniform(0, 2 * math.pi)
|
||||
line = line + close * np.array([math.cos(turn), math.sin(turn)])
|
||||
|
|
@ -802,6 +804,15 @@ def rendered(name, corners, sigma=0.0, close=0.0, seed=0):
|
|||
return views, {"corners": named, "mirror": True, "seam": [corner for corner in plate["seam"] if corner in corners]}, traces, sides, (fixture, plate)
|
||||
|
||||
|
||||
def off_projection(fixture, plate, take):
|
||||
"""The furthest a point of a take's strokes stands from the truth's projection, px."""
|
||||
worst = 0.0
|
||||
for stroke, line in zip(plate["strokes"], plate["takes"][take]["lines"]):
|
||||
drawn = core.seen(fixture["cameras"][stroke["view"]], fixture["frames"][stroke["view"]], np.array([plate["truth"][corner] for corner in stroke["through"]]) * [stroke["side"], 1, 1])
|
||||
worst = max(worst, float(np.linalg.norm(np.array(line) - drawn, axis=1).max()))
|
||||
return worst
|
||||
|
||||
|
||||
def off_rendered(out, sides):
|
||||
"""(the furthest a blocked corner stands from its own, the furthest a side as built and its true edge, a polyline
|
||||
through the truth's corners, stand apart either way), metres."""
|
||||
|
|
@ -828,7 +839,7 @@ class BlockTests(unittest.TestCase):
|
|||
S1 a seam point labelled mirror whatever its share test_a_seam_corner_says_what_decided_it
|
||||
S2 a seam corner never sent to the plane's guard test_a_seam_corner_says_what_decided_it
|
||||
I1 a side's label from its first point only, never plane test_a_side_says_what_decided_its_inner_points
|
||||
T06 START 0.6, T3 START 3.3 test_views_5_degrees_apart_take_their_depth_from_a_plane_or_are_refused
|
||||
T06, T08, T2, T26, T3 START 0.6, 0.8, 2.0, 2.6, 3.3 test_views_5_degrees_apart_take_their_depth_from_a_plane_or_are_refused
|
||||
K1 a skirt of fixed metres test_a_plate_keeps_its_proportions_at_any_size
|
||||
|
||||
What the blocking is worth against a known truth is test_the_rendered_roof_blocks_from_traces_of_its_renders:
|
||||
|
|
@ -854,14 +865,23 @@ class BlockTests(unittest.TestCase):
|
|||
kit.sheet(out["sheet"])
|
||||
|
||||
def test_views_5_degrees_apart_take_their_depth_from_a_plane_or_are_refused(self):
|
||||
"""block-low-parallax, T06, T3. The views start a corner where one pixel moves their meeting point less than
|
||||
core.START x share x the plate's extent, the prior's own scale. At Paladin's lens and range that reads 0.74
|
||||
of the scale at 19 degrees (test_a_twisted_bowed_plate_blocks_from_two_views blocks there; T06 refuses it)
|
||||
and 2.77 at 5, where the corners triangulate 0.25 to 1.5 m off: no corner is started. With a plane every
|
||||
corner is decided by it (prior_share 0.795 to 0.838); with none the plate is refused naming the corners (T3
|
||||
blocks it). The line is metres a pixel, not degrees: through a lens three times as long the same plate 7
|
||||
degrees apart reads 0.66 and blocks from its views, 60.5 mm from the truth (65.0 at 19 degrees through the
|
||||
short lens)."""
|
||||
"""block-low-parallax, T06, T3, T08, T2, T26 (Soul s2, start-unpinned-and-comment-stale). The views start a
|
||||
corner where one pixel moves their meeting point less than core.START x share x the plate's extent, the
|
||||
prior's own scale; with no plane a plate blocks when three corners start. START is 1, the prior's own
|
||||
unit: it is not derived from a measurement, it is pinned between two. At Paladin's lens and range the
|
||||
pentagon's third corner starts at START 0.724 with the views 19 degrees apart, 0.831 at 16.5, 1.241 at 11
|
||||
and 2.729 at 5. So at 16.5 degrees it blocks with no plane (73.0 mm from the truth) and at 11 it is
|
||||
refused naming its corners: 1 stands 1.20 over the one reading and 1.24 under the other, the two's
|
||||
geometric mean within 2%. START 0.6 and 0.8 refuse the 16.5 degrees; 2.0, 2.6 and 3.3 block the 11 (104.4
|
||||
mm off; the line switches blocking and refusal and is no cliff in accuracy). At 5 degrees the corners
|
||||
triangulate 0.25 to 1.5 m off: with a plane every corner is decided by it (prior_share 0.795 to 0.838),
|
||||
with none the plate is refused. The line is metres a pixel, not degrees: through a lens three times as
|
||||
long the same plate 7 degrees apart starts at 0.648 and blocks from its views, 60.5 mm from the truth
|
||||
(65.0 at 19 degrees through the short lens)."""
|
||||
sides = pentagon(0.08)
|
||||
self.assertEqual(blocked_plate(*plate_traces([plate_camera(0), plate_camera(16.5)], sides, 0.5))["plane"]["from"], "corners")
|
||||
with self.assertRaisesRegex(core.ReferenceFitError, r"^plane: none was given, and 'c0', 'c1', 'c2', 'c3', 'c4' are decided by no view"):
|
||||
blocked_plate(*plate_traces([plate_camera(0), plate_camera(11)], sides, 0.5))
|
||||
views, traces = plate_traces([plate_camera(0), plate_camera(5)], pentagon(0.08), 0.5)
|
||||
out = blocked_plate(views, traces, plane=ON_Y)
|
||||
self.assertEqual([corner["decided_by"] for corner in out["corners"]], ["plane"] * 5)
|
||||
|
|
@ -1008,41 +1028,50 @@ class BlockTests(unittest.TestCase):
|
|||
self.assertEqual(out["sheet"]["poles"], [seam[0], seam[1], len(out["sheet"]["verts"]) - 1])
|
||||
|
||||
def test_the_rendered_roof_blocks_from_traces_of_its_renders(self):
|
||||
"""block-truth (Soul s1, real-readings-not-accuracy), M3. SPECTRE's pass-3 roof, a hard mirrored cage of 11
|
||||
known vertices, built by brokkr_kitbash.shell, rendered through SPECTRE's two solved cameras at the
|
||||
sheet's pixel size and its edges traced off the renders (tests/fixtures/spectre_truth.json says how). The
|
||||
ridge is traced in the side view alone, the lip, the outer edge and the rear edge in the hero's mirrored
|
||||
half and in the side view, 62 degrees apart; the side view's pixel is 27.6 mm across at the plate, the
|
||||
hero's 11.6.
|
||||
"""block-truth (Soul s1, real-readings-not-accuracy; Soul s2, bound-premise-seeded-by-truth), M3. SPECTRE's
|
||||
pass-3 roof, a hard mirrored cage of 11 known vertices, built by brokkr_kitbash.shell, rendered through
|
||||
SPECTRE's two solved cameras at the sheet's pixel size and its edges traced off the renders: one plate,
|
||||
one pair of views. The ridge is traced in the side view alone, the lip, the outer edge and the rear edge
|
||||
in the hero's mirrored half and in the side view, 62 degrees apart; the side view's pixel is 27.6 mm
|
||||
across at the plate, the hero's 11.6.
|
||||
|
||||
Every corner named: the ridge's six are decided by the mirror plane, the outer edge's five by the views
|
||||
(prior_share 0.038 at most). From the traces as taken the worst corner stands 39.1 mm from the truth, 1.42
|
||||
of the side view's pixels (Blender builds the cage's vertices up to 15.1 mm inside it, the bevel; a
|
||||
stroke stands up to 2.5 px from the truth's projection). With every traced point 1 px off, twelve draws:
|
||||
68.6 mm at the median, 96.1 at most; 2 px: 125.1 and 190.1. That is 3.5 x the noise x the coarser view's
|
||||
pixel, and the bounds are tolerances 1.2 over it: no mutant is claimed by a margin here (M1 reads 49.3,
|
||||
116.6 and 206.5, under 1.3 away). M3 lands the ridge off x = 0 and is refused. The same readings are 4.6
|
||||
to 7.5 x noise x a view-decided corner's m_per_px, and a seam corner's m_per_px (0.0008) says nothing of
|
||||
its 98 mm: m_per_px is a depth sensitivity, and most of this error lies across the sight line."""
|
||||
The traces are the fixture's takes (tests/fixtures/spectre_truth.json says how): a search for the
|
||||
strongest brightness step across each edge, from a seed that is not on the answer. Six families of twelve
|
||||
draws: the truth's projection moved as one by 0.5, 1 and 1.5 px in a drawn direction (a 2.5 px window),
|
||||
and each of its vertices moved by a normal draw of 1 and 2 px (3.5 px) and of 3 px (6 px). Such a take's
|
||||
points stand 2.1 to 30.7 px from the truth's projection, 6.8 at the median: a stroke ends where it
|
||||
crosses its neighbours, and two that run nearly along each other cross far off. 62 of the 72 block (12,
|
||||
12, 11, 10, 10, 7 by family; nine are refused at a side not explained at six points, one at the cage's
|
||||
parser), every one with the ridge's six corners decided by the mirror plane and the outer edge's five by
|
||||
the views (prior_share 0.037 at most).
|
||||
|
||||
What holds: a blocked plate's worst corner stands within 1.18 x its take's worst point x the coarser
|
||||
view's pixel (1.12, 1.16, 1.18, 1.04, 1.06, 1.11 by family), 33 to 929 mm, 142 at the median; the bound is
|
||||
a tolerance 1.2 over that, and no mutant is claimed by a margin (M1 reads 1.31). No family stands out of
|
||||
it: the three draws that grow a side stand at 0.51, 0.75 and 1.08. M3 lands the ridge off x = 0 and every
|
||||
take is refused. No bound is stated in the takes' rms: a take's worst corner follows its worst point,
|
||||
and against the rms the same readings reach 5.3. A search seeded on the truth's projection itself is no
|
||||
reading: its 2.5 px window ends its strokes 2.5 px off and its plate 39 mm off."""
|
||||
corners = ["ridge_rear", "r4", "r3", "r2", "r1", "nose", "a", "b", "c", "d", "e"]
|
||||
views, plate, traces, sides, (fixture, record) = rendered("roof", corners)
|
||||
middle = np.mean(list(record["truth"].values()), axis=0)
|
||||
pixel = max(float(np.linalg.norm(np.array(cam["C"]) - middle)) / cam["f"] for cam in fixture["cameras"].values())
|
||||
self.assertAlmostEqual(pixel, 0.0276, places=4)
|
||||
out = core.block_plate(views, plate, traces, kit.sheet)
|
||||
self.assertEqual([corner["decided_by"] for corner in out["corners"]], ["mirror"] * 6 + ["views"] * 5)
|
||||
self.assertLess(max(corner["prior_share"] for corner in out["corners"]), core.VIEWS / 1.2)
|
||||
self.assertGreater(min(corner["parallax_deg"] for corner in out["corners"][6:]), 59)
|
||||
self.assertEqual([side["points"] for side in out["sides"]], [2] * 11)
|
||||
self.assertEqual(float(np.abs(np.array(out["sheet"]["verts"])[:6, 0]).max()), 0.0)
|
||||
self.assertLess(off_rendered(out, sides)[0], 1.7 * pixel)
|
||||
for sigma in (1.0, 2.0):
|
||||
worst = []
|
||||
for seed in range(12):
|
||||
views, plate, traces, sides, _ = rendered("roof", corners, sigma, seed=seed)
|
||||
worst.append(off_rendered(core.block_plate(views, plate, traces, kit.sheet), sides)[0])
|
||||
self.assertLess(max(worst), 4.2 * sigma * pixel, sigma)
|
||||
self.assertLess(float(np.median(worst)), 2.8 * sigma * pixel, sigma)
|
||||
self.assertEqual(len(record["takes"]), 72)
|
||||
blocked = 0
|
||||
for take in range(len(record["takes"])):
|
||||
views, plate, traces, sides, _ = rendered("roof", corners, take=take)
|
||||
try:
|
||||
out = core.block_plate(views, plate, traces, kit.sheet)
|
||||
except core.ReferenceFitError:
|
||||
continue
|
||||
blocked += 1
|
||||
self.assertEqual([corner["decided_by"] for corner in out["corners"]], ["mirror"] * 6 + ["views"] * 5, take)
|
||||
self.assertLess(max(corner["prior_share"] for corner in out["corners"]), core.VIEWS / 1.2, take)
|
||||
self.assertGreater(min(corner["parallax_deg"] for corner in out["corners"][6:]), 59, take)
|
||||
self.assertEqual(max(abs(float(np.array(out["sheet"]["verts"])[chain[0], 0])) for chain in crown_chains(out)[:6]), 0.0, take)
|
||||
self.assertLess(off_rendered(out, sides)[0], 1.42 * off_projection(fixture, record, take) * pixel, take)
|
||||
self.assertGreaterEqual(blocked, 52)
|
||||
|
||||
def test_fairness_is_set_by_the_rendered_roof(self):
|
||||
"""fair (Soul s1, fair-default-tuned-to-a-fit), F5, M4, M2. The rendered roof with four corners named
|
||||
|
|
@ -1054,7 +1083,10 @@ class BlockTests(unittest.TestCase):
|
|||
of 196.9 and 369.5, separation 1.37 each side. Over ten cells of known truth at 1 and 2 px (this roof four
|
||||
ways, and the bowed pentagon at 60 and 30 degrees and in one view) the mean of the cells' 90th percentiles
|
||||
reads 194, 184, 178, 178, 179, 186, 193, 196 mm at FAIR 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 1 and the
|
||||
worst draw 301, 275, 273, 272, 312, 382, 494, 577: 0.2 stands at the low of both. From exact traces weaker
|
||||
worst draw 301, 275, 273, 272, 312, 382, 494, 577, over the draws that blocked: 19, 20, 23, 24, 24, 25,
|
||||
26, 27 of the 168 are refused and counted in neither. On Soul's seeds (verdict cut-trace-block.s2) 0.2 is
|
||||
again lowest by the 90th percentile and not by the worst draw. The roof's strokes here are the fixture's
|
||||
own, searched from the truth's projection, with the noise added on top. From exact traces weaker
|
||||
fairness is nearer the truth (the bowed pentagon: 41.6 mm at 0.2, 16.2 at 0.5, 12.1 with none); nobody
|
||||
traces exactly, and at 1 px the difference is 16 mm at 60 degrees and the other way at 30."""
|
||||
corners = ["ridge_rear", "nose", "a", "e"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue