| Feature ID | Type | Deviation | Tolerance | Result |
|---|
Click two points on the image to measure a feature. Repeat at 3–8 positions spread across the image — same feature, different locations.
Click the 4 corners of a known rectangle on your image in order: top-left → top-right → bottom-right → bottom-left.
Save and recall calibration settings per objective or magnification level.
Loupe supports multiple instrument modes — Microscope, Deflectometry, and Fringe Analysis — selectable from the mode dropdown in the top bar. Microscope is the default mode and provides precision measurement tools for camera or imported images.
Loupe is a multi-instrument platform. Each mode provides a dedicated workspace tailored to a different measurement technique.
Use the mode dropdown in the top bar to switch between instruments. The three available modes are:
| Mode | Purpose |
|---|---|
| Microscope | Precision 2D measurement of camera or imported images — calibration, annotation, DXF overlay, guided inspection. |
| Deflectometry | Phase-shifting deflectometry for measuring surface form of specular (reflective) parts using an iPad as a structured-light display. |
| Fringe Analysis | Interferometric fringe analysis for quantitative surface flatness measurement using an optical flat and monochromatic light. |
Each mode has its own workspace — switching modes does not discard your work in another mode. Toolbar contents, sidebar panels, and keyboard shortcuts are scoped to the active mode.
Phase-shifting deflectometry for measuring the surface form of specular (mirror-like, reflective) parts.
An iPad displays sinusoidal fringe patterns. The camera observes their reflection off the part surface. Distortions in the reflected fringes encode the surface slope, which is integrated (Frankot-Chellappa) to recover surface height. Eight phase-shifted captures per direction suppress LCD harmonic artifacts.
The iPad runs a companion page (deflectometry-screen.html) that connects to Loupe via WebSocket. Open the URL shown in the status badge on the iPad's browser. Connection is automatic — the badge turns green when linked.
The workspace has two columns. The left column shows the live camera preview, status badges, setup buttons, calibration, and settings. The right column has an action bar with processing controls and tabbed results below.
Prepare the system before measuring a part. Both steps are in the left column under Setup.
Captures frames with the display off to measure ambient light and sensor noise. This is subtracted from all subsequent captures. Re-run if lighting conditions change.
Place a flat reference mirror in the field of view, then click Baseline. Captures 8-step phase-shifted fringes in both X and Y directions. This establishes the reference surface that part measurements are compared against.
Converts the computed phase map from arbitrary phase units to physical surface height (micrometres).
Loupe fits a paraboloid to the measured phase and derives a phase-to-height scale factor from the known sphere geometry. After calibration, all results are reported in micrometres.
The sphere must be specular — chrome steel or ceramic balls work well. Use DIN 5401 grade G28 or better (G28 = 0.7 µm form tolerance). The sphere should fill a reasonable portion of the field of view for a good fit.
Configuration options in the left column under Settings.
| Setting | Description |
|---|---|
| Display device | Preset selector for the iPad model being used. Sets the pixel pitch (mm/pixel) so fringe frequency is calculated correctly for the physical display size. |
| Fringe frequency | Number of fringe periods across the display. Higher frequency gives more sensitivity but may alias on coarse surfaces. |
| Gamma | Pre-correction exponent (default 2.2) that compensates for nonlinear LCD response, so the sinusoidal pattern is truly sinusoidal as seen by the camera. Corrected value = 255 × (v/255)1/γ. |
The action bar at the top of the right column.
| Button | Description |
|---|---|
| Capture Part | Captures 8-step phase-shifted fringes of the part under test (both X and Y directions, 16 frames total). |
| Compute | Calculates wrapped phase, unwraps, subtracts the baseline, applies smoothing, and produces the surface deviation map. Also reloads the 3D view if it was open. |
| Reset | Clears all captured data and results. |
| Control | Description |
|---|---|
| Mask threshold | Slider — reject pixels with low fringe modulation (faint reflections or absent part). Adjusting this and recomputing updates the results. |
| Smoothing | Slider — Gaussian sigma applied to the unwrapped phase map. Reduces noise at the cost of spatial resolution. |
| Auto | Analyses the captured frame's frequency spectrum and selects a smoothing value that suppresses high-frequency noise while preserving surface features. |
Three tabs in the right column, below the action bar.
Shows wrapped and unwrapped phase maps for both X and Y fringe directions. The wrapped phase contains 2π jumps; the unwrapped phase is continuous and proportional to surface slope. Updates when you recompute.
Interactive Three.js viewer showing the reconstructed surface height as a 3D mesh. Use the Z exaggeration slider to amplify small deviations for visibility. Drag to rotate, scroll to zoom. Reloads automatically when you recompute.
Troubleshooting view with fringe modulation map, histogram of modulation values, and coverage statistics (percentage of pixels above the mask threshold). Low coverage or uneven modulation usually indicates stray light, poor surface reflectivity, or an out-of-focus image.
Monochromatic interferometric fringe analysis for quantitative surface flatness measurement.
When a flat optical reference (an optical flat) is placed on a lapped surface and illuminated with monochromatic light, interference fringes form. Each fringe is a contour of constant air gap, spaced at half the wavelength of light (~295 nm for sodium). The image shows gap geometry first; Loupe then converts that recovered phase into a signed surface-height map using the selected wavelength and form-removal model.
Loupe analyzes a single interferogram using spatial-carrier Fourier phase extraction. It detects the carrier peak in the 2D FFT, demodulates the sideband, unwraps the recovered phase, and converts it to height. The resulting surface can then be shown raw or with low-order form removed using Zernike, plane, or low-order polynomial models.
Fringe mode is strongest on smooth, continuous surfaces: optical flats, lapped faces, gentle wear patterns, curvature, and low-order form. Small region-to-region comparisons also work well when the step is comfortably below the single-wavelength ambiguity limit.
Single-shot single-wavelength analysis cannot uniquely determine large discontinuous steps. If a step exceeds about λ/4, the displayed value may be aliased by integer multiples of λ/2. Loupe warns about this in the Step tool, but the underlying physics limit is still real.
A monochromatic light source (sodium lamp, HeNe laser, or narrow-band LED), an optical flat, the part to be measured, and a camera to photograph the fringes. No iPad or multi-frame capture is required, unlike deflectometry.
Plain-language explanations of the fringe-analysis terms you will see in the UI.
| Term | Plain-language meaning |
|---|---|
| Optical flat | A very flat reference surface placed on or near the part so the tiny air gap between them produces interference fringes. |
| Air gap | The tiny spacing between the optical flat and the part. The fringes describe this gap first; the app then converts that into a surface-height map. |
| Wavelength (λ) | The color of the monochromatic light, measured in nanometers. It sets the height scale. Shorter wavelengths make the same phase change correspond to a smaller physical height. |
| λ/2 | Half a wavelength. In reflection interferometry, moving from one fringe to the next usually corresponds to about this much air-gap change. |
| λ/4 | A quarter wavelength. This matters because a single image cannot uniquely resolve every larger step. For sodium light, λ/4 is about 147 nm. Once a discontinuous step gets larger than that, a single-shot reading can be ambiguous by multiples of λ/2. |
| Carrier | The overall fringe spacing and direction. The software finds this dominant pattern in the FFT and uses it to separate the useful signal from the background. |
| FFT | Fast Fourier Transform. Think of it as a view of the image in terms of repeating patterns instead of pixels. In fringe mode it is used to find the fringe direction and spacing. |
| Demodulation | The step where the software isolates the fringe pattern it cares about and removes the large carrier ripple so the underlying phase can be measured. |
| Wrapped phase | The raw phase result before jumps are resolved. It repeats every 2π, so it looks like bands that suddenly jump back around. |
| Unwrap / unwrapped phase | The process of stitching those 2π jumps into one continuous surface. This is what turns repeating phase bands into a usable shape map. |
| 2π jump correction | An extra cleanup step that can fix isolated unwrap mistakes on smooth surfaces. For step measurements it can also hide real discontinuities, so it is often better to disable it there. |
| Modulation | How strong or visible the fringes are at each pixel. High modulation usually means a more trustworthy phase measurement; low modulation means weak or noisy fringes. |
| Trusted pixels / trusted area | Pixels that pass both the modulation checks and the unwrap-risk checks. Measurements restricted to trusted pixels are less likely to be polluted by weak data. |
| PV | Peak-to-valley. The full height range of the displayed surface: highest point minus lowest point. |
| RMS | Root mean square. A summary of how much the surface varies overall, not just the single highest and lowest spots. |
| Form removal | Subtracting broad shape like tilt or curvature so smaller features are easier to inspect. This changes the displayed map and its PV/RMS, so it should always be interpreted consciously. |
| Zernike | A standard set of smooth shape terms used in optics. They are handy for describing tilt, curvature, astigmatism, coma, and related low-order form. |
| Aliasing | When different physical surfaces can produce the same single-image phase result. In step measurements this is why a large step can masquerade as a smaller one shifted by multiples of λ/2. |
Prepare the system before analyzing an interferogram.
Select the wavelength that matches your actual light source. The active calibration record owns this value, and the wavelength dropdown acts as a quick editor for that record. The wavelength determines the physical height conversion: height = phase × λ / (4π).
The mask threshold slider controls how aggressively low-modulation pixels are excluded. Increase it when the background, rim, or weakly lit regions are contaminating the result. Decrease it when valid fringe areas are being cut away. The diagnostics tab shows the modulation and trusted-area consequences of this choice.
The Settings menu includes advanced DFT controls. LPF σ changes how strongly the demodulated phase is smoothed. DC margin widens or narrows the rejection zone around the FFT center. Correct 2π jumps enables a post-unwrap cleanup that is useful for ordinary smooth surfaces but should usually be disabled for step measurements.
The focus bar is a practical setup score, not a pure fringe-only metric. It rewards fringe contrast when fringes are present and edge sharpness for ordinary setup images. Use it to dial in focus and lighting before capturing.
Keep wavelength, scaling, and aperture geometry repeatable across analyses.
Fringe mode keeps named calibration records in the browser. A calibration stores the nominal wavelength, spatial scale (mm/pixel when known), lens distortion term, capture date, and notes. The active calibration is shown in the summary bar and is sent with each analysis so session captures carry their calibration snapshot.
Use the change… link in the summary bar to switch, create, rename, or delete calibrations. Use Export… and Import… to move calibration sets between machines or browsers.
A recipe is a saved analysis geometry. It can be built from mask polygons drawn with Edit Mask, or imported from JSON. Recipes are useful when you measure the same part family repeatedly and want the same aperture and exclusion zones every time.
If no hand-drawn mask is active, the selected recipe supplies the analysis polygons automatically. Recipe coordinates are normalized, so they rescale with the current image size. Loupe warns in the console when the current preview resolution differs from the resolution the recipe was saved against.
How to acquire and analyze an interferogram.
Click Freeze & Analyze to grab the current frame and run the full analysis pipeline. The result is stored as a session capture with provenance, calibration snapshot, and the grids needed for later subtraction, export, and re-analysis.
Drag and drop an image file onto the drop zone in the left column. Re-analysis paths such as carrier override and subtraction continue to use the dropped image until you switch back to camera capture.
Click Edit Mask to define include and exclude polygons. Draw the part boundary, then add exclusion islands for dust, chips, trapped bubbles, or fixture hardware. Hand-drawn polygons take precedence over the selected recipe until you clear them.
The mode selector above the summary bar changes the tools and guidance shown in the results workspace.
| Mode | Use it for |
|---|---|
| Surface | General surface-form work: map inspection, cursor readout, profiles, area stats, and 3D view. |
| Small-step (< λ/4) | Region-to-region comparisons on smooth plateaus or genuinely small steps. The Step tool is emphasized and its aliasing warning matters here. |
| Averaging | Build a stable result from several captures of the same setup. The Session tab becomes the main workspace. |
| Subtraction | Compare one captured result against another reference result in the current session. |
Session tools for repeatability, reference-relative work, and capture provenance.
The left panel still supports quick “Add to Average” accumulation. Each accepted capture contributes to a running average, and the log lets you include or exclude captures manually.
For more deliberate work, open the Session tab, choose Select for average…, pick two or more captures, and run an average with optional sigma or MAD rejection. The averaged result becomes its own session capture with source links back to the inputs.
Use the Compare button in the Session tab to subtract a reference capture from a measurement capture. Loupe checks shape, wavelength, and calibration consistency, performs registration when enabled, and stores the resulting deviation map as a new session capture.
Subtraction and averaging warnings are not decoration. They flag low overlap, wavelength mismatch, suspicious registration confidence, and other conditions that can make a mathematically valid operation physically misleading.
Control which low-order shape is removed from the measured surface.
Low-order form often reflects setup rather than the part feature you care about. Removing tilt, curvature, or other broad trends can make local structure easier to read. For metrology work, always be explicit about what has been removed before you interpret the PV/RMS numbers.
| Model | Best use |
|---|---|
| Zernike | Circular or nearly circular apertures where you want per-term control over optical-style low-order modes. |
| Plane | Keep curvature, remove only tilt. |
| Poly2 | Non-circular apertures with gentle quadratic form. |
| Poly3 | Non-circular apertures with somewhat richer low-order shape. |
| Checkbox | Terms | What it removes |
|---|---|---|
| Tilt X/Y | Z2, Z3 | Overall tilt |
| Power | Z4 | Curvature / defocus (concavity or convexity) |
| Astigmatism | Z5, Z6 | Saddle-shaped error |
| Coma | Z7, Z8 | Comet-shaped aberration |
| Spherical | Z11 | Center-to-edge variation (bowl shape) |
Understanding the output of a fringe analysis.
Shows PV and RMS in both waves and nanometers, plus the active workflow mode, calibration, recipe badge, and current form-removal description. PV is the total range of the displayed surface. RMS is the statistical spread of that same displayed surface.
False-color height map of the displayed surface. Use the overlay buttons to switch between the surface map, confidence composite, and modulation image. The “use trusted pixels only” checkbox restricts measurements to pixels that are both well-modulated and unwrap-reliable.
Interactive 3D surface visualization. Drag to rotate, scroll to zoom, right-drag to pan. The Z exaggeration slider amplifies the height for visibility.
Bar chart plus per-term table for the fitted Zernike coefficients. Subtracted terms are grayed out. The table also shows per-term RMS contribution and normalization weights for the current aperture.
Cross-section height profiles through the center of the surface: one horizontal, one vertical. Useful for identifying whether errors are primarily in one direction.
Optics-style visualization derived from the displayed surface. Useful when fringe mode is being used as a wavefront-analysis tool rather than only as a flatness map.
In-session capture browser. Every new analysis, average, subtraction, and import appears here with origin tags, source links, export buttons, and a details panel.
Plots PV and RMS across the current session. Use it to spot drift, compare calibrations, and visualize the effect of repeated polishing or lapping passes.
Tools in the Surface Map toolbar operate on the displayed height grid.
| Tool | What it does |
|---|---|
| Cursor | Hover to read local height. |
| Δh | Click two points to read the height difference between them. |
| Profile | Click two points to sample a line profile and show a profile chart. |
| Area | Click two corners of a rectangle to compute PV and RMS within that region. |
| Step | Draw two rectangles and compare their mean heights. Intended for smooth plateaus and small steps. |
When use trusted pixels only is enabled, Area and Step measurements ignore pixels outside the trusted-mask grid. This helps avoid reading unreliable values from weak-fringe or risky unwrap regions.
The Step tool is only valid for small steps or smooth plateaus. If the reported step magnitude exceeds about λ/4, Loupe shows an aliasing warning because a single interferogram cannot distinguish that result from step ± n·λ/2.
Common issues and how to get the best results.
Inspect the carrier detection and modulation quality.
After analysis, a carrier summary row appears below the statistics bar showing the detected period, angle, and confidence. The row also exposes alternate peaks, manual-override state, and the tuning parameters the backend used for the analysis.
Shows the FFT magnitude on a log scale. A clean interferogram has two strong sidebands separated from the DC center. Click the desired sideband to override the carrier. Use Reset to Auto to go back to automatic selection.
False-color visualization of fringe contrast across the aperture. Green indicates high modulation (reliable phase extraction), red indicates low modulation (noisy or absent fringes). Masked pixels appear dark gray. Use this to verify that the mask threshold is appropriate and to understand where surface map noise originates.
The unwrap risk map highlights corrected and edge-risk regions. The trusted-area percentage in the confidence row reports how much of the analysis mask is both well-modulated and unwrap-reliable.
Low peak ratio, small DC margin, weak modulation coverage, or low trusted area do not automatically invalidate a result, but they are a strong hint that you should distrust fine detail and verify the setup before spending time interpreting the map.
The camera panel is opened via the Camera ▾ button in the top bar.
The dropdown lists available cameras grouped by type:
| Group | Description |
|---|---|
| Scientific cameras | Aravis / GigE / USB3 Vision industrial cameras (e.g. Baumer) |
| Webcams | USB webcams detected by OpenCV |
| Browser cameras | Browser built-in camera API (getUserMedia) |
When no hardware cameras are found and no browser cam is active, a "Select camera..." placeholder is shown.
Select the sensor output format:
| Format | Description |
|---|---|
| BayerRG8 | 8-bit Bayer (colour, default) |
| BayerRG12 | 12-bit Bayer (higher dynamic range) |
| Mono8 | 8-bit monochrome |
Log-scale slider + numeric input (in µs). Range comes from the connected camera's capabilities.
Log-scale slider + numeric input (in dB). Range comes from the connected camera.
Live histogram of the current frame with signal statistics (min, max, mean).
Slider from 0.5 to 2.0. Hidden by default, shown when the camera supports it.
Runs a histogram-driven bisection loop to find optimal exposure.
One-shot automatic white balance.
Collapsible section with per-channel R / G / B gain sliders (0.5 – 2.5).
Collapsible section for cropping the camera sensor to a sub-region:
Shows current ROI dimensions or "Full frame".
Sets the pixel-to-millimetre scale for all subsequent measurements.
All measurements already placed update immediately. The calibration is saved with the session.
If a circle annotation is already placed, click it while in Calibrate mode and enter the known diameter — useful when you have a precision reference hole or pin.
Corrects barrel or pincushion distortion from non-telecentric lenses — improves measurement accuracy near image edges.
Regular lenses project through a curved optical path. Points near the image edge appear shifted inward (barrel) or outward (pincushion) relative to their true position. A pixel calibration at the centre will under- or over-measure features near the edges. Telecentric lenses eliminate this by design; this tool compensates for it in software.
The model used is first-order radial distortion: a point at distance r from the image centre is corrected by dividing by (1 + k₁r²). k₁ is found by a golden-section search that minimises the variance of corrected lengths across all your samples. The correction is applied by remapping each output pixel to its source in the original distorted image using bilinear interpolation.
Corrects tilt and perspective distortion when the camera is not perfectly perpendicular to the part — common when photographing with a phone or handheld camera.
If you photograph a flat part at an angle (even a slight tilt), parallel edges appear to converge, circles become ellipses, and measurements are systematically skewed. Perspective correction remaps the image as if taken from directly above, restoring accurate geometry before you calibrate and measure.
A full projective homography (DLT, 8 DOF) is computed from the four point correspondences. Each output pixel is backward-mapped to the source image using bilinear interpolation, preserving sharpness. The destination rectangle is scaled to match the perimeter of the source quad, so the output resolution stays close to the input.
Straight-line distance between two points.
Shows distance in pixels, or in mm if calibrated. The label can be dragged to reposition it.
Included angle at a vertex point.
Displays the angle in degrees at the vertex. The arc indicator shows which angle is being measured.
Exact circumscribed circle through three points on the circumference, or a center+edge two-click circle.
Outputs: center coordinates, diameter, and radius. The three points define a unique circle using perpendicular bisector intersection.
Switch to Center+Edge in the tool options bar above the toolbar. Click the center first, then click any point on the circumference. Useful when the center is known (e.g. a punch mark, a detected circle center, or a known coordinate).
Best-fit circle through three or more points — more robust than the 3-point circle for noisy edges.
Uses an algebraic (least-squares) fit minimising distance in the implicit circle space. The more points placed, the more stable the result — especially useful on partial arcs with surface texture or noise.
A chooser appears above the toolbar after confirming. Choose Arc segment to show just the fitted portion (label shows R radius), or Full circle to display the complete circle (label shows ⌀ diameter). The choice can be changed at any time via the right-click context menu.
Radius, chord length, and angular span of an arc defined by three points.
When the arc ends are easier to snap to than the midpoint, switch to Ends first in the tool options bar: click the two endpoints first, then click the midpoint. The arc is computed identically — only the click order differs.
Outputs: radius, chord distance (straight line from start to end), and arc span in degrees.
Distance between the centers of two circles or arcs.
Draws a line between the two centers and shows the distance. Useful for bolt-hole patterns, pin spacing, etc.
The Center Distance measurement is linked to its two source circles. If you reposition either circle (by dragging its center handle), the Center Distance line and label update automatically.
Distance measured perpendicular to a reference line.
Use this to measure a step height, wall thickness, or any dimension that must be taken at a right angle to a known datum.
Parallel distance or angle deviation between two lines.
Shortest distance from a free point to a circle's edge.
Measures the gap (positive) or overlap (negative) between the point and the circle edge. Useful for checking clearance between a hole and a nearby feature.
Mathematical intersection of two lines, even outside the image frame.
Computes the intersection of the two lines' infinite extensions and places a marker. The coordinates are shown in the label and included in CSV export.
Perpendicular distance between two parallel lines — slot or gap width.
Shows the perpendicular (shortest) distance between the two lines. Best used after detecting or manually placing parallel lines on opposing slot walls.
Enclosed area of a polygon defined by clicked points.
Area shown in px² or mm² if calibrated. Perimeter is also calculated. Uses the shoelace formula.
A smooth curve through a series of points — for capturing freeform profiles, blended fillets, and organic contours.
After placing, switch to Select (V) and click the spline to select it. Drag any orange anchor point to reshape the curve. The curve tangents are computed automatically using Catmull-Rom interpolation — the curve always passes smoothly through every anchor point without requiring manual handle adjustments.
Shows approximate arc length (mm if calibrated). Exports as a DXF SPLINE entity in reverse-engineering exports.
| Key | Tool | Key | Tool |
|---|---|---|---|
| V | Select | G | Pt-Circle Dist |
| D | Distance | I | Line Intersect |
| A | Angle | W | Slot Distance |
| O | Circle (3-point) | R | Area |
| F | Fit Arc | B | Bézier Spline |
| M | Center Distance | C | Calibrate |
| P | Perp Distance | E | Detect panel |
| L | Para Distance | H | Pan |
| Key | Action |
|---|---|
| Esc | Cancel / back to Select |
| Del / Bksp | Delete selected annotation(s) |
| U | Elevate selected detection to measurement |
| Enter | Confirm multi-point tool or point-pick inspection |
| S | Save session |
| 0 | Zoom to fit window |
| 1 | Zoom to 1:1 pixels |
| ` | Toggle measurement grid |
| ←↑→↓ | Nudge selected annotation 1 px (hold Shift for 10 px) |
| Ctrl Z / ⌘Z | Undo |
| Ctrl Y / ⌘⇧Z | Redo |
| ? | Open this documentation |
| Gesture | Action |
|---|---|
| Scroll wheel | Zoom in / out (frozen image only) |
| Middle-click drag | Pan the viewport |
| H + drag | Pan using the Pan tool |
| Space + drag (hold) | Temporary pan — release to return to the previous tool |
| Click minimap | Jump viewport to that position |
| Modifier | Effect |
|---|---|
| Alt + click | Bypass all snapping — place point exactly where you click, ignoring detected edges and annotation snaps |
| Alt (hold, no click) | Suppresses the orange snap preview crosshair on mousemove |
| Gesture | Action |
|---|---|
| Click annotation | Select it (deselects others) |
| Shift + click | Add to / remove from current selection |
| Drag on empty area | Rectangle drag-select all annotations inside |
| Right-click | Context menu: elevate, delete, rename, group, merge lines, Punch/Die toggle, re-measure |
| Gesture | Action |
|---|---|
| Shift + click DXF feature (point-pick mode) | Add that feature to the compound pick target |
| Double-click | Finish multi-point tool or confirm manual inspection |
Automatically finds circles, lines, and arcs in the frozen image.
Uses the Hough circle transform. Adjust Min radius, Max radius, and Threshold sliders before running. Lower the threshold to find fainter circles; raise it to suppress false positives.
Runs Canny edge detection followed by a Hough line transform and non-maximum suppression (NMS). Lines closer than the NMS distance and within the angle tolerance are merged, keeping the longest. The bilateral smoothing slider reduces noise on textured surfaces before edge detection.
Contour-based detection that discriminates arcs from straight lines using curvature analysis. Useful for EDM wire-cut parts where arcs may be incomplete due to reflections or chamfers.
Detected features (shown in orange in the sidebar) are separate from measurements. Click ↑ (elevate) in the sidebar or press U to promote a detected feature to a permanent measurement that appears in CSV, PDF, and DXF exports.
Load a CAD drawing and overlay it on the frozen image for comparison and guided inspection.
Manual: use Move DXF to drag the overlay into position, or use Set Origin to pin an anchor point.
Auto-align (edge-based): run line detection first, then click Auto-align. The algorithm matches detected edges to DXF geometry without requiring circles. See DXF Auto-alignment in How It Works for details.
LINE, CIRCLE, ARC, LWPOLYLINE (decomposed into line and arc segments). Layer names are preserved and shown in hover tooltips.
Automatically measure deviations of real part edges from a loaded DXF nominal.
Results show perpendicular deviation from nominal in mm, colour-coded green / amber / red by tolerance. Punch and Die features are distinguished because they deviate in opposite directions.
If a feature fails to auto-detect (reflection, burr, incomplete edge), click it in the DXF overlay to enter point-pick mode. Place points along the real edge, then double-click or press Enter to fit and compute deviation.
Global warn/fail thresholds are set in Settings. Per-feature overrides can be set by clicking a deviation label on the canvas.
Locates edges more precisely than individual pixel positions.
When you hover over the frozen image with a measurement tool active, the cursor snaps to the nearest detected edge at sub-pixel precision. An orange crosshair marks the snap position. Hold Alt to bypass snapping.
A small neighbourhood around the cursor is sampled. A Sobel filter computes the image gradient — the rate of change of brightness — giving a high response at edges and near-zero in flat regions. The pixel with the highest gradient magnitude in the search radius is identified as the edge.
Then the edge is refined to sub-pixel precision along the gradient direction using one of two methods:
| Method | How it works | Best for |
|---|---|---|
| Parabola | Fits a parabola to the three gradient values around the peak. Sub-pixel offset = −(g₊₁ − g₋₁) / (2(g₊₁ − 2g₀ + g₋₁)). Fast and stable. | Sharp, clean edges |
| Gaussian | Fits a Gaussian by taking the log of the gradient values and solving a linear system. Handles asymmetric or slightly blurred peaks better. | Soft edges, textured surfaces |
If the peak gradient magnitude is below 20 (out of 255), snapping is suppressed — the edge is considered too faint to snap to reliably.
Before edge detection the image may be smoothed using a bilateral filter (controlled by the smoothing slider). Bilateral filtering reduces noise while preserving sharp edges better than Gaussian blur — it is especially useful on textured surfaces like turned or ground parts.
The Canny algorithm finds edges in several steps: Gaussian smoothing → Sobel gradient computation → non-maximum suppression along gradient directions → hysteresis thresholding (strong edges kept, weak edges kept only if connected to strong ones). The result is a thin, one-pixel-wide edge map.
The Hough line transform votes in a parameter space of (ρ, θ) for every edge point. Peaks in vote space correspond to lines. After detection, non-maximum suppression merges nearby lines with similar angles and positions, keeping the longest representative.
Similar voting approach in the (cx, cy, r) space. The radius range is constrained by the Min/Max radius sliders to limit search space and false positives.
Contours are extracted from the edge map. Each contour is tested against a fitted circle — if the residual error is low and the contour spans at least the minimum arc angle, it is classified as an arc. Nearby collinear contours are classified as lines instead.
Aligns the DXF overlay to the image without requiring circle features in the drawing.
Given three points, the unique circumscribed circle is found by intersecting the perpendicular bisectors of two chords. This is an exact solution — there is no fitting involved — so it is sensitive to point placement accuracy. Use Fit Arc for more robust results from many points.
Click a center point, then click any point on the circumference. The radius is the Euclidean distance between the two clicks. This is exact and requires only two points, but accuracy depends entirely on how precisely the center is known.
Minimises an algebraic distance in the space of implicit circle equations. Every point (xᵢ, yᵢ) on a circle satisfies xᵢ² + yᵢ² + Dxᵢ + Eyᵢ + F = 0. The coefficients [D, E, F] are found by solving a linear least-squares system (equivalent to a constrained SVD). This is more robust than geometric fitting and does not require an initial estimate.
In corridor inspection, edge points are collected and then filtered using a RANSAC-like loop: a random subset is used to fit a candidate line or circle, and only points within a residual threshold are kept as inliers. This rejects outliers from reflections, scratches, and burrs that fall within the corridor.
| Format | Contents | How to export |
|---|---|---|
| Annotated PNG | Image with all measurements and labels rendered on top | Overlay → Export annotated image |
| CSV | All measurements with values, coordinates, calibration. One row per measurement. | Overlay → Export CSV |
| Inspection CSV | Guided inspection results: feature handle, deviation, pass/fail, Punch/Die | Overlay → Export Inspection CSV (requires inspection) |
| Inspection PDF | Formatted report with numbered features, deviation table, pass/fail summary | Overlay → Export Inspection PDF (requires inspection) |
| DXF (reverse engineering) | All measurement annotations converted to DXF entities in mm-space. Distances → lines, circles → circles, splines → SPLINE entities. | Overlay → Export DXF |
| Session JSON | Full session state including all annotations, calibration, DXF, and inspection results. Can be reloaded exactly. | Press S or the 💾 button |