Skip to main content

Crate qualia_vision

Crate qualia_vision 

Source
Expand description

Qualia Vision — product surface for visual intelligence + biosense.

§Library home (MIG-V2)

Pure algorithms live in qualia_core_db::specialized_libs::computer_vision (cv, ops, sr, bio, embeddings, spatial kernels, gpu dispatch). This crate re-exports those kernels and owns product layers: biosense consent, recipes, weights, capability registry, semantic quins, media store.

Plans: native-visual-intelligence-and-generative-3d.md, vision-10d-browser-excellence-programme-2026.md §9-B.

§Design rules

  • Hot path is caller-buffered, no hidden heap in infer.
  • Model outputs are epistemic observations, not ground truth.
  • Dense pixels / biometric templates never in NQuins.
  • No Python; no OpenCV product link.

Re-exports§

pub use ade20k_taxonomy::ade20k_category_count;
pub use ade20k_taxonomy::lookup_ade20k_class_by_hash;
pub use ade20k_taxonomy::lookup_ade20k_class_by_id;
pub use ade20k_taxonomy::q_hash_ade20k_class;
pub use ade20k_taxonomy::ADE20K_150_CLASSES;
pub use cifar_taxonomy::lookup_cifar100_class_by_id;
pub use cifar_taxonomy::lookup_cifar10_class_by_id;
pub use cifar_taxonomy::lookup_cifar_class_by_hash;
pub use cifar_taxonomy::q_hash_cifar_class;
pub use cifar_taxonomy::CIFAR_100_CLASSES;
pub use cifar_taxonomy::CIFAR_10_CLASSES;
pub use cityscapes_taxonomy::cityscapes_category_count;
pub use cityscapes_taxonomy::lookup_cityscapes_class_by_hash;
pub use cityscapes_taxonomy::lookup_cityscapes_class_by_id;
pub use cityscapes_taxonomy::q_hash_cityscapes_class;
pub use cityscapes_taxonomy::CITYSCAPES_CLASSES;
pub use coco_taxonomy::coco_category_count;
pub use coco_taxonomy::lookup_coco_class_by_hash;
pub use coco_taxonomy::lookup_coco_class_by_id;
pub use coco_taxonomy::q_hash_coco_class;
pub use coco_taxonomy::COCO_80_CLASSES;
pub use kitti_taxonomy::kitti_category_count;
pub use kitti_taxonomy::lookup_kitti_class_by_hash;
pub use kitti_taxonomy::lookup_kitti_class_by_id;
pub use kitti_taxonomy::q_hash_kitti_class;
pub use kitti_taxonomy::KITTI_8_CLASSES;
pub use openimages_taxonomy::lookup_openimages_class_by_hash;
pub use openimages_taxonomy::lookup_openimages_class_by_mid;
pub use openimages_taxonomy::openimages_category_count;
pub use openimages_taxonomy::q_hash_openimages_class;
pub use openimages_taxonomy::OpenImagesClassEntry;
pub use openimages_taxonomy::OPENIMAGES_600_CLASSES;
pub use pascal_voc_taxonomy::lookup_pascal_voc_class_by_hash;
pub use pascal_voc_taxonomy::lookup_pascal_voc_class_by_id;
pub use pascal_voc_taxonomy::pascal_voc_category_count;
pub use pascal_voc_taxonomy::q_hash_pascal_voc_class;
pub use pascal_voc_taxonomy::PASCAL_VOC_20_CLASSES;
pub use vggface2_taxonomy::format_vggface2_subject_id;
pub use vggface2_taxonomy::lookup_vggface2_subject_hash;
pub use vggface2_taxonomy::q_hash_vggface2_subject;
pub use vggface2_taxonomy::vggface2_identity_count;
pub use vggface2_taxonomy::VGGFace2Pose;
pub use vggface2_taxonomy::VGGFACE2_IDENTITY_COUNT;
pub use biosense::blendshape_affect_proposal;
pub use biosense::blendshape_affect_proposal;
pub use biosense::cctv_stages_allowed;
pub use biosense::colour_evm_yiq;
pub use biosense::colour_evm_yiq;
pub use biosense::design_bandpass_iir;
pub use biosense::energy_ms;
pub use biosense::ensemble_hr;
pub use biosense::ensemble_hr;
pub use biosense::ensemble_respiration;
pub use biosense::ensemble_respiration;
pub use biosense::eulerian_color_magnify;
pub use biosense::eulerian_color_magnify;
pub use biosense::eulerian_color_magnify_consented;
pub use biosense::eulerian_color_magnify_ex;
pub use biosense::eulerian_motion_magnify;
pub use biosense::eulerian_motion_magnify;
pub use biosense::eulerian_motion_magnify_consented;
pub use biosense::eulerian_motion_magnify_ex;
pub use biosense::evaluate_challenge_pad;
pub use biosense::evaluate_landmark_pad;
pub use biosense::evaluate_pad_from_mediapipe_trace;
pub use biosense::evaluate_pad_from_mediapipe_trace;
pub use biosense::evaluate_processing_act;
pub use biosense::evaluate_processing_act;
pub use biosense::evaluate_profile_asymmetry;
pub use biosense::evm_snr_gate;
pub use biosense::evm_snr_gate;
pub use biosense::face_roi_center;
pub use biosense::face_roi_center;
pub use biosense::frame_blur_score;
pub use biosense::frame_blur_score;
pub use biosense::gaussian_pyramid_build;
pub use biosense::gaussian_pyramid_build;
pub use biosense::issue_challenge;
pub use biosense::issue_rotation_challenge;
pub use biosense::landmarks_from_normalized;
pub use biosense::landmarks_from_normalized;
pub use biosense::laplacian_pyramid_build;
pub use biosense::laplacian_pyramid_build;
pub use biosense::motion_energy;
pub use biosense::motion_energy;
pub use biosense::pack_landmark_frame;
pub use biosense::pack_landmark_frame;
pub use biosense::profile_asymmetry_ratio;
pub use biosense::profile_asymmetry_ratio;
pub use biosense::pyramid_reconstruct;
pub use biosense::pyramid_reconstruct;
pub use biosense::reject_low_quality;
pub use biosense::reject_low_quality;
pub use biosense::respiration_from_motion;
pub use biosense::respiration_from_motion;
pub use biosense::respiration_from_rppg_harmonic;
pub use biosense::respiration_from_rppg_harmonic;
pub use biosense::respiration_rate_from_motion_trace;
pub use biosense::respiration_rate_from_motion_trace;
pub use biosense::roi_mean_rgb;
pub use biosense::spectral_hr_peak;
pub use biosense::spectral_hr_peak;
pub use biosense::template_hash_from_roi;
pub use biosense::templates_match;
pub use biosense::temporal_bandpass_iir;
pub use biosense::temporal_bandpass_iir;
pub use biosense::temporal_bandpass_series;
pub use biosense::valence_arousal_proposal;
pub use biosense::valence_arousal_proposal;
pub use biosense::AffectProposal;
pub use biosense::BandpassIir;
pub use biosense::BandpassState;
pub use biosense::BiometricTemplate;
pub use biosense::BiosenseConsent;
pub use biosense::BiosensePurpose;
pub use biosense::BlendshapeProxy;
pub use biosense::CameraStreamAttestation;
pub use biosense::ChallengeKind;
pub use biosense::ColourEvmParams;
pub use biosense::EvmRefuse;
pub use biosense::EvmSnrVerdict;
pub use biosense::FaceRoi;
pub use biosense::HeadPose;
pub use biosense::HrEstimate;
pub use biosense::Landmark2;
pub use biosense::LandmarkBufferLayout;
pub use biosense::LandmarkFrame;
pub use biosense::MeshBlendProxies;
pub use biosense::MeshFrameSignals;
pub use biosense::MotionEvmParams;
pub use biosense::PadLandmarkId;
pub use biosense::PadReason;
pub use biosense::PadResult;
pub use biosense::PadThresholds;
pub use biosense::ParSample;
pub use biosense::ParVerdict;
pub use biosense::PolicyDecision;
pub use biosense::ProcessingAct;
pub use biosense::PyramidLevelMeta;
pub use biosense::QualityReject;
pub use biosense::RrEstimate;
pub use biosense::TemporalWindow;
pub use biosense::DEFAULT_EVM_MIN_SNR;
pub use biosense::DEFAULT_PAR_TAU;
pub use biosense::MAX_PYRAMID_LEVELS;
pub use biosense::MEDIAPIPE_FACE_MESH_COUNT;
pub use biosense::RR_F_HI_HZ;
pub use biosense::RR_F_LO_HZ;
pub use biosense::RR_MIN_SNR_DEFAULT;
pub use capability::all_capabilities;
pub use capability::by_id;
pub use capability::count_by_status;
pub use capability::CapabilityEntry;
pub use capability::CapabilityStatus;
pub use classifier::fit_two_class_centroids;
pub use classifier::LinearHead;
pub use classifier::LinearProbeVision;
pub use detector::sample_frame_indices;
pub use detector::GridMultiObjectDetector;
pub use detector::MAX_GRID;
pub use generator::compile_generation_receipt_quins;
pub use generator::CancelFlag;
pub use generator::GenerationReceipt;
pub use generator::NativeImageGenerator;
pub use generator::CTX_GENERATION;
pub use generator::GENERATOR_MODEL_ID;
pub use generator::P_GENERATED_IMAGE;
pub use generator::P_GEN_PROMPT;
pub use generator::P_GEN_SEED;
pub use media_store::MediaRecord;
pub use media_store::MediaStore;
pub use media_store::RetentionClass;
pub use metrics::evaluate_real_held_out;
pub use metrics::evaluate_synthetic;
pub use metrics::mean_best_iou;
pub use metrics::MetricsReport;
pub use overlay::box_css_percent;
pub use overlay::box_pixel_bounds;
pub use overlay::compose_rgb_overlay_rgba8;
pub use overlay::draw_boxes_rgba8;
pub use overlay::encode_bmp_rgba8;
pub use preprocess::iou_u16;
pub use preprocess::letterbox_rgb8;
pub use preprocess::letterbox_workspace_bytes;
pub use preprocess::nms_class_agnostic;
pub use preprocess::normalize_rgb8_to_f32_chw;
pub use preprocess::resize_nearest_rgb8;
pub use recipes::challenge_pad_from_landmark_frames;
pub use recipes::challenge_pad_from_mesh_trace;
pub use recipes::challenge_pad_from_mesh_trace;
pub use recipes::compile_hr_observation_quins;
pub use recipes::respiration_monitor;
pub use recipes::respiration_monitor;
pub use recipes::respiration_monitor_motion_only;
pub use recipes::self_monitor_pulse;
pub use recipes::self_monitor_pulse;
pub use recipes::self_monitor_pulse_evm;
pub use recipes::self_monitor_pulse_evm;
pub use recipes::PulseAbstain;
pub use recipes::PulseEvmResult;
pub use semantic::bbox_quin;
pub use semantic::class_proposal_quin;
pub use semantic::compile_observation_quins;
pub use semantic::compile_observation_quins_full;
pub use semantic::human_correct_quin;
pub use semantic::human_reject_quin;
pub use semantic::media_digest;
pub use semantic::model_digest_quin;
pub use semantic::observation_quin;
pub use semantic::pack_bbox_u64;
pub use semantic::q_hash;
pub use semantic::query_by_frame_range;
pub use semantic::query_by_model;
pub use semantic::query_instances_in_region;
pub use semantic::track_quin;
pub use semantic::unpack_bbox_u64;
pub use semantic::MediaDigest;
pub use semantic::VisionQuin;
pub use semantic::CTX_HUMAN_ATTESTATION;
pub use semantic::CTX_VISION;
pub use semantic::MAX_OBS_QUINS;
pub use semantic::P_HAS_BBOX;
pub use semantic::P_HAS_TRACK;
pub use semantic::P_HUMAN_CORRECTS;
pub use semantic::P_HUMAN_REJECTS;
pub use semantic::P_MODEL_DIGEST;
pub use semantic::P_PROPOSES_CLASS;
pub use semantic::P_VISUAL_OBSERVATION;
pub use spatial::detections_to_node_hints;
pub use spatial::image_to_heightfield_mesh;
pub use spatial::pack_geometry_export_for_10d;
pub use spatial::GeometryFor10d;
pub use spatial::ImageTo3dReceipt;
pub use synthetic::generate_scene_rgb8;
pub use synthetic::match_accuracy;
pub use synthetic::sample_id;
pub use synthetic::train_test_disjoint;
pub use synthetic::DatasetSplit;
pub use synthetic::SyntheticSampleId;
pub use synthetic::TEST_SEED_BASE;
pub use synthetic::TRAIN_SEED_BASE;
pub use tracker::BoundedTracker;
pub use tracker::FLAG_TRACK_OVERFLOW;
pub use tracker::MAX_TRACKS;
pub use weights::load_litert_file;
pub use weights::probe_onnx_asset;
pub use weights::resolve_vision_asset;
pub use weights::resolve_vision_asset;
pub use weights::sface_infer_rgb8;
pub use weights::validate_litert_bytes;
pub use weights::yunet_infer_rgb8;
pub use weights::AssetLicenceTag;
pub use weights::LiteRtFileMeta;
pub use weights::LiteRtLoadError;
pub use weights::OnnxSessionError;
pub use weights::ProductionVision;
pub use weights::ResolvedAsset;
pub use weights::VisionAssetError;
pub use weights::VisionAssetId;
pub use weights::VisionBackendKind;
pub use weights::VisionWeightBundle;
pub use weights::LITER_TFLITE_MAGIC;
pub use weights::QVWT_MAGIC;
pub use weights::QVWT_VERSION;
pub use cpu_reference::CpuReferenceVision;

