diff --git a/share/openbr/likely/face_recognition.tex b/share/openbr/likely/face_recognition.tex index 09b10e3..52a41e9 100644 --- a/share/openbr/likely/face_recognition.tex +++ b/share/openbr/likely/face_recognition.tex @@ -16,6 +16,21 @@ This document represents a long-term effort to port the OpenBR face recognition As Likely is a literate programming language, this document is both the source code \emph{and} the documentation. \end{abstract} +\section{Quantization} +\begin{likely} +quantize := + training-data :-> + src :-> + { + dst := (imitate-size src (imitate-dimensions u8 src.type)) + lo := training-data.min-element + hi := training-data.max-element + scale := (/ 255 (- hi lo)) + (dst src lo scale) :=> + dst :<- src.(- lo).(* scale) + } +\end{likely} + \section{Consolidated Algorithm} The top level definition of the face recognition algorithm. @@ -23,9 +38,8 @@ The top level definition of the face recognition algorithm. face-recognition := src :-> { - dst := src.imitate - (dst src) :=> - dst :<- src + algorithm := (quantize data) + (algorithm src) } \end{likely} @@ -33,7 +47,7 @@ face-recognition := The entry point to the outside world is a single C function \texttt{face\_recognition} that takes as input a \texttt{likely\_mat} (the input image) and outputs a new \texttt{likely\_mat} (the feature vector). \begin{likely} -(extern u8CXY "face_recognition" u8CXY face-recognition) +(extern u8X "face_recognition" f32X face-recognition) \end{likely} -\end{document} \ No newline at end of file +\end{document}