Another BASIC interpreter? Yes, indeed.
cvBasic was born from a simple idea: to make many imaging, numerical analysis, and visualization operations accessible without having to build an entire C++ project each time.
The language retains the familiarity and immediacy of BASIC, but behind the scenes it uses an image processing engine completely based on OpenCV. This allows you to write small, readable programs that can be modified in seconds, yet are capable of performing operations that would normally require much more code.
The program is designed primarily for experimentation, teaching, and rapid prototyping: loading images, including scientific ones, applying filters, measuring data, generating graphs, visualizing results, building scientific demos, producing videos, and directly testing algorithmic ideas.
OpenCV Imaging, FITS and TIFF AVI and MP4, Plot and Data, Vector Graphics, 3D Visualization, Educational Demos, C++ Extensions
For Experimentation
You can quickly test a sequence of filters, compare results, save intermediate images, and build small workflows without recompiling dedicated applications.
For Teaching
BASIC syntax bridges the gap between formula, algorithm, and result. It is suitable for mathematics, physics, optics, signal processing, geometry, and image processing demos.
For Extension
Advanced users can add external C++ libraries via DLLs, registering new commands and functions directly in the interpreter.
Imaging as a First Citizen
In cvBasic, the image is not an accessory: it is one of the core elements of the language. OpenCV-based functions allow you to perform classic operations such as color conversions, thresholds, blur, edge detection, geometric transformations, and statistical analysis, as well as more complex and experimental processing.
The goal is not to replace C++ or Python when building a complete industrial system, but to offer an immediate environment for testing a procedure, preparing a demonstration, or quickly verifying an idea.
- Filters and Transformations: Basic and advanced image processing, with compact syntax.
- Visual Analysis: Measurements, statistics, and useful representations for understanding what's happening in the data.
- Video and Sequences: Support for workflows oriented to stacks, frames, and videos.
- Scientific Formats: Reading and writing images with extended dynamic range, including FITS and TIFF.
- Rapid Prototyping: Script modification, immediate execution, and result verification.
Image, Stack, and Video Formats
cvBasic isn't limited to the most common graphics formats. The environment is also designed for scientific and technical data, where extended dynamic range images, multi-frame sequences, and files generated by acquisition instruments, scientific cameras, or measurement pipelines are often needed.
In addition to the standard image formats supported by the OpenCV engine, cvBasic allows you to work with FITS and TIFF files, including those containing multiple planes, frames, or stacks. This makes it possible to import data from astronomy, microscopy, scientific imaging, CCD/CMOS cameras, laboratory instruments, or analysis workflows where radiometric depth is more important than just 8-bit display.
- Common Formats: Read and write the main image formats used in demos and documentation, such as PNG, JPEG, BMP, and other formats supported by the available OpenCV build.
- Scientific FITS: Import FITS files with a focus on extended dynamics, useful for astronomical data, scientific sensors, and images not necessarily intended for direct viewing only.
- TIFF and Stacks Manage: TIFF images, including multi-frame or stacked images, suitable for sequences, technical acquisitions, and higher-depth data.
- Extended Dynamics: Support for images with depths greater than 8 bits, allowing you to process, normalize, measure, and then convert for viewing or export.
- AVI Video: Creating AVI videos from images, processed frames, result sequences, or educational demos generated by the script.
- MP4 Video: MP4 export where supported by the codecs available in the system, useful for quickly sharing processing, animations, and results.
This part is particularly important in practice: a script can load a stack, apply a transformation, produce intermediate images, generate a plot, and finally save a video sequence. The scientific data can therefore be manipulated during processing, while the final output can be prepared for presentations, reports, or web pages.
REM Conceptual Example of Scientific Import/Export
stack = IO.LOAD_STACK("measure.tif")
img = IO.TRY_LOAD("frame.fits")
norm = CV.NORMALIZE(img)
IO.SAVE norm, "preview.png"
VIDEO.CREATE "result.mp4", 25
REM Adding the processed frames to the video...
VIDEO.CLOSE
Practical note:
Video formats, especially MP4, may depend on the codecs available on the system and the build configuration. For this reason, cvBasic remains oriented both towards complete scientific data and the production of easily shareable output when the environment allows it.
Graphics, Plots, and Visualization
In addition to imaging, cvBasic includes tools for clearly representing data. Graphs and visualizations allow you to transform numbers, measurements, and intermediate results into objects that can be interpreted at a glance.
This is particularly useful in educational and scientific applications: a physical simulation, a mathematical function, an experiment on noise, frequencies, or statistical distributions become more understandable when accompanied by a high-quality visual representation.
- Data Plots Ideal for curves, experimental measurements, comparisons, and mathematical functions.
- Vector Graphics Useful for building diagrams, annotations, and geometric representations.
- 3D Visualization Designed for demos, surfaces, spatial structures, and educational scenes.
- Demonstration Outputs Images and results can be saved and reused in reports or web pages.
From the simplicity of BASIC to complex functions
The strength of BASIC is its immediacy: few instructions, a readable flow, and a quick learning curve. cvBasic maintains this philosophy, but combines it with modern computing capabilities.
This means that even non-trivial functions, such as video magnification or more elaborate visual analysis procedures, can be called and combined within a script. The same environment can therefore be used for both simple introductory examples and more sophisticated experiments.
REM Conceptual Example of a cvBasic Flow
img = IO.TRY_LOAD("input.png")
gray = CV.TO_GRAY(img)
edges = CV.CANNY(gray, 80, 160)
IO.SAVE edges, "edges.png"
PRINT "Processing Completed"
Math and Physics Teaching
From the first version, it's possible to create educational demos dedicated to mathematics and physics. A teacher, student, or experimenter can quickly build interactive or reproducible examples: functions, distributions, trajectories, fields, surfaces, transformations, and numerical results can be calculated and represented graphically.
The advantage is the continuity between code and result: the script describes the experiment, while the interpreter allows you to immediately observe its output. This makes cvBasic suitable for both lessons and demonstrations, as well as small personal research and testing laboratories.
Guiding idea: make visual experimentation faster, more readable, and more user-friendly, without sacrificing the power of the underlying native libraries.
C++ Extensions for Expert Users
For those who want to go beyond the already available functions, cvBasic offers an extension system via DLL libraries. Users can create an external C++ library, register new commands and functions, provide descriptions and help strings, and find them integrated into the environment.
The system is designed to avoid unnecessary dependencies: the user library can be written in pure C++, without Qt, but those who wish can still use Qt, OpenCV, or other libraries within their own projects.
To make the first step easier, cvBasic also includes a wizard to create a pre-built Visual Studio 2019 project. This allows expert users to start from a working skeleton and focus directly on their own functions.
- Automatically loaded DLLs: Libraries are detected from the dedicated folder when the program starts.
- Custom commands and functions: New symbols become available in BASIC scripts.
- Dynamic help: Library descriptions are added to the internal documentation system.
- Advanced type support: In addition to scalar types, extensions can also work with images and arrays.
An interface to LLAMA-SERVER is also available, allowing the use of AI for automatic code generation. The choice of model varies greatly depending on the available hardware. From tests conducted directly from the cvBasic environment, to date, the Qwen3.6-35B model has emerged as the best tested for automatic code generation.
If you like this application and want to contribute to its development and improvement you can make a donation .... Thanks!