Modules§

ade20k_taxonomy
MIT ADE20K 150-Category Scene Parsing Taxonomy & Semantic Resolver.
anonymize_tag_map
Redact known PHI tag keys in a simple DICOM attribute map.
bicubic_u8
Bicubic (Keys a=-0.5) upscale RGB packed u8 by integer scale 2|3|4.
bilateral_denoise_u8
Simplified bilateral denoise Gray8 (small window).
bilinear_u8
Bilinear upscale RGB packed u8 by integer scale 2|3|4.
bio
Bio / medical CV algorithms — specialized_libs::computer_vision::bio.
biosense
Biosensing excellence: consent, quality, rPPG, magnification, affect, policy. Biometrics/mindware = selfhood; fail closed without consent.
box_blur_u8
Separable box blur on Gray8 (caller-buffered).
brief_desc_u8
Tiny BRIEF-like descriptor (32 bytes) around keypoints.
canny_u8
Simplified Canny: Sobel mag + dual threshold (no full hysteresis graph).
capability
Vision excellence capability registry (machine-readable ledger).
cifar_taxonomy
CIFAR-10 & CIFAR-100 Taxonomy & Semantic Resolver.
cityscapes_taxonomy
Cityscapes Urban Scene Taxonomy & Semantic Resolver.
classifier
Phase 4 / V4 — frozen embedding + compact linear classifier head.
coco_taxonomy
MS COCO (Common Objects in Context) 80-Category Taxonomy & Semantic Resolver.
cpu_reference
Deterministic CPU reference “vision” backend.
crocker_grier_link
Crocker–Grier style 2D particle linking across frames (trackpy / IDL lineage).
cv
Classical CV — canonical implementation in specialized_libs::computer_vision::cv.
detector
Phase 5 / V5 — multi-object detector pipeline (grid head + NMS).
dilate_u8
Gray dilate 3x3 max.
draw_rect_u8
Draw axis-aligned rectangle on Gray8.
embeddings
Local CBIR proxy embeddings — specialized_libs::computer_vision::embeddings.
equalize_hist_u8
Histogram equalization Gray8.
erode_u8
Binary/gray erode 3x3 min.
extended_minima
H-minima / extended minima on Gray8 (suppress shallow minima).
fast_corners_u8
FAST-9 corner detector (simplified).
find_external_blobs
External blob bounding boxes via flood fill (caller-buffered).
first_order_stats
First-order intensity statistics on a gray-level ROI.
gaussian_blur_u8
3x3 Gaussian blur on Gray8.
generator
Swarm G — native image generation ABI (Phase 8).
glcm_features
Gray-Level Co-occurrence Matrix (GLCM) texture features at distance 1.
gpu
Vision GPU dispatch facade — specialized_libs::computer_vision::gpu.
hamming_match
Brute-force Hamming match for binary descriptors.
histogram_u8
256-bin histogram of Gray8.
kitti_taxonomy
KITTI 3D Autonomous Driving Taxonomy & Semantic Resolver.
lanczos3_u8
Lanczos-3 upscale RGB packed u8 by integer scale 2|3|4.
lucas_kanade_step
One-step sparse Lucas–Kanade optical flow (translation per point).
media_store
Content-addressed media store (Phase 2 / V2) — pure Rust, no Python.
median_blur_u8
3x3 median filter Gray8.
mesh_ir_to_export
MeshIR → render-ready export (for compile_10d on the host).
metrics
Swarm W — evaluation metrics (synthetic always; real H1 when corpus supplied).
morphological_tophat
White / black morphological top-hat via existing 3×3 erode / dilate.
nucleus_features
Per-label nucleus geometry: area, circularity, axis ratio (PCA of region points).
openimages_taxonomy
Google Open Images V7 600-Category Taxonomy & Semantic Class Resolver.
ops
CPU vision ops oracles — specialized_libs::computer_vision::ops.
overlay
Detection overlay — draw boxes onto caller-owned pixel buffers (desktop/renderer path).
pascal_voc_taxonomy
PASCAL VOC (Visual Object Classes) 20-Category Taxonomy & Semantic Resolver.
positive_od_threshold
Optical-density threshold for positive cell fraction (Ki-67 style index).
preprocess
Fixed-buffer preprocess helpers (Phase 1/V1).
print_readiness
Print readiness checks for MeshIR (3D print excellence).
recipes
Composed excellence pipelines (orchestration only).
rgb_to_gray_u8
RGB8 → Gray8 (BT.601 integer).
semantic
Observation → fixed NQuin-compatible records (epistemic, not ground truth).
sobel_mag_u8
Sobel gradient magnitude Gray8.
spatial
Spatial product adapters over specialized_libs::computer_vision::spatial.
spectral_unmix_nnls
Non-negative least-squares lite for multi-channel spectral unmixing.
sr
Super-resolution — specialized_libs::computer_vision::sr.
super_resolve
Unified classical super-resolution entry (Track B0 / SR0).
super_resolve_tiled
SR1 — tiled classical super-resolution (plan → extract → SR tile → blend).
suv_from_activity
Standardised Uptake Value (SUV) from activity and body metrics.
synthetic
Phase 7 / V7 — regenerable synthetic labeled scenes (no Python, no network).
tracker
Phase 5 / V5 — bounded multi-object tracker (ByteTrack-class association).
types
Stable visual ABI — re-exported from specialized_libs::computer_vision (MIG-V2).
vggface2_taxonomy
Oxford VGGFace2 Facial Recognition Taxonomy & Epistemic Identity Resolver.
voronoi_otsu_label
Voronoi–Otsu labeling (lite): Otsu threshold → distance peaks → watershed split.
warp_affine_u8
Nearest-neighbour affine warp Gray8. out(x,y) = src(ax + by + c, dx + ey + f) inverse map.
warp_perspective_u8
Nearest-neighbour perspective warp Gray8. Homography H 3x3 row-major maps output → input (x’,y’,w’).
watershed_markers
Marker-controlled watershed flooding on a gray topographic surface.
weights
Swarm W — production weight bundle + encoder/detector backend.

