A modern BASIC interpreter - OfficinaTurini

Go to content
cvBasic
A modern BASIC interpreter, designed to explore images, data, graphics, mathematics, and physics with the simplicity of a script and the power of OpenCV.

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!
Un altro interprete BASIC? Ebbene sì.
cvBasic nasce da un’idea semplice: rendere accessibili molte operazioni di imaging, analisi numerica e visualizzazione senza dover ogni volta costruire un intero progetto C++.
Il linguaggio mantiene la familiarità e l’immediatezza del BASIC, ma dietro le quinte utilizza un motore orientato all’elaborazione delle immagini e completamente basato su OpenCV. Questo permette di scrivere piccoli programmi leggibili, modificabili in pochi secondi, ma capaci di eseguire operazioni che normalmente richiederebbero molto più codice.
Il programma è pensato soprattutto per la sperimentazione, la didattica e la prototipazione rapida: caricare immagini, anche scientifiche, applicare filtri, misurare dati, generare grafici, visualizzare risultati, costruire demo scientifiche, produrre video e verificare idee algoritmiche in modo diretto.

Imaging OpenCV, FITS e TIFF AVI e MP4, Plot e dati, Grafica vettoriale, Visualizzazione 3D, Demo didattiche, Estensioni C++

Per sperimentare
Si può provare rapidamente una sequenza di filtri, confrontare risultati, salvare immagini intermedie e costruire piccoli flussi di lavoro senza ricompilare applicazioni dedicate.
Per insegnare
La sintassi BASIC riduce la distanza tra formula, algoritmo e risultato. È adatta a demo di matematica, fisica, ottica, segnali, geometria e image processing.
Per estendere
Gli utenti esperti possono aggiungere librerie esterne in C++ tramite DLL, registrando nuovi comandi e funzioni direttamente nell’interprete.

Imaging come primo cittadino
In cvBasic l’immagine non è un accessorio: è uno degli elementi centrali del linguaggio. Le funzioni basate su OpenCV permettono di eseguire operazioni classiche come conversioni colore, soglie, blur, edge detection, trasformazioni geometriche e analisi statistiche, ma anche elaborazioni più complesse e sperimentali.
L’obiettivo non è sostituire C++ o Python quando serve costruire un sistema industriale completo, ma offrire un ambiente immediato dove testare una procedura, preparare una dimostrazione o verificare rapidamente un’idea.

  • Filtri e trasformazioni Elaborazioni base e avanzate su immagini, con sintassi compatta.
  • Analisi visuale Misure, statistiche e rappresentazioni utili per capire cosa accade nei dati.
  • Video e sequenze Supporto a flussi di lavoro orientati anche a stack, frame e video.
  • Formati scientifici Lettura e scrittura di immagini con dinamica estesa, inclusi FITS e TIFF.
  • Prototipazione rapida Modifica dello script, esecuzione immediata, verifica del risultato.

Formati immagine, stack e video
cvBasic non è limitato ai formati grafici più comuni. L’ambiente è pensato anche per dati scientifici e tecnici, dove spesso servono immagini a dinamica estesa, sequenze multi-frame e file generati da strumenti di acquisizione, camere scientifiche o pipeline di misura.
Oltre ai normali formati immagine supportati dal motore OpenCV, cvBasic permette di lavorare con file FITS e TIFF, inclusi casi in cui il file contiene più piani, frame o stack. Questo rende possibile importare dati provenienti da astronomia, microscopia, imaging scientifico, camere CCD/CMOS, strumenti di laboratorio o flussi di analisi dove la profondità radiometrica è più importante della sola visualizzazione a 8 bit.

  • Formati comuni Lettura e scrittura dei principali formati immagine utilizzati nelle demo e nella documentazione, come PNG, JPEG, BMP e altri formati supportati dalla build OpenCV disponibile.
  • FITS scientifico Importazione di file FITS con attenzione alla dinamica estesa, utile per dati astronomici, sensori scientifici e immagini non necessariamente pensate per la sola visualizzazione diretta.
  • TIFF e stack Gestione di immagini TIFF anche multi-frame o organizzate come stack, adatte a sequenze, acquisizioni tecniche e dati a profondità superiore.
  • Dinamica estesa Supporto a immagini con profondità maggiore degli 8 bit, così da poter elaborare, normalizzare, misurare e solo successivamente convertire per la visualizzazione o l’esportazione.
  • Video AVI Creazione di video AVI a partire da immagini, frame elaborati, sequenze di risultati o demo didattiche generate dallo script.
  • Video MP4 Esportazione MP4 dove supportata dai codec disponibili nel sistema, utile per condividere rapidamente elaborazioni, animazioni e risultati.

Questa parte è particolarmente importante nella pratica: uno script può caricare uno stack, applicare una trasformazione, produrre immagini intermedie, generare un plot e infine salvare una sequenza video. Il dato scientifico resta quindi manipolabile durante l’elaborazione, mentre l’output finale può essere preparato per presentazioni, report o pagine web.

REM Esempio concettuale di import/export scientifico
stack = IO.LOAD_STACK("misura.tif")
img = IO.TRY_LOAD("frame.fits")
norm = CV.NORMALIZE(img)
IO.SAVE norm, "preview.png"
VIDEO.CREATE "risultato.mp4", 25
REM aggiunta dei frame elaborati al video...
VIDEO.CLOSE

