GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — examples/sample_orb: fix coordinate un-scaling and outline width defects in training code · Issue #142 · webarkit/jsfeatNext Closed Closed Copy link DescriptionNote Update (2026-08-24): The overshoot on the right side was confirmed to be caused by a bad printed target image (shrunk/squished aspect ratio, e.g., via A4 "Fit to Page" print settings), which is the same problem documented in webarkit/WebARKitLib-rs#240. Testing with the original "pinball" image displayed directly on a smartphone screen (at a 1:1 pixel aspect ratio) worked perfectly as expected. Thus, the overshoot is not caused by a "homography estimation error" or a code bug in SummaryIn Investigating it turned up two real defects in the example's training code. Both are genuine and worth fixing, but together they account for well under 1%, so they do not explain the observed overshoot. Filing everything found so the next person does not have to re-derive it. Defect 1 — the outline is drawn one pixel narrower than the pattern frame
var shape_pts = tCorners(homo3x3.data, pattern_preview.cols * 2, pattern_preview.rows * 2); and the preview is built by halving with pattern_preview = new jsfeat.matrix_t(new_width >> 1, new_height >> 1, ...); For
The round-trip only survives even dimensions. Drawing from Defect 2 — level coordinates are un-scaled by the requested scale, not the achieved oneIn the per-level loop the image is resized with a truncated target: new_width = (lev0_img.cols * sc) | 0; new_height = (lev0_img.rows * sc) | 0; imgproc.resample(lev0_img, lev_img, new_width, new_height); but the detected keypoints are mapped back with the requested scale: lev_corners[i].x *= 1. / sc; lev_corners[i].y *= 1. / sc; The achieved scale is
Two things worth noting:
These feed slightly wrong keypoint coordinates into the homography fit, so they degrade the estimate rather than shifting the outline directly. What is probably causing the visible overshootNeither defect above reaches 1%, so the observed error is most likely homography estimation error, not a drawing bug. In the reported session the ORB matches are heavily concentrated on the left and centre of the target — the bright, high-contrast pinball artwork — while the right portion is darker and more foreshortened, contributing very few correspondences. A homography fitted from correspondences clustered on one side extrapolates least accurately on the opposite side, which is exactly where the error appears. Attempted diagnostic: hold the target flat and fronto-parallel and see whether the overshoot changes. Result inconclusive — no obvious change was observed, but holding a hand-held print flat enough for this to be decisive is difficult, so this neither confirms nor rules out the hypothesis. If this is the cause, the effective fix is not in this example: it is #134 (GMS), which filters geometrically inconsistent matches before Suggested scope
Notes
Activity
| ||||||||||||||||||||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |