How can one camera supply video, analysis, recording and several interfaces without each function doing the same work again?
In the beginning, there was only PolarScope
In 2019, I was already imagining a digital polar scope for my Takahashi EM-10 astronomy mount using a Raspberry Pi camera and Pi Zero. My polar-scope notes from that time also describe calibration of the polar axis and stellar correlation tests. I did not finish that first version, but it became the basis for the 2026 version that would lead to EIP.
For this first project, I built a printed holder that adapts a CS lens to a Raspberry Pi camera and mounts it on the EM-10. The mechanical work went hand in hand with the software I wanted to develop for a polar scope; I describe it in my mechanical polar-scope project.
On 14 August 2026, I recorded the first commit of this new PolarScope version, my polar-alignment application, in the current repository. The next day I was already controlling the Raspberry Pi camera directly in memory. Two days later, continuous acquisition and alternating buffers avoided waiting for each processing step to finish before requesting the next image.
Client/server separation arrived on 19 August. The interface no longer depended on a particular camera: it used a generic protocol. The web server, PiNox, Dashboard, Projection and Characterisation bench then grew around the same camera images and settings. On 23 September this foundation officially became Embedded Imaging Platform. PolarScope is its historical starting point and remains one application among others: EIP has become a general-purpose embedded imaging platform.
One component controls the camera
Several programs independently reconfiguring the sensor would eventually get in each other's way. EIP follows a simple rule: one server controls the camera, selects its mode and exposure, and handles startup and shutdown. Interfaces become clients of that server; they request services without taking control of the hardware.
This arrangement is a modular monolith. Deployment remains a single service, but the code is divided into drivers, an imaging core, astronomy services and applications. Drivers isolate camera-specific behaviour; new applications reuse existing services.
One frame, several lives
An image displayed in a browser has different requirements from a scientific measurement. EIP therefore maintains two complementary paths from the same capture:
The scientific path preserves sensor values in the raw data (RAW). Data can be recorded directly to local storage without depending on network throughput. The visual path can reduce the image, demosaic it, apply white balance and encode it as JPEG. With a compatible Raspberry Pi camera, the image signal processor (ISP) can accelerate this preview while the associated RAW remains available.
Using the cores without making the camera wait
The server uses several execution threads. One handles acquisition; others manage connections, prepare annotations, track a planet or write files. Calculations involving many pixels can also be distributed across cores through OpenMP (Open Multi-Processing, a parallel programming interface), above a threshold where parallel work becomes worthwhile.
Recording uses an asynchronous queue: the camera queues a frame and resumes work while storage writes it. Astronomical calculations can leave one core available for the rest of the server. Display settings remain separate from sensor settings so a gamma change does not restart a long exposure. Adding threads cannot make a sensor exceed its own frame rate.
Preparing the next image during processing
When capture and processing run one after the other, the camera waits for processing to finish before resuming. With two buffers, processing one frame can continue while another stage prepares the next. The stages overlap without necessarily starting or finishing together.
The 29 August performance test counts distinct JPEG images without confusing HTTP repeats with new frames. On Pi 4 in bin1 mode, frame rate remains near 15 FPS before and after: sensor readout is the limiting factor.
Sometimes the best calculation is the one you avoid
The architecture associates each output with its frame identifier. Luminance is shared by previews and annotations; JPEG is encoded only once even when several clients view it; each MJPEG client receives a frame only once. The memory buffers for RAW, colour and JPEG are reused to limit allocations and peak memory use.
This sharing has a measurable result: with IMX477 at 1332 × 990, EIP measures 47.7 captured frames, 47.7 RAW frames and 47.7 distinct MJPEG frames per second, with 0% duplicates. Each frame's identifier tracks the same acquisition through these processing stages.
One server, several applications
The server provides three service families. The data plane carries RAW and MJPEG. The control plane receives settings and publishes status. Application services provide astrometry, annotations, tracking, characterisation, storage and reports. Software dependencies follow these layers, but not every application needs every astronomy service.
A tablet can display PolarScope, a computer can monitor Dashboard and an HDMI screen can show Projection, while the server continues recording RAW locally without sending it through the network.
Growth without confusing size with quality
The history shows the project's growing scope, but line count measures neither quality nor performance. Here it describes the amount of production code and its accompanying tests. Between 14 August and 5 October, production code grows from 11,792 to 87,870 non-blank lines; tests grow from 279 to 24,030 lines.
src/ and embedded web applications in assets/web/. Tests are counted separately. Documentation, the editorial site, data, images, catalogues, tools and blank lines are excluded. CSV data.The sharp rise in late September corresponds to consolidation of PiNox, storage and web interfaces, followed by expansion of the test suite during modularisation and ISP integration. On 5 October the total is 87,870 non-blank lines of production code and 24,030 test lines, giving 111,900 in total. The scope and exclusions are detailed in the caption and CSV.
What this architecture provides
It enables
- a single camera owner;
- several uses of the same frame;
- decoupled capture, analysis and writing rates;
- shared calculations and memory buffers;
- local recording that bypasses network limits;
- several applications sharing the same camera state.
It does not guarantee
- that a Pi exceeds the sensor's frame rate;
- that all parallelism improves performance;
- that a monolithic server suits thousands of clients;
- that more code means better quality.
The HTTP server remains large, and some application functions still need to be extracted from its orchestration layer. Parallelism cannot overcome a sensor, network or storage limit either. Its value lies in coherence: one camera, one timeline and several uses sharing work already done.
Continue reading
Other version
EIP's concurrent architecture — Scientific version · Modules, measurements, protocols and limitations.