[Tex/LaTex] Appendix title showing up after the image contents

appendices

The appendix title does not come in the beginning, rather the content is being shown at first. The first appendix where there is only text, shows up with Appendix at top and then text follows it, however, for the case where there is image in appendix, first the image shows up then, the title for the appendix shows up.I want the appendix title come at first.

and also the MWE is :

\documentclass[12pt, a4paper]{article}
\title{\textbf{Laser Pointer Based Human-Computer-Interaction using Computer-Vision}}
\usepackage{wrapfig}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{acronym}
\usepackage[acronym]{glossaries}
\usepackage[utf8x]{inputenc}
\usepackage{caption}
\DeclareCaptionFont{mysize}{\fontsize{8}{9.6}\selectfont}
\captionsetup{font=mysize}
\usepackage[titletoc,title]{appendix}
    \apptocmd{\appendices}{\let\LaTeXStandardTheSection\thesection
    \apptocmd{\figure}{\let\thesection\LaTeXStandardTheSection}{}{}
\apptocmd{\thesection}{:}{}{}}{}{}
\begin{document}

\begin{appendices}
\section{Raspberry Pi and Camera Board}
    Raspberry Pi is a single-board computer with processor
\section{Projected Screen After Exposure Correction}
\begin{figure}[htp]
\includegraphics[scale=0.30]{projectorwithout.png}
\caption{Projected Screen After Exposure Correction}
\label{}
\end{figure}
\end{appendices}
\end{document}

Best Answer

I prefer to define an environment basically compatible to figure making it possible to give captions and labels and hence being able to reference the pictures in the appendix.

\documentclass[12pt, a4paper]{article}
\title{\textbf{Laser Pointer Based Human-Computer-Interaction using Computer-Vision}}
\usepackage{wrapfig}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{acronym}
\usepackage[acronym]{glossaries}
\usepackage[utf8x]{inputenc}
\usepackage{caption}
\DeclareCaptionFont{mysize}{\fontsize{8}{9.6}\selectfont}
\captionsetup{font=mysize}
\usepackage[titletoc,title]{appendix}
    \apptocmd{\appendices}{\let\LaTeXStandardTheSection\thesection
    \apptocmd{\figure}{\let\thesection\LaTeXStandardTheSection}{}{}
\apptocmd{\thesection}{:}{}{}}{}{}

\usepackage{xparse}
\makeatletter
\DeclareDocumentEnvironment{appendixfig}{}{
   \par\medskip\noindent
   \begin{minipage}{\linewidth}
   \def\@captype{figure}
   \centering
}
{
\end{minipage}
\par\bigskip
}
\makeatother 
\begin{document}

\begin{appendices}
\section{Raspberry Pi and Camera Board}
    Raspberry Pi is a single-board computer with processor
\section{Projected Screen After Exposure Correction}
\begin{appendixfig}
\includegraphics[width=.6\linewidth]{example-image}
\caption{Projected Screen After Exposure Correction}
\label{}
\end{appendixfig}
\end{appendices}
\end{document}

There are some oddities in your code; you are loading packages twice, and do you really need to use utf8x? It can do some crazy stuff when you don't expect it.