\hypertarget{group__appCNNScene}{\section{app\-C\-N\-N\-Scene}
\label{group__appCNNScene}\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}}
}


C\-N\-N scene labeling application.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structappCNNSceneDataSet}{app\-C\-N\-N\-Scene\-Data\-Set}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
float \hyperlink{group__appCNNScene_ga656def3c972943463bee38f746074b79}{app\-C\-N\-N\-Scene\-Accuracy} (int $\ast$label\-Matrix, int $\ast$true\-Label\-Matrix, int dim)
\begin{DoxyCompactList}\small\item\em Return the labeling accuracy. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_gaf308ce265a25eed146051684e2da2671}{app\-C\-N\-N\-Scene\-Supervised\-Training} (\hyperlink{struct__timlConvNeuralNetwork__}{timl\-Conv\-Neural\-Network} $\ast$cnn, \hyperlink{structappCNNSceneDataSet}{app\-C\-N\-N\-Scene\-Data\-Set} $\ast$data\-Set)
\begin{DoxyCompactList}\small\item\em Supervised training on the dataset. \end{DoxyCompactList}\item 
\hypertarget{group__appCNNScene_ga38cb0fe9d4fb06709a7e9330911c9431}{int \hyperlink{group__appCNNScene_ga38cb0fe9d4fb06709a7e9330911c9431}{app\-C\-N\-N\-Scene\-S\-B\-D\-Training} ()}\label{group__appCNNScene_ga38cb0fe9d4fb06709a7e9330911c9431}

\begin{DoxyCompactList}\small\item\em Scene labeling training example. \end{DoxyCompactList}\item 
\hypertarget{group__appCNNScene_gaa2f9ce79a0aaf4a15ef414ac09f0ca7d}{int \hyperlink{group__appCNNScene_gaa2f9ce79a0aaf4a15ef414ac09f0ca7d}{app\-C\-N\-N\-Scene\-S\-B\-D\-Testing} ()}\label{group__appCNNScene_gaa2f9ce79a0aaf4a15ef414ac09f0ca7d}

\begin{DoxyCompactList}\small\item\em Standford Backgournd Database Scene labeling testing example. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_ga4924a13edce94afaba52667d78ef7256}{app\-C\-N\-N\-Scene\-Classify} (\hyperlink{struct__timlConvNeuralNetwork__}{timl\-Conv\-Neural\-Network} $\ast$cnn, \hyperlink{structtimlUtilImage}{timl\-Util\-Image} image, int $\ast$label\-Matrix, int scale)
\begin{DoxyCompactList}\small\item\em Pixel label classification. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_gae6081de152d81c0f91f2ce6f53683848}{app\-C\-N\-N\-Scene\-Shuffle\-Idx} (int $\ast$image\-Idx, int $\ast$row\-Idx, int $\ast$col\-Idx, \hyperlink{structappCNNSceneDataSet}{app\-C\-N\-N\-Scene\-Data\-Set} $\ast$data\-Set)
\begin{DoxyCompactList}\small\item\em Shuffles the (image, row, col) index combination from the data set. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_ga963efff2a4368b6ddc7340d8e24e69bc}{app\-C\-N\-N\-Scene\-Get\-Label} (int image\-Idx, int row\-Idx, int col\-Idx, \hyperlink{structappCNNSceneDataSet}{app\-C\-N\-N\-Scene\-Data\-Set} $\ast$data\-Set)
\begin{DoxyCompactList}\small\item\em Return the pixel label for (image, row, col) index combination. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_ga40b5369e66533ed261ba62199b223cff}{app\-C\-N\-N\-Scene\-Get\-Patch} (int image\-Idx, int row\-Idx, int col\-Idx, \hyperlink{structappCNNSceneDataSet}{app\-C\-N\-N\-Scene\-Data\-Set} $\ast$data\-Set, float $\ast$patch)
\begin{DoxyCompactList}\small\item\em Return the image patch for (image, row, col) index combination. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_gad77aeeb63649011f260d9c475bef945d}{app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P} (\hyperlink{struct__timlConvNeuralNetwork__}{timl\-Conv\-Neural\-Network} $\ast$$\ast$cnn\-Team, int team\-Num, float $\ast$data, int row, int col, int channel, int $\ast$label\-Matrix, int scale)
\begin{DoxyCompactList}\small\item\em Supervised training on the dataset using openmp. \end{DoxyCompactList}\item 
int \hyperlink{group__appCNNScene_ga99dbed533d0ee1089e655bb3bc507a62}{app\-C\-N\-N\-Scene\-Label\-Matrix} (float $\ast$map, int row, int col, int channel, int m, int k, int $\ast$label\-Matrix, int num\-Row, int num\-Col)
\begin{DoxyCompactList}\small\item\em Fill the label matrix. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
C\-N\-N scene labeling application. 