Structs§

BlobBox
CrockerGrierLinker
Bounded Crocker–Grier particle tracker.
CrockerGrierParams
Parameters for Crocker–Grier linking.
Detection
One detection: fixed-width so native/WASM/serde stay stable. Coordinates are normalized × 65535 (0…1 mapped into u16).
Detection2
Compact detection for the free-function linker (x, y, frame only).
FirstOrderStats
First-order radiomics features (IBSI-style subset).
FrameSequence
GlcmFeatures
Haralick-style features averaged over 0° and 90° (symmetric GLCM).
GrayView
ImageView
Borrowed image view — no ownership of pixels.
Keypoint
LabStats
Lab mean (L, a, b).
LinkedParticle
One linked particle observation (detection + assigned track id).
MacenkoResult
Result of Macenko: two unit-ish stain vectors in OD space (rows: H, E; cols: R,G,B).
Match
MeshCleanupOptions
Options for cleanup_mesh_ir.
MeshIR
Triangle mesh in fixed buffers (zero growth after fill).
MeshQualityReport
Report from quality cleanup.
MeshValidationReport
NodeHint
Hint for future Tensor10D node packing (x,y,z,t,σ) — programme D1/D2.
NucleusFeature
Fixed-layout region feature (no heap).
OdPositiveIndex
Result of a positive-OD index computation.
ParticleCentroid
2D particle feature used by super::crocker_grier_link().
PrintReadiness
RenderMeshExport
Geometry export matching qualia_core_db::render::assets::Mesh field layout without linking core-db into the vision crate.
RgbBg
Per-channel background estimate (linear RGB8 mean of bright pixels).
RgbView
Shape2d
Compact 2D shape summary.
Shape2dFeatures
2D shape features from a binary mask (nonzero = foreground).
Shape3dFeatures
3D shape features from a sparse voxel list.
SrReport
Report returned after a successful enhance.
SrRequest
Caller request for super_resolve.
StainBasis
Stain basis in optical-density space: up to 3 vectors × RGB.
TilePolicy
Tiling policy for classical and learned SR backends.
TileRect
Axis-aligned tile on the input image (pre-scale).
TrackLink
Per-detection link result for crocker_grier_link.
TwinEligibility
VisionComputeReport
VisionVramBudget
Dynamic VRAM budget for vision tiles (bytes) derived from host thermal state.
VisualCapabilities
VisualOutputCounts

