postkiss.cpp

POSTprocessing for KISS

2026 by H. Dietz, https://aggregate.org/hankd

postkiss is distributed under CC BY 4.0:
https://creativecommons.org/licenses/by/4.0/legalcode.en

260926	Initial version

To install:

1. Unpack the tar file and cd into the directory created.
Since you're reading this, you're probably there now.  ;-)

2. Issue "cmake ."

3. Issue "make"

That's it. You do need libraries like OpenCV, and the DNN option
here ("-d") will not work without files like 2EDSR from the
OpenCV DNN package.

To use:

This code combines four completely separate functions for
postprocessing images from the KISS cameras. The KISS images are
presented as JPEGs with up to 1600x1200 pixels, which is the
OV2640 sensor resolution.  Image quality will never be stunning,
but we can improve it more than a little:

1. Subtract-out shading and color bias from a "white" frame. The
OV2640 provides for lens correction, but the correction should
be lens dependent and KISS is not using the supplied lens.
Shading can also happen due to the NIR-blocking filter we
(optionally) use.

2. Perform image enhancement as per KEMY: KentuckY Error
Modeler.  This is the default action of postkiss. It uses an
empirically-determined probability density function (PDF) to
drive a texture synthesis algorithm that reduces noise while
tending to improve sharpness.

3. Perform superresolution image stitching as per PARSEK:
Probabilistic Alignment Raw Sticher Experiment from Kentucky.
This also uses empirically-determined PDFs, but fundamentally is
performing classical aligned multi-shot superresolution.
Although Parsek was really designed to improve pixel-shift
performance, there is generally enough motion between shots even
from just pressing the shutter button with the camera on a
tripod.  The catch is that the slow rolling shutter of the
OV2640 often means motion will be inconsistent across the frame,
which this doesn't directly correct.

4. Perform trained AI single-image superresolution processing.
This uses the OpenCV code for EDSR, ESPCN, FSRCNN, or LapSRN
(which is NOT included with the postkiss source). It is applied
as a final step, so a sequence of images can be superresolution
processed into a single image and then that result can be
single-image superresolution processed. The methods used are
relatively conservative, favoring faithfulness to the scene over
massive increases in resolution.

See Usage line for options.