\subsection{Function Documentation}
\hypertarget{group__appCNNScene_ga656def3c972943463bee38f746074b79}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Accuracy@{app\-C\-N\-N\-Scene\-Accuracy}}
\index{app\-C\-N\-N\-Scene\-Accuracy@{app\-C\-N\-N\-Scene\-Accuracy}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Accuracy}]{\setlength{\rightskip}{0pt plus 5cm}float app\-C\-N\-N\-Scene\-Accuracy (
\begin{DoxyParamCaption}
\item[{int $\ast$}]{label\-Matrix, }
\item[{int $\ast$}]{true\-Label\-Matrix, }
\item[{int}]{dim}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_ga656def3c972943463bee38f746074b79}


Return the labeling accuracy. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em label\-Matrix} & Generated label matrix \\
\hline
\mbox{\tt in}  & {\em true\-Label\-Matrix} & True label matrix \\
\hline
\mbox{\tt in}  & {\em dim} & Dimension of the label matrix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Labeling accuracy percentage 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_ga4924a13edce94afaba52667d78ef7256}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Classify@{app\-C\-N\-N\-Scene\-Classify}}
\index{app\-C\-N\-N\-Scene\-Classify@{app\-C\-N\-N\-Scene\-Classify}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Classify}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Classify (
\begin{DoxyParamCaption}
\item[{{\bf timl\-Conv\-Neural\-Network} $\ast$}]{cnn, }
\item[{{\bf timl\-Util\-Image}}]{image, }
\item[{int $\ast$}]{label\-Matrix, }
\item[{int}]{scale}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_ga4924a13edce94afaba52667d78ef7256}


Pixel label classification. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em cnn} & C\-N\-N \\
\hline
\mbox{\tt in}  & {\em image} & Image \\
\hline
\mbox{\tt in,out}  & {\em label\-Matrix} & Generated label matrix \\
\hline
\mbox{\tt in}  & {\em scale} & Down scaling factor of the label matrix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_gad77aeeb63649011f260d9c475bef945d}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P@{app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P}}
\index{app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P@{app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Classify\-Open\-M\-P (
\begin{DoxyParamCaption}
\item[{{\bf timl\-Conv\-Neural\-Network} $\ast$$\ast$}]{cnn\-Team, }
\item[{int}]{team\-Num, }
\item[{float $\ast$}]{data, }
\item[{int}]{row, }
\item[{int}]{col, }
\item[{int}]{channel, }
\item[{int $\ast$}]{label\-Matrix, }
\item[{int}]{scale}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_gad77aeeb63649011f260d9c475bef945d}


Supervised training on the dataset using openmp. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em cnn\-Team} & An array of C\-N\-Ns that share the same parameters \\
\hline
\mbox{\tt in}  & {\em team\-Num} & Team number \\
\hline
\mbox{\tt in}  & {\em data} & Image data \\
\hline
\mbox{\tt in}  & {\em row} & Image row \\
\hline
\mbox{\tt in}  & {\em col} & Image col \\
\hline
\mbox{\tt in}  & {\em channel} & Image channel \\
\hline
\mbox{\tt in,out}  & {\em label\-Matrix} & Generated label matrix \\
\hline
\mbox{\tt in}  & {\em scale} & Down scaling factor of the label matrix \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_ga963efff2a4368b6ddc7340d8e24e69bc}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Get\-Label@{app\-C\-N\-N\-Scene\-Get\-Label}}
\index{app\-C\-N\-N\-Scene\-Get\-Label@{app\-C\-N\-N\-Scene\-Get\-Label}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Get\-Label}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Get\-Label (
\begin{DoxyParamCaption}
\item[{int}]{image\-Idx, }
\item[{int}]{row\-Idx, }
\item[{int}]{col\-Idx, }
\item[{{\bf app\-C\-N\-N\-Scene\-Data\-Set} $\ast$}]{data\-Set}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_ga963efff2a4368b6ddc7340d8e24e69bc}


Return the pixel label for (image, row, col) index combination. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em image\-Idx} & Image index \\
\hline
\mbox{\tt in}  & {\em row\-Idx} & Row index \\
\hline
\mbox{\tt in}  & {\em col\-Idx} & Col index \\
\hline
\mbox{\tt in}  & {\em data\-Set} & Data set \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pixel label 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_ga40b5369e66533ed261ba62199b223cff}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Get\-Patch@{app\-C\-N\-N\-Scene\-Get\-Patch}}
\index{app\-C\-N\-N\-Scene\-Get\-Patch@{app\-C\-N\-N\-Scene\-Get\-Patch}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Get\-Patch}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Get\-Patch (
\begin{DoxyParamCaption}
\item[{int}]{image\-Idx, }
\item[{int}]{row\-Idx, }
\item[{int}]{col\-Idx, }
\item[{{\bf app\-C\-N\-N\-Scene\-Data\-Set} $\ast$}]{data\-Set, }
\item[{float $\ast$}]{patch}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_ga40b5369e66533ed261ba62199b223cff}


