Optical Focus & MTF Test Charts
Export pure-vector Siemens Star focus targets, ISO 12233 slanted-edge MTF charts, and USAF 1951 style resolution targets in exact millimeter PDF, SVG, CAD DXF, and high-DPI PNG.
Export files encode target physical dimensions (1 mm = 72/25.4 pt). Always print PDF at 100% / Actual Size (disable Fit to Page) and measure both X and Y check rulers with a physical caliper or ruler before calibration.
import cv2
import numpy as np
# ISO 12233-style Slanted-Edge MTF50 Quick Verification (OpenCV 4.13 + NumPy)
img = cv2.imread("captured_mtf.png", cv2.IMREAD_GRAYSCALE)
assert img is not None, "Failed to load slanted-edge chart image"
# Locate central tilted dark square contour and measure vertical edge gradient
_, bw = cv2.threshold(img, 128, 255, cv2.THRESH_BINARY_INV)
contours, _ = cv2.findContours(bw, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
largest = max(contours, key=cv2.contourArea)
x, y, w, h = cv2.boundingRect(largest)
roi = img[y + h // 4 : y + 3 * h // 4, max(0, x - 20) : min(img.shape[1], x + 20)].astype(np.float64)
esf = roi.mean(axis=0)
lsf = np.abs(np.diff(esf))
mtf = np.abs(np.fft.rfft(lsf))
mtf = mtf / max(mtf[0], 1e-9)
freqs = np.fft.rfftfreq(len(lsf), d=1.0) # cycles / pixel
idx50 = int(np.argmax(mtf < 0.5))
mtf50 = float(freqs[idx50]) if mtf[idx50] < 0.5 else 0.5
print(f"Slanted-edge ROI={roi.shape[1]}x{roi.shape[0]}px, approx MTF50={mtf50:.3f} cy/px")
Siemens Star Focus & Astigmatism Checking
Radial spokes continuously sweep spatial frequency from low at the rim to infinite at the center, making best focus and astigmatism (elliptical blur core) immediately visible live on screen without software post-processing.
ISO 12233 Slanted-Edge MTF Evaluation
A 5° tilted high-contrast edge samples slightly different sub-pixel phases on every scanline, letting you reconstruct an oversampled Edge Spread Function (ESF), differentiate to the Line Spread Function (LSF), and compute MTF50 via FFT.
USAF 1951 Line-Pair Math & Printer Limits
Spatial frequency follows 2^(G + (E-1)/6) lp/mm. Office 600 DPI laser printers have a physical dot pitch of ~0.042 mm and cannot accurately render bars finer than ~0.085 mm (~6 lp/mm); use Group -2..-1 for office printing or DXF/phototypesetting for higher groups.