Enums§

AnalysisDomain
What solver domain a mesh may claim.
ClassicalKernel
Classical resampling kernel.
CvError
EnhancementMode
Enhancement honesty mode. Medical/forensic paths use Sharpen.
HistoError
Errors for histopathology kernels.
MeshValidationStatus
PixelFormat
RadiomicsError
Shared radiomics error for the radiomics submodule.
SrBackend
Super-resolution backend. Only classical for B0; more variants later.
ThermalHint
Coarse thermal hint from host (maps from ThermalGovernor).
TopHatKind
Top-hat polarity.
VisionComputeDevice
Device that executed the op.
VisionError

Constants§

AHASH_SIDE
Side length for aHash (8×8 → 64 bits).
COLOR_HIST_BINS
Bins per RGB channel for the joint histogram.
COLOR_HIST_EMBED_DIM
Embedding dimension: joint 4×4×4 RGB histogram (64 floats).
DEFAULT_HE_TARGET_MEAN
Approximate H&E appearance targets in CIE Lab (D65).
DEFAULT_HE_TARGET_STD
Companion std for DEFAULT_HE_TARGET_MEAN.
DEFAULT_OVERLAP
Default overlap (pixels on input side).
DEFAULT_TILE
Default edge-friendly tile size (pixels on input side).
DESC_LEN
DHASH_HEIGHT
DHASH_WIDTH
dHash samples (WIDTH+1)×HEIGHT so adjacent horizontal diffs yield 64 bits.
GLCM_LEVELS_16
Common quantization levels for radiomics GLCM.
GLCM_LEVELS_32
MAX_DETECTIONS
Maximum detections written per infer call (caller must supply at least this).
MAX_EMBED_DIM
Maximum embedding dim written (caller buffer may be larger; we fill min).
MAX_FRAME_DETS
Max detections considered per frame (association scratch).
MAX_INDICES
Max triangle indices (3 per tri).
MAX_NUCLEUS_LABELS
Maximum distinct labels tracked in one pass (stack/table bound).
MAX_OD_LABELS
Maximum distinct nucleus labels for OD aggregation.
MAX_PARTICLES_PER_FRAME
Maximum particles reported from a single frame (stack-friendly bound for callers).
MAX_PARTICLE_TRACKS
Maximum simultaneous active tracks.
MAX_SEQ_FRAMES
Max frames held in a fixed ring for biosense windows.
MAX_VERTICES
Max vertices in a single vision reconstruction mesh.
NO_TRACK_ID
Sentinel: detection not assigned a track.

