From Pixels to Production: How OpenCV Powers the LabVIEW Computer Vision Toolkit

By Youssef MENJOUR , Graiphic CTO

Computer vision can look almost magical: a camera observes a product, an application understands what it sees, and an industrial process receives an actionable result.

Behind that apparent magic lies a complete engineering chain: image
acquisition, memory management, format conversion, preprocessing, region
selection, inspection, visualization, recording, decision-making, and
integration with the rest of the system.

At Graiphic, we have integrated OpenCV as a core technological foundation of the
LabVIEW Computer Vision Toolkit.

Distributed through the SOTA ecosystem, the toolkit brings a growing set of image-processing, inspection,
acquisition, display, ROI, and video capabilities directly into the
LabVIEW dataflow.


OpenCV provides the proven computer vision technology. Graiphic
engineers it into a coherent LabVIEW experience. SOTA makes it
simple to install, maintain, and combine with the rest of the AI
ecosystem.

Computer Vision Is More Than Running an AI Model

Modern computer vision is frequently associated with Deep Learning models:
object detection, semantic segmentation, anomaly detection, classification,
or visual-language models.

However, an industrial vision application requires much more than model
inference.

Before an image reaches an AI model, it may need to be acquired from a
camera, decoded, resized, normalized, corrected, cropped, converted to a
different color space, or divided into regions.

After inference, the application must interpret the result, create masks,
draw bounding boxes, display confidence values, isolate regions of interest,
record evidence, generate reports, and communicate a decision to the
production system.

Traditional computer vision also remains essential. Many industrial
problems can be solved efficiently and deterministically using filters,
thresholds, morphology, particle analysis, pattern matching, histograms, or
geometric transformations.

This is why the LabVIEW Computer Vision Toolkit is such an important
component of SOTA. It provides the visual processing layer that connects
cameras, conventional vision algorithms, Deep Learning models, operator
interfaces, and industrial decision logic.

Why OpenCV?

OpenCV is one of the most established and widely used computer vision
libraries in the world. It provides more than 2,500 optimized algorithms
covering image processing, video analysis, feature extraction, object
detection, camera geometry, machine learning, and many other visual
computing tasks.

Its maturity, performance-oriented C++ architecture, open-source model, and
extensive adoption make it a natural technological foundation for
industrial computer vision.

But integrating OpenCV into LabVIEW is not simply a matter of exposing a
collection of C++ functions.

A real integration must address:

  • LabVIEW-compatible image references and data types.
  • Memory creation, copying, casting, and release.
  • Error propagation and deterministic resource management.
  • Conversion between images, arrays, and LabVIEW Picture data.
  • Camera and video session lifecycle management.
  • Regions of interest and interactive display controls.
  • Reusable VIs that fit naturally into graphical dataflow architectures.
  • Compatibility with AI preprocessing and post-processing workflows.

This integration layer represents a significant part of the work completed
by Graiphic engineers.

The objective is not to reproduce the OpenCV API function by function.
Instead, we are building a curated and continuously expanding computer
vision environment designed specifically for the way LabVIEW engineers
create test, measurement, automation, research, and industrial systems.

VisionMX: From a Camera to a Ready-to-Wire VI

One of the most innovative components of the toolkit is
VisionMX.

VisionMX is an Express VI that simplifies the configuration of image inputs
and acquisition workflows. It allows developers to create a ready-to-wire
vision source without rebuilding the same acquisition architecture for
every new project.

VisionMX currently supports several source types:

  • USB cameras detected directly from the computer.
  • Image files loaded from disk.
  • Video files processed frame by frame.
  • Raw LabVIEW arrays received from another acquisition system.

For USB cameras, VisionMX detects the available devices and exposes their
supported resolution and frame-rate modes. A live preview allows the
developer to validate the source before generating the VI.

For video files, the assistant displays a preview together with information
such as frame dimensions, image type, frame rate, codec, and frame count.

Raw data can be interpreted as grayscale or color images. VisionMX can
handle different color orders and array layouts, including channel-first
and channel-last representations.

Developers can also select how the acquisition must execute:

  • Single Execution to acquire one image and close the
    source automatically.
  • Standard Controlled Execution when an existing LabVIEW
    loop manages the acquisition.
  • Managed Continuous Execution to generate a complete
    continuous acquisition flow.