Nota pratica:
i formati video, in particolare MP4, possono dipendere dai codec disponibili sul sistema e dalla configurazione della build. Per questo cvBasic rimane orientato sia al dato scientifico completo, sia alla produzione di output facilmente condivisibili quando l’ambiente lo consente.

Grafica, plot e visualizzazione
Oltre all’imaging, cvBasic include strumenti per rappresentare dati in modo chiaro. I grafici e le visualizzazioni permettono di trasformare numeri, misure e risultati intermedi in oggetti interpretabili a colpo d’occhio.
Questo è particolarmente utile nelle applicazioni didattiche e scientifiche: una simulazione fisica, una funzione matematica, un esperimento su rumore, frequenze o distribuzioni statistiche diventano più comprensibili quando sono accompagnati da una rappresentazione visiva di qualità.

  • Plot di dati Ideale per curve, misure sperimentali, confronti e funzioni matematiche.
  • Grafica vettoriale Utile per costruire schemi, annotazioni e rappresentazioni geometriche.
  • Visualizzazione 3D Pensata per demo, superfici, strutture spaziali e scene didattiche.
  • Output dimostrativi Immagini e risultati possono essere salvati e riutilizzati in report o pagine web.

Dalla semplicità del BASIC a funzioni complesse
La forza del BASIC è la sua immediatezza: poche istruzioni, flusso leggibile, apprendimento rapido. cvBasic mantiene questa filosofia, ma la collega a funzionalità moderne di elaborazione.
Questo significa che anche funzioni non banali, come la magnificazione video o procedure di analisi visuale più elaborate, possono essere richiamate e combinate all’interno di uno script. Lo stesso ambiente può quindi servire sia per semplici esempi introduttivi, sia per esperimenti più sofisticati.

REM Esempio concettuale di flusso cvBasic
img = IO.TRY_LOAD("input.png")
gray = CV.TO_GRAY(img)
edges = CV.CANNY(gray, 80, 160)
IO.SAVE edges, "edges.png"
PRINT "Elaborazione completata"

Didattica di matematica e fisica
Già dalla prima versione è possibile realizzare demo didattiche dedicate alla matematica e alla fisica. Un docente, uno studente o uno sperimentatore può costruire rapidamente esempi interattivi o riproducibili: funzioni, distribuzioni, traiettorie, campi, superfici, trasformazioni e risultati numerici possono essere calcolati e rappresentati graficamente.
Il vantaggio è la continuità tra codice e risultato: lo script descrive l’esperimento, mentre l’interprete permette di osservare immediatamente cosa produce. Questo rende cvBasic adatto sia a lezioni e dimostrazioni, sia a piccoli laboratori personali di ricerca e verifica.

Idea guida: rendere la sperimentazione visuale più rapida, più leggibile e più vicina al ragionamento dell’utente, senza rinunciare alla potenza delle librerie native sottostanti.

Estensioni C++ per utenti esperti
Per chi desidera andare oltre le funzioni già disponibili, cvBasic offre un sistema di estensioni tramite librerie DLL. L’utente può creare una libreria C++ esterna, registrare nuovi comandi e nuove funzioni, fornire descrizioni e stringhe di help, e ritrovarle integrate nell’ambiente.
Il sistema è pensato per non imporre dipendenze inutili: la libreria utente può essere scritta in C++ puro, senza Qt, ma chi lo desidera può comunque usare Qt, OpenCV o altre librerie all’interno del proprio progetto.
Per facilitare il primo passo, cvBasic include anche una funzione guidata per creare un progetto Visual Studio 2019 già predisposto. In questo modo l’utente esperto può partire da uno scheletro funzionante e concentrarsi direttamente sulle proprie funzioni.

  • DLL caricate automaticamenteLe librerie vengono rilevate dalla cartella dedicata all’avvio del programma.
  • Comandi e funzioni personalizzateI nuovi simboli diventano disponibili nello script BASIC.
  • Help dinamicoLe descrizioni della libreria entrano nel sistema di documentazione interno.
  • Supporto a tipi avanzatiOltre ai tipi scalari, le estensioni possono lavorare anche con immagini e array.

In via sperimentale e' presente anche una interfaccia verso LLAMA-SERVER, questo permette di utilizzare una IA per la generazione automatica di codice. La scelta del modello varia molto con l'hardware disponibile, da test fatti, realizzabilii direttamente dall'ambiente cvBasic, ad oggi, ci risulta il Qwen3.6-35B come miglior modello testato per la generazione di codice automatico.

Se questa applicazione é di tuo gradimento e vuoi contribuire al suo sviluppo e miglioramento puoi fare una donazione .... Grazie!
Examples of HTML reports created with cvBasic
- Linear Algebra

Videos created with cvBasic
The complete program (x64) : Tested on Win 10 x64. We recommend that you set it to administrator mode, otherwise some features may not work.

System libraries you may need ....


Revision History:
  • 0.0.1 2026/05/18   : First release
There are no reviews yet.
0
0
0
0
0

Free counters!
VAT: IT -
(C) 2016-2026 Officina Turini, Tutti i diritti riservati
Back to content