Traits§

VisualModel
Backend-agnostic visual model.

Functions§

ahash_u64
Average hash: nearest-neighbor sample to 8×8, bit = pixel ≥ mean.
anonymize_tag_map
Zero/redact known PHI keys in map (in place).
apply_background_correct
Correct RGB illumination: out = clamp(rgb * 255 / bg, 0..255) per channel.
apply_hu_window_i16
Window/level on i16 HU values → u8 display.
assess_twin_eligibility
Gate mesh into twin/solver contracts. Soft refuse is honest completeness.
avg_pool2d_dispatch
Avg-pool dispatch wrapping the CPU oracle.
avg_pool2d_nchw_f32
?::avg_pool2d_nchw_f32.
background_intensity_sample
Sample background as the mean RGB of pixels whose luminance is at or above the given percentile (e.g. percentile = 95.0 → top ~5% brightest).
bicubic_u8
Bicubic upsample RGB8. out ≥ w*scale * h*scale * 3. Scale ∈ {2,3,4}.
bilateral_denoise_u8
Bilateral denoise on a u8 image.
bilinear_u8
Bilinear upsample RGB8. out ≥ w*scale * h*scale * 3. Scale ∈ {2,3,4}.
blend_tile_into_accum
Blend one already scaled tile into float accumulators.
box_blur_u8
Box blur with odd radius r (kernel 2r+1). out ≥ w*h.
brief_desc_u8
Write n descriptors into out (n * DESC_LEN bytes).
canny_u8
Approximate Canny edges. out binary-ish 0/255. low/high thresholds on magnitude.
centroid_from_bbox
Centroid of a bounding box (integer mid-point) — convenience for box→particle bridges.
centroids_from_binary
Extract centroids of connected components where pixel ≥ thresh (4-connected).
centroids_from_labels
Extract centroids from a pre-labelled u8 mask (label 0 = background).
class_hash_to_sigma_base
Map a class hash into a base σ band.
class_id_to_sigma_base
Map a class hash into a base σ band.
class_score_to_sigma
Combine class base σ with detection confidence (score).
cleanup_mesh_ir
Clean a MeshIR in place: weld (optional) then drop degenerate triangles.
color_hist_embed_rgb
Fill out[..COLOR_HIST_EMBED_DIM] with an L2-normalized joint RGB histogram.
conv2d_nchw_dispatch
Conv2d NCHW dispatch (CPU oracle; GPU when A2 Forge lands).
conv2d_nchw_f32
2D convolution, NCHW layout, single batch (N=1).
cosine_distance
Cosine distance 1 − cosine_similarity (identical unit vectors → 0).
cosine_similarity
Cosine similarity dot(a,b) / (|a||b|) over equal-length slices.
crocker_grier_link
Free-function Crocker–Grier link over compact Detection2 rows.
detection_center_to_node_hint
Map a detection-like box centre (normalised 0..1) into a node hint.
detection_to_sigma
σ from a Detection (uses class_hash + score_f32).
dhash_u64
Difference hash: nearest-neighbor sample to 9×8, bit = right ≥ left (row-wise).
dilate_u8
Binary dilation on a u8 image.
draw_rect_u8
Draws a rect on a u8 image.
equalize_hist_u8
Histogram equalization on a u8 image.
erode_u8
Binary erosion on a u8 image.
estimate_tile_count
How many tiles would be planned.
extended_minima
Compute extended minima of a gray topographic surface.
extract_tile_rgb8
Copy rect from full-frame RGB8 (src_w × src_h × 3) into out (at least rect.w*rect.h*3).
fast_corners_u8
Detect FAST corners. out caller-buffered.
finalize_blend
Divide accum by weight into out RGB8.
find_external_blobs
Find up to out.len() external blobs where pixel ≥ thresh.
first_order_stats
Compute first-order stats over samples (gray / intensity ROI values).
gaussian_blur_u8
Fixed 3×3 Gaussian. out ≥ w*h.
glcm_features
Compute GLCM features on a 2D gray image at distance 1 with 16 levels (default).
glcm_features_d1
Compute GLCM features on a 2D gray image at distance 1.
hamming_distance_u64
Popcount of XOR bits between two 64-bit perceptual hashes.
hamming_match
Match query descriptors to train. out one match per query (best).
histogram_u8
Write 256 bin counts into bins.
hu_window_i16
Window/level on i16 HU values → u8 display.
intensity_to_od_u8
Map brightfield intensity to an 8-bit optical-density-like value.
isotropic_resample_2d_nn
Resample a 2D image from anisotropic pixel spacing to isotropic.
isotropic_resample_nn_2d
Resample a 2D image from anisotropic pixel spacing to isotropic.
lab_to_rgb
Convert interleaved Lab f32 to packed RGB8. out length ≥ lab.len().
lanczos3_u8
Lanczos-3 upsample RGB8. out ≥ w*scale * h*scale * 3. Scale ∈ {2,3,4}.
link_particles
One-shot convenience: link a full detection list with fresh linker state.
lucas_kanade_step
Estimate flow from prev to next for each keypoint. Writes dx,dy into flow as pairs.
macenko_deconvolution
Macenko deconvolution.
max_pool2d_dispatch
Max-pool dispatch wrapping the CPU oracle.
max_pool2d_nchw_f32
?::max_pool2d_nchw_f32.
median_blur_u8
Median blur on a u8 image.
mesh_ir_to_export
Convert MeshIR to export (no validation).
mesh_ir_to_export_validated
Validate then export. Fails closed on invalid mesh.
mesh_ir_to_obj
Write a minimal OBJ into out (UTF-8 text). Returns bytes written.
mesh_ir_to_stl_binary
Write binary STL into out. Returns bytes written.
mesh_ir_triangles
Triangle list as [u32; 3] slices (for core Mesh handoff).
mip_project_axis
Max-intensity project a 3D volume of f32 voxels.
mip_project_z
MIP along Z (classic axial max-intensity projection).
morphological_tophat
Morphological top-hat into caller buffer (width * height bytes).
nucleus_features
Extract geometric features for each labeled nucleus region.
optical_density_rgb
Convert packed RGB8 intensities to optical density (f32, same layout).
otsu_threshold_from_hist
Otsu threshold for a Gray8 histogram (returns 0 if image empty / single-tone).
plan_tiles
Plan a grid of overlapping tiles covering [0,width) × [0,height).
positive_od_threshold
Compute Ki-67-style positive index from a gray channel and nucleus label map.
print_readiness
envelope_mm max XYZ extents (e.g. printer bed). Mesh positions assumed mm.
refuse_fea_unless_eligible
Explicit refuse for unsupported FEA claims.
reinhard_normalize
Reinhard-normalize packed RGB8 toward target Lab stats (or H&E defaults if None).
resize_nearest_nchw_dispatch
Prefer GPU when prefer_gpu: try Forge Resize2d on shared_gpu, else CPU.
resize_nearest_nchw_f32
Resize each channel plane independently (nearest neighbour).
rgb_to_gray_u8
Convert packed RGB8 to Gray8. out length ≥ width*height.
rgb_to_lab
Convert packed RGB8 to interleaved Lab f32. out length ≥ rgb.len().
shape_2d_features
Extract 2D shape from a binary mask (nonzero = object).
shape_2d_from_mask
Extract 2D shape from a binary mask (nonzero = object).
shape_3d_from_voxels
Extract 3D shape from a sparse list of voxel coordinates.
snmf_unmix_lite
Unmix packed RGB into non-negative concentrations via multiplicative updates.
sobel_mag_u8
Sobel magnitude on a u8 image.
spectral_unmix_nnls
Unmix one observed spectrum y (length n_channels) against endmember matrix endmembers laid out as column-major: component k occupies endmembers[k * n_channels .. (k+1) * n_channels].
super_resolve
Super-resolve RGB8 into caller buffer (out ≥ w*scale * h*scale * 3).
super_resolve_tiled
Super-resolve using overlapping tiles and feather blend.
super_resolve_tiled_default
Convenience: tiled with default policy.
super_resolve_tiled_with_policy
Tiled classical with the same device honesty.
super_resolve_with_policy
Super-resolve with explicit thermal + VRAM policy (B2 surface).
suv_from_activity
Body-weight SUV (SUV_bw).
synthetic_pulse_sequence
Load a synthetic pulsing sequence for tests / demos (no file demux).
thermal_allows_gpu_tiles
Whether GPU tile work is allowed under thermal state.
validate_mesh_ir
Validate mesh IR. Does not allocate.
voronoi_otsu_label
Voronoi–Otsu label map: split touching bright objects.
warp_affine_u8
m = [a,b,c, d,e,f] maps output → input.
warp_perspective_u8
Perspective warp on a u8 image.
watershed_markers
Marker-controlled watershed.