The result can feel almost magical: select the source, configure the
execution, choose the outputs, validate the assistant, and obtain a
LabVIEW-ready acquisition VI.

What looks like magic is, in reality, the result of careful engineering
designed to save development time and eliminate repetitive integration
work.

A Complete Image Acquisition and Session Layer

For developers who need lower-level control, the toolkit also provides
explicit camera and video session functions.

These functions make it possible to:

  • Open a camera by index.
  • Open a video file and create a video session.
  • Read individual frames.
  • Retrieve video information.
  • Enumerate the acquisition modes supported by a camera.
  • Configure camera resolution and frame rate.
  • Read or modify session parameters.
  • Release camera and video references correctly.

This provides the flexibility required to build anything from a simple
visual inspection station to a continuously operating acquisition service
integrated into an automated test bench.

Image Creation, Conversion, and Data Interoperability

Industrial applications rarely receive every image in the same format.
Cameras, frame grabbers, files, Deep Learning models, and custom acquisition
devices may all produce different representations.

The LabVIEW Computer Vision Toolkit provides the utilities required to move
visual data between these representations.

Developers can:

  • Create and release image references.
  • Copy and cast images between supported types.
  • Read image dimensions, types, and metadata.
  • Resize, resample, crop, insert, rotate, shift, shear, or flip images.
  • Convert toolkit images to and from LabVIEW Picture data.
  • Convert grayscale images to and from LabVIEW arrays.
  • Convert color images to U32 or three-dimensional U8 arrays.
  • Read and modify individual pixels or complete pixel lines.
  • Extract RGB, HSL, HSV, or HSI color planes.
  • Divide large images into tiles for inspection or model inference.

This interoperability is critical when computer vision is only one stage in
a larger LabVIEW architecture involving acquisition hardware, signal
processing, database storage, AI inference, test sequencing, or reporting.

Preprocessing: Transform Raw Images into Reliable Data

A successful inspection system rarely depends on the raw camera image
alone.

Lighting variations, noise, reflections, perspective, contrast, and
acquisition conditions can significantly affect the reliability of the
final result.

The toolkit provides a growing set of preprocessing and image-treatment
functions, including:

  • Gaussian blur and custom convolution filters.
  • Canny and conventional edge detection.
  • Brightness, contrast, and gamma correction.
  • Automatic contrast adjustment.
  • Exposure correction.
  • Hue, saturation, and value adjustment.
  • Image normalization.
  • Global, local, and multi-range thresholding.
  • Perspective transformations.
  • Image inversion and user-defined lookup tables.
  • Color-plane extraction and conversion.

These functions help transform a variable visual signal into cleaner,
normalized, and more repeatable input data.

The immediate result can be better edge extraction, more stable
segmentation, more reliable particle analysis, and higher consistency for
downstream AI inference.

Morphology and Particle Analysis for Automated Inspection

Many industrial inspections can be expressed as a sequence of binary image
operations.

A component is isolated from the background, morphological operations remove
noise or close gaps, and particles are then measured, filtered, or counted.

The toolkit includes functions for:

  • Primary morphological transformations.
  • Hole filling.
  • Removal of particles touching an image border.
  • Particle filtering based on measured properties.
  • Removal or retention of particles according to erosion resistance.
  • Particle counting and measurement.
  • Generation of particle-analysis reports.
  • Quantification of complete images or selected regions.

These capabilities can support applications such as:

  • Counting parts or features.
  • Detecting missing elements.
  • Identifying contamination or foreign particles.
  • Inspecting holes, gaps, or filled areas.
  • Sorting objects according to visual properties.
  • Measuring the distribution of segmented regions.

For well-controlled applications, this deterministic approach can provide a
simple, explainable, and economical solution without requiring a Deep
Learning model.

Pattern Matching, Profiles, and Image Inspection

The inspection functions also include tools for extracting information from
images and regions of interest.

Available capabilities include:

  • Template matching.
  • Histogram calculation.
  • Pixel line profiles.
  • ROI boundary profiles.
  • Image and region quantification.
  • Face detection using Haar cascade classifiers.

Template matching can support presence checks, alignment verification, and
localization of known visual patterns.

