\chapter{Alpha Blender Application Documentation}
\hypertarget{index}{}\label{index}\index{Alpha Blender Application Documentation@{Alpha Blender Application Documentation}}
\hypertarget{index_intro_sec}{}\doxysection{\texorpdfstring{Introduction}{Introduction}}\label{index_intro_sec}
This is the User Manual for Alpha Blender. The user can measure overlap data and apply transparency masks to projected content, though Alpha Blender has some conditions that depend on external devices and specific environmental configurations. Alpha Blender visualizes data obtained from physical projector measurements and records the data for further usage in multi-\/projector setting. This User Manual is divided into the following sections\+:\hypertarget{index_arch_sec}{}\doxysection{\texorpdfstring{System Architecture and Logic}{System Architecture and Logic}}\label{index_arch_sec}
The application is built on a modular Python architecture designed for high-\/performance image manipulation using the Open\+CV library. The system is divided into two primary components\+:


\begin{DoxyEnumerate}
\item {\bfseries{Main\+Alpha\+Blender}}\+: This is the main controller class for performing the alpha-\/blending. It handles image processing, overlap estimation, and the application of the spatially smooth alpha mask.
\item {\bfseries{Config\+Reader}}\+: This helper class reads and provides configuration values for the alpha-\/blending system. It loads a JSON configuration file and exposes accessor methods that return typed values for physical projector parameters and runtime options.
\end{DoxyEnumerate}\hypertarget{index_math_sec}{}\doxysection{\texorpdfstring{Mathematical Foundation}{Mathematical Foundation}}\label{index_math_sec}
The program applies gamma-\/corrected alpha blending to overlapping projector images to avoid visible seams. Standard linear blending often results in "{}hotspots"{} or dark bands because projectors do not have a linear luminance response.

Example of Latex\+: The Pythagorian logic of image blending uses the Gamma Correction equation ( $ M(x) = B(x)^{1/\gamma} $) which was proved to compensate for projector luminance behavior.

In this formula\+:
\begin{DoxyItemize}
\item $ M(x) $ is the calculated mask value.
\item $ B(x) $ is the linear ramp value (0 to 1).
\item $ \gamma $ is the gamma value, typically 2.\+4, which is crucial for projector luminance compensation.
\end{DoxyItemize}\hypertarget{index_image_sec}{}\doxysection{\texorpdfstring{Visualization of Blending Process}{Visualization of Blending Process}}\label{index_image_sec}
Below is the visualization of the data processing process. To create an alpha mask, the program identifies the overlap region and applies the calculated curve to the alpha channel.\hypertarget{index_before_sub}{}\doxysubsection{\texorpdfstring{Before Mask Application}{Before Mask Application}}\label{index_before_sub}
The following images represent the raw projector inputs. Without the alpha mask, the overlapping region where these two images meet would appear significantly brighter than the rest of the display.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
 &  \\\cline{1-2}
\PBS\centering Left Image\+: Gamma-\/\+Corrected Fade &\PBS\centering Right Image\+: Gamma-\/\+Corrected Fade  \\\cline{1-2}
\end{longtabu}
\hypertarget{index_after_sub}{}\doxysubsection{\texorpdfstring{After Mask Application}{After Mask Application}}\label{index_after_sub}
The following images show the result of the {\ttfamily Main\+Alpha\+Blender} execution. The transparency has been adjusted based on the {\ttfamily side} parameter—"{}left"{} or "{}right"{}—defined in the configuration.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
 &  \\\cline{1-2}
\PBS\centering Left Image\+: Gamma-\/\+Corrected Fade &\PBS\centering Right Image\+: Gamma-\/\+Corrected Fade  \\\cline{1-2}
\end{longtabu}
\hypertarget{index_config_sec}{}\doxysection{\texorpdfstring{Configuration and Usage}{Configuration and Usage}}\label{index_config_sec}
The {\ttfamily Config\+Reader} module parses {\ttfamily config.\+json} to determine the overlap pixels based on the physical width of the projected image and the distance between the projector lenses. If the physical width is 200cm and the distance is 150cm, the software calculates an overlap ratio of approximately 16.\+6\%.


\begin{DoxyItemize}
\item {\bfseries{Projected Width}}\+: The width of one projector\textquotesingle{}s image in centimeters.
\item {\bfseries{Distance}}\+: The physical distance between projector lenses.
\item {\bfseries{Side}}\+: The side this instance represents, either "{}left"{} or "{}right"{}.
\item {\bfseries{Gamma}}\+: The correction value used to raise the curve to power (1/gamma).
\end{DoxyItemize}

\begin{DoxyNote}{Note}
To avoid confusion, our project requires you to manually split the image into left and right. The value we used for gamma is 2.\+4. 
\end{DoxyNote}