Return the image patch for (image, row, col) index combination. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em image\-Idx} & image index \\
\hline
\mbox{\tt in}  & {\em row\-Idx} & row index \\
\hline
\mbox{\tt in}  & {\em col\-Idx} & col index \\
\hline
\mbox{\tt in}  & {\em data\-Set} & data set \\
\hline
\mbox{\tt in,out}  & {\em patch} & image patch \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_ga99dbed533d0ee1089e655bb3bc507a62}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Label\-Matrix@{app\-C\-N\-N\-Scene\-Label\-Matrix}}
\index{app\-C\-N\-N\-Scene\-Label\-Matrix@{app\-C\-N\-N\-Scene\-Label\-Matrix}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Label\-Matrix}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Label\-Matrix (
\begin{DoxyParamCaption}
\item[{float $\ast$}]{map, }
\item[{int}]{row, }
\item[{int}]{col, }
\item[{int}]{channel, }
\item[{int}]{m, }
\item[{int}]{k, }
\item[{int $\ast$}]{label\-Matrix, }
\item[{int}]{num\-Row, }
\item[{int}]{num\-Col}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_ga99dbed533d0ee1089e655bb3bc507a62}


Fill the label matrix. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em map} & Feature map output of a C\-N\-N \\
\hline
\mbox{\tt in}  & {\em row} & Image row \\
\hline
\mbox{\tt in}  & {\em col} & Image col \\
\hline
\mbox{\tt in}  & {\em channel} & Image channel \\
\hline
\mbox{\tt in}  & {\em m} & Row Index \\
\hline
\mbox{\tt in}  & {\em k} & Col Index \\
\hline
\mbox{\tt out}  & {\em label\-Matrix} & Label matrix \\
\hline
\mbox{\tt in}  & {\em num\-Row} & Num of rows \\
\hline
\mbox{\tt in}  & {\em num\-Col} & Num of cols \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_gae6081de152d81c0f91f2ce6f53683848}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Shuffle\-Idx@{app\-C\-N\-N\-Scene\-Shuffle\-Idx}}
\index{app\-C\-N\-N\-Scene\-Shuffle\-Idx@{app\-C\-N\-N\-Scene\-Shuffle\-Idx}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Shuffle\-Idx}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Shuffle\-Idx (
\begin{DoxyParamCaption}
\item[{int $\ast$}]{image\-Idx, }
\item[{int $\ast$}]{row\-Idx, }
\item[{int $\ast$}]{col\-Idx, }
\item[{{\bf app\-C\-N\-N\-Scene\-Data\-Set} $\ast$}]{data\-Set}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_gae6081de152d81c0f91f2ce6f53683848}


Shuffles the (image, row, col) index combination from the data set. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em image\-Idx} & Image index array ptr \\
\hline
\mbox{\tt in,out}  & {\em row\-Idx} & Row index array ptr \\
\hline
\mbox{\tt in,out}  & {\em col\-Idx} & Col index array ptr \\
\hline
\mbox{\tt in}  & {\em data\-Set} & Data set \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
\hypertarget{group__appCNNScene_gaf308ce265a25eed146051684e2da2671}{\index{app\-C\-N\-N\-Scene@{app\-C\-N\-N\-Scene}!app\-C\-N\-N\-Scene\-Supervised\-Training@{app\-C\-N\-N\-Scene\-Supervised\-Training}}
\index{app\-C\-N\-N\-Scene\-Supervised\-Training@{app\-C\-N\-N\-Scene\-Supervised\-Training}!appCNNScene@{app\-C\-N\-N\-Scene}}
\subsubsection[{app\-C\-N\-N\-Scene\-Supervised\-Training}]{\setlength{\rightskip}{0pt plus 5cm}int app\-C\-N\-N\-Scene\-Supervised\-Training (
\begin{DoxyParamCaption}
\item[{{\bf timl\-Conv\-Neural\-Network} $\ast$}]{cnn, }
\item[{{\bf app\-C\-N\-N\-Scene\-Data\-Set} $\ast$}]{data\-Set}
\end{DoxyParamCaption}
)}}\label{group__appCNNScene_gaf308ce265a25eed146051684e2da2671}


Supervised training on the dataset. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em cnn} & C\-N\-N \\
\hline
\mbox{\tt in}  & {\em data\-Set} & Data set \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Error code 
\end{DoxyReturn}