Histograms and pixel profiles can be used to analyze intensity
distributions, transitions, edges, lighting conditions, or local changes
along a selected line.

These conventional tools remain extremely valuable because their behavior is
understandable, reproducible, and easy to validate.

Image Operators and AI Post-Processing

Computer vision pipelines frequently need to combine several images or
masks.

The toolkit provides arithmetic and logical operators for:

  • Adding, subtracting, multiplying, or dividing images.
  • Comparing images or comparing an image with a constant.
  • Applying AND, OR, NAND, NOR, and logical difference operations.
  • Applying masks to images.
  • Computing weighted image combinations.
  • Displaying one or several segmentation masks over a source image.
  • Creating split-image comparisons between two results.

These operations are particularly useful for Deep Learning
post-processing.

For example, a segmentation model executed through the SOTA Deep Learning
Toolkit can produce one or more masks. The Computer Vision Toolkit can then
colorize those masks, control their opacity, combine them with the original
image, display the result, and pass the processed data to the rest of the
application.

CV Display: An Interactive Vision Interface for LabVIEW

A vision result must be understandable by an engineer or operator.

The toolkit therefore includes CV Display, an interactive
display designed specifically for computer vision workflows.

CV Display provides capabilities such as:

  • Image zoom and automatic zoom adjustment.
  • Pixel coordinates and color-value inspection.
  • Grayscale, binary, gradient, rainbow, temperature, and custom palettes.
  • Rectangle, polygon, and freehand ROI creation.
  • Multiple-region management.
  • ROI border, fill, and color customization.
  • Class names and class colors for annotation workflows.
  • Interactive movement and removal of regions.
  • Configurable information panels and tool palettes.

ROI descriptors can also be converted into masks, masks can be converted
back into ROIs, and multiple regions can be grouped or separated.

This creates a direct bridge between user interaction, annotation, image
processing, and AI workflows.

Image and Video Recording

Traceability is a major requirement in test and production systems.

An inspection result may need to be stored together with the serial number,
timestamp, measurement results, production context, and pass/fail decision.

The toolkit supports standard image-file workflows and provides functions
for reading or writing formats such as BMP, JPEG, JPEG 2000, PNG, and TIFF,
depending on the selected operation.

Its video writer layer can also:

  • Create a video writer session.
  • Write processed frames into a video stream.
  • Release the video writer correctly.

This makes it possible to record raw acquisition footage, processed images,
annotated results, or complete inspection sequences for quality assurance
and later analysis.

OpenCV and ONNX Runtime: Two Complementary Foundations

OpenCV and ONNX Runtime solve different parts of the computer vision
problem.

Technology Role in the SOTA vision workflow
OpenCV Image acquisition support, preprocessing, conventional
vision, transformations, inspection, ROI operations, and
post-processing.
ONNX Runtime Execution of compatible Deep Learning models through
optimized hardware execution providers.
LabVIEW Graphical orchestration of acquisition, processing,
inference, decision logic, instrumentation, interfaces, and
industrial communication.
SOTA Unified installation, toolkit management, model workflows,
runtime integration, hardware drivers, examples, and
updates.

This combination creates a complete vision chain:

Camera, file, video, or raw data
             ↓
OpenCV-based preprocessing
             ↓
Conventional inspection or AI inference
             ↓
ROI, masks, particles, measurements, and overlays
             ↓
LabVIEW decision logic and industrial communication
             ↓
Display, traceability, report, and production result

The developer can use conventional vision, AI, or a hybrid architecture
depending on the application.

Industrial Applications

Visual Conformity Control

The toolkit can help build systems that verify the presence, position,
appearance, or segmentation of components before a product continues
through production.

Deterministic functions can process well-controlled cases, while an ONNX
model can address more variable or complex visual situations.

Surface and Particle Inspection

Thresholding, morphology, particle filtering, and particle analysis can be
combined to detect contamination, holes, missing material, isolated defects,
or unexpected objects.

Assembly Verification

Pattern matching, region analysis, image comparison, and Deep Learning
detection can support checks for missing, misplaced, or incorrectly
assembled elements.

Test and Measurement Systems

An image can be acquired as part of a test sequence, processed together with
electrical or mechanical measurements, displayed to the operator, and
stored in the final test report.

Dataset Preparation and Annotation

CV Display and ROI utilities can be used to create, inspect, classify, and
convert regions required by subsequent computer vision or Deep Learning
workflows.

Monitoring and Traceability

Camera sessions, image recording, video writing, overlays, and metadata can
be integrated into monitoring applications that preserve visual evidence of
production or test events.

From Technical Functions to Business Results

The value of a computer vision toolkit is not measured only by the number of
functions in its palette.

Its real value lies in the results it helps engineering teams achieve:

  • Shorter development cycles.
  • Less repetitive acquisition and conversion code.
  • Faster prototyping of inspection solutions.
  • Reusable and maintainable LabVIEW architectures.
  • Reduced dependence on separate software environments.
  • Better integration between vision, AI, measurement, and automation.
  • Lower engineering and maintenance costs over the project lifecycle.
  • Greater control over local data processing and deployment.

These gains can translate into real economic value: fewer manual
inspections, faster root-cause analysis, improved traceability, reduced
integration effort, and earlier detection of production problems.

The exact savings always depend on the application, production volume,
defect cost, and existing process. The toolkit provides the technological
solution; the industrial result comes from applying it to a clearly defined
and properly validated use case.

An Essential Building Block of SOTA

SOTA is designed as a unified, end-to-end AI ecosystem rather than a
collection of isolated libraries.

The LabVIEW Computer Vision Toolkit connects naturally with the other
components developed by Graiphic:

  • The LabVIEW Deep Learning Toolkit for model design,
    training, inference, and ONNX Runtime execution.
  • The LabVIEW GenAI Toolkit for language and multimodal
    Generative AI.
  • The Accelerator Toolkit for optimized computational
    graphs and hardware-oriented execution.
  • SOTA tools for model import, visualization, annotation, examples,
    runtime installation, and environment management.

This unified approach reduces fragmentation.

Engineers do not need one environment for acquisition, another for image
processing, another for AI inference, and another for deployment. They can
progressively assemble the required components within a coherent LabVIEW
architecture.

That is the real innovation behind SOTA: not only bringing new algorithms
to LabVIEW, but transforming them into practical, installable, maintainable,
and industry-ready engineering solutions.

Available Through SOTA

The LabVIEW Computer Vision Toolkit is available through the SOTA platform.

To begin:

  1. Download and install SOTA.
  2. Select the LabVIEW Computer Vision Toolkit.
  3. Select the required LabVIEW version.
  4. Install and activate the toolkit.
  5. Open LabVIEW and start building your vision application.

The toolkit is continuously evolving as Graiphic engineers add new
functions, improve existing workflows, and extend the connections between
computer vision, Deep Learning, hardware, and industrial applications.

What starts with a pixel can become a measurement, an inspection result, a
production decision, or a new intelligent machine.

With OpenCV, LabVIEW, and SOTA, Graiphic is building the technological
bridge that makes this transformation possible.


Frequently Asked Questions

Does the toolkit expose the complete OpenCV API?

The LabVIEW Computer Vision Toolkit provides a curated and continuously
expanding selection of OpenCV-based capabilities designed for LabVIEW
workflows. It does not claim to expose every function currently available
in the complete OpenCV project.

Can the toolkit acquire images directly from a camera?

Yes. VisionMX and the session functions support compatible USB cameras,
including camera discovery, acquisition-mode selection, frame reading,
parameter configuration, and session release.

Can I use images coming from another LabVIEW acquisition driver?

Yes. Raw Data mode can convert supported LabVIEW arrays into image data.
This makes it possible to integrate images produced by another camera
driver, frame grabber, acquisition card, network source, or custom
application layer.

Can the toolkit be used without Deep Learning?

Yes. Filters, thresholds, morphology, particle analysis, template matching,
histograms, ROI processing, and image operators can be used to create
complete deterministic vision applications.

How does it work with Deep Learning models?

The LabVIEW Deep Learning Toolkit executes compatible models through ONNX
Runtime or other supported runtimes. The Computer Vision Toolkit handles
the surrounding image workflow, including acquisition, preprocessing,
conversion, visualization, masks, ROI management, and post-processing.

What must be installed?

Install SOTA first, then select and install the LabVIEW Computer Vision
Toolkit for the required LabVIEW version.


Further Reading