\hypertarget{image_8h}{}\section{image.\+h File Reference} \label{image_8h}\index{image.\+h@{image.\+h}} Functions for image treatment. {\ttfamily \#include $<$raspicam/raspicam\+\_\+cv.\+h$>$}\newline {\ttfamily \#include \char`\"{}opencv2/imgproc/imgproc.\+hpp\char`\"{}}\newline {\ttfamily \#include $<$unistd.\+h$>$}\newline {\ttfamily \#include $<$math.\+h$>$}\newline Include dependency graph for image.\+h\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{image_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=208pt]{image_8h__dep__incl} \end{center} \end{figure} \subsection*{Classes} \begin{DoxyCompactItemize} \item struct \hyperlink{struct_position}{Position} \end{DoxyCompactItemize} \subsection*{Macros} \begin{DoxyCompactItemize} \item \#define \hyperlink{image_8h_a241aeeb764887ae5e3de58b98f04b16d}{W\+I\+D\+TH}~480 \item \#define \hyperlink{image_8h_aed89bd71aee8be823e8a20ec4e093c1e}{H\+E\+I\+G\+HT}~360 \end{DoxyCompactItemize} \subsection*{Typedefs} \begin{DoxyCompactItemize} \item typedef Mat \hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} \item typedef Raspi\+Cam\+\_\+\+Cv \hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} \item typedef Rect \hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} \item typedef vector$<$ unsigned char $>$ \hyperlink{image_8h_a9ac2855e21920c676a108df386ff9415}{Jpg} \end{DoxyCompactItemize} \subsection*{Functions} \begin{DoxyCompactItemize} \item int \hyperlink{image_8h_aca0662ab31eac7fdb2d64fecc52ff1da}{open\+\_\+camera} (\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$camera) \begin{DoxyCompactList}\small\item\em Ouvre une camera. \end{DoxyCompactList}\item void \hyperlink{image_8h_a19eac11a04cb4b86fd32e6a36445ad5d}{close\+\_\+camera} (\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$camera) \begin{DoxyCompactList}\small\item\em Ferme la camera passé en paramètre. \end{DoxyCompactList}\item void \hyperlink{image_8h_ad904f3348c2d44f9c82435c94cd83844}{get\+\_\+image} (\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$camera, \hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$mon\+Image, const char $\ast$fichier=N\+U\+LL) \begin{DoxyCompactList}\small\item\em Capture une image avec la camera passée en entrée. En cas de test sans camera, la fonction charge une image. \end{DoxyCompactList}\item int \hyperlink{image_8h_acad45df4061a55f17be0db97c1406249}{detect\+\_\+arena} (\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$mon\+Image, \hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$rectangle) \begin{DoxyCompactList}\small\item\em Détecte une arène dans une image fournis en paramètre. \end{DoxyCompactList}\item void \hyperlink{image_8h_a5ffd032a466af45a505fb46252194bbf}{draw\+\_\+arena} (\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Input, \hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Output, \hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$mon\+Arene) \begin{DoxyCompactList}\small\item\em Dessine le plus petit rectangle contenant l\textquotesingle{}arène. \end{DoxyCompactList}\item int \hyperlink{image_8h_af9f6e2dd4409486f2f6446d1a8a02c40}{detect\+\_\+position} (\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Input, \hyperlink{struct_position}{Position} $\ast$pos\+Triangle, \hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$mon\+Arene=N\+U\+LL) \begin{DoxyCompactList}\small\item\em Détecte la position d\textquotesingle{}un robot. \end{DoxyCompactList}\item void \hyperlink{image_8h_a869c3946d4a414b8730ca4f91fbd9556}{draw\+\_\+position} (\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Input, \hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Output, \hyperlink{struct_position}{Position} $\ast$position\+Robot) \begin{DoxyCompactList}\small\item\em Dessine sur une image en entrée la position d\textquotesingle{}un robot et sa direction. \end{DoxyCompactList}\item void \hyperlink{image_8h_a909ca7577f0ac2e4bd0ea21291690dce}{compress\+\_\+image} (\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$img\+Input, \hyperlink{image_8h_a9ac2855e21920c676a108df386ff9415}{Jpg} $\ast$image\+Compress) \begin{DoxyCompactList}\small\item\em Détecte la position d\textquotesingle{}un robot. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Detailed Description} Functions for image treatment. \begin{DoxyAuthor}{Author} L.\+Senaneuch \end{DoxyAuthor} \begin{DoxyVersion}{Version} 1.\+0 \end{DoxyVersion} \begin{DoxyDate}{Date} 06/06/2017 \end{DoxyDate} This file use open\+C\+V2 library for picture processing. This allow to detect arena and robot. \subsection{Macro Definition Documentation} \mbox{\Hypertarget{image_8h_aed89bd71aee8be823e8a20ec4e093c1e}\label{image_8h_aed89bd71aee8be823e8a20ec4e093c1e}} \index{image.\+h@{image.\+h}!H\+E\+I\+G\+HT@{H\+E\+I\+G\+HT}} \index{H\+E\+I\+G\+HT@{H\+E\+I\+G\+HT}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{H\+E\+I\+G\+HT}{HEIGHT}} {\footnotesize\ttfamily \#define H\+E\+I\+G\+HT~360} Definition at line 45 of file image.\+h. \mbox{\Hypertarget{image_8h_a241aeeb764887ae5e3de58b98f04b16d}\label{image_8h_a241aeeb764887ae5e3de58b98f04b16d}} \index{image.\+h@{image.\+h}!W\+I\+D\+TH@{W\+I\+D\+TH}} \index{W\+I\+D\+TH@{W\+I\+D\+TH}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{W\+I\+D\+TH}{WIDTH}} {\footnotesize\ttfamily \#define W\+I\+D\+TH~480} Definition at line 44 of file image.\+h. \subsection{Typedef Documentation} \mbox{\Hypertarget{image_8h_aa856a7cb8a1535c9f13096bede6c8586}\label{image_8h_aa856a7cb8a1535c9f13096bede6c8586}} \index{image.\+h@{image.\+h}!Arene@{Arene}} \index{Arene@{Arene}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{Arene}{Arene}} {\footnotesize\ttfamily typedef Rect \hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene}} Definition at line 66 of file image.\+h. \mbox{\Hypertarget{image_8h_a739dda3f6f6ddbab22617837b43a692a}\label{image_8h_a739dda3f6f6ddbab22617837b43a692a}} \index{image.\+h@{image.\+h}!Camera@{Camera}} \index{Camera@{Camera}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{Camera}{Camera}} {\footnotesize\ttfamily typedef Raspi\+Cam\+\_\+\+Cv \hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera}} Definition at line 58 of file image.\+h. \mbox{\Hypertarget{image_8h_a466446fef9c0348568bc6743186d1a38}\label{image_8h_a466446fef9c0348568bc6743186d1a38}} \index{image.\+h@{image.\+h}!Image@{Image}} \index{Image@{Image}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{Image}{Image}} {\footnotesize\ttfamily typedef Mat \hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image}} Definition at line 55 of file image.\+h. \mbox{\Hypertarget{image_8h_a9ac2855e21920c676a108df386ff9415}\label{image_8h_a9ac2855e21920c676a108df386ff9415}} \index{image.\+h@{image.\+h}!Jpg@{Jpg}} \index{Jpg@{Jpg}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{Jpg}{Jpg}} {\footnotesize\ttfamily typedef vector$<$unsigned char$>$ \hyperlink{image_8h_a9ac2855e21920c676a108df386ff9415}{Jpg}} Definition at line 67 of file image.\+h. \subsection{Function Documentation} \mbox{\Hypertarget{image_8h_a19eac11a04cb4b86fd32e6a36445ad5d}\label{image_8h_a19eac11a04cb4b86fd32e6a36445ad5d}} \index{image.\+h@{image.\+h}!close\+\_\+camera@{close\+\_\+camera}} \index{close\+\_\+camera@{close\+\_\+camera}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{close\+\_\+camera()}{close\_camera()}} {\footnotesize\ttfamily void close\+\_\+camera (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$}]{camera }\end{DoxyParamCaption})} Ferme la camera passé en paramètre. \begin{DoxyParams}{Parameters} {\em camera} & Pointeur sur la camera à fermer \\ \hline \end{DoxyParams} \mbox{\Hypertarget{image_8h_a909ca7577f0ac2e4bd0ea21291690dce}\label{image_8h_a909ca7577f0ac2e4bd0ea21291690dce}} \index{image.\+h@{image.\+h}!compress\+\_\+image@{compress\+\_\+image}} \index{compress\+\_\+image@{compress\+\_\+image}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{compress\+\_\+image()}{compress\_image()}} {\footnotesize\ttfamily void compress\+\_\+image (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Input, }\item[{\hyperlink{image_8h_a9ac2855e21920c676a108df386ff9415}{Jpg} $\ast$}]{image\+Compress }\end{DoxyParamCaption})} Détecte la position d\textquotesingle{}un robot. Détecte la position de triangles blanc sur une image /a img\+Input passé en paramètre d\textquotesingle{}entrer. \begin{DoxyParams}{Parameters} {\em img\+Input} & Pointeur sur l\textquotesingle{}image à sauvegarder en mémoire sous format jpg. \\ \hline {\em image\+Compress} & Pointeur sur une image .jpg. \\ \hline \end{DoxyParams} \mbox{\Hypertarget{image_8h_acad45df4061a55f17be0db97c1406249}\label{image_8h_acad45df4061a55f17be0db97c1406249}} \index{image.\+h@{image.\+h}!detect\+\_\+arena@{detect\+\_\+arena}} \index{detect\+\_\+arena@{detect\+\_\+arena}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{detect\+\_\+arena()}{detect\_arena()}} {\footnotesize\ttfamily int detect\+\_\+arena (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{mon\+Image, }\item[{\hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$}]{rectangle }\end{DoxyParamCaption})} Détecte une arène dans une image fournis en paramètre. \begin{DoxyParams}{Parameters} {\em mon\+Image} & Pointeur sur l\textquotesingle{}image d\textquotesingle{}entrée \\ \hline {\em rectangle} & Pointeur sur les coordonnées du rectangles trouvé. \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Retourne -\/1 si aucune arène n\textquotesingle{}est détectée. Sinon retourne 0 \end{DoxyReturn} \mbox{\Hypertarget{image_8h_af9f6e2dd4409486f2f6446d1a8a02c40}\label{image_8h_af9f6e2dd4409486f2f6446d1a8a02c40}} \index{image.\+h@{image.\+h}!detect\+\_\+position@{detect\+\_\+position}} \index{detect\+\_\+position@{detect\+\_\+position}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{detect\+\_\+position()}{detect\_position()}} {\footnotesize\ttfamily int detect\+\_\+position (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Input, }\item[{\hyperlink{struct_position}{Position} $\ast$}]{pos\+Triangle, }\item[{\hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$}]{mon\+Arene = {\ttfamily NULL} }\end{DoxyParamCaption})} Détecte la position d\textquotesingle{}un robot. Détecte la position de triangles blanc sur une image /a img\+Input passé en paramètre d\textquotesingle{}entrer. \begin{DoxyParams}{Parameters} {\em img\+Input} & Pointeur sur l\textquotesingle{}image sur laquelle chercher la position du des robots. \\ \hline {\em pos\+Triangle} & Pointeur sur un tableau de position ou seront stocké les positions des triangles détectés. \\ \hline {\em mon\+Arene} & Pointeur de type Arène si nécessaire d\textquotesingle{}affiner la recherche (optionnel) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Le nombre de triangles détectés. \end{DoxyReturn} \mbox{\Hypertarget{image_8h_a5ffd032a466af45a505fb46252194bbf}\label{image_8h_a5ffd032a466af45a505fb46252194bbf}} \index{image.\+h@{image.\+h}!draw\+\_\+arena@{draw\+\_\+arena}} \index{draw\+\_\+arena@{draw\+\_\+arena}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{draw\+\_\+arena()}{draw\_arena()}} {\footnotesize\ttfamily void draw\+\_\+arena (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Input, }\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Output, }\item[{\hyperlink{image_8h_aa856a7cb8a1535c9f13096bede6c8586}{Arene} $\ast$}]{mon\+Arene }\end{DoxyParamCaption})} Dessine le plus petit rectangle contenant l\textquotesingle{}arène. \begin{DoxyParams}{Parameters} {\em img\+Input} & Pointeur sur l\textquotesingle{}image d\textquotesingle{}entrée. \\ \hline {\em img\+Output} & Pointeur sur l\textquotesingle{}image de sortie (image d\textquotesingle{}entrée + arène marquée) \\ \hline {\em mon\+Arene} & Pointeur de type Arène contenant les information à dessiner \\ \hline \end{DoxyParams} \mbox{\Hypertarget{image_8h_a869c3946d4a414b8730ca4f91fbd9556}\label{image_8h_a869c3946d4a414b8730ca4f91fbd9556}} \index{image.\+h@{image.\+h}!draw\+\_\+position@{draw\+\_\+position}} \index{draw\+\_\+position@{draw\+\_\+position}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{draw\+\_\+position()}{draw\_position()}} {\footnotesize\ttfamily void draw\+\_\+position (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Input, }\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{img\+Output, }\item[{\hyperlink{struct_position}{Position} $\ast$}]{position\+Robot }\end{DoxyParamCaption})} Dessine sur une image en entrée la position d\textquotesingle{}un robot et sa direction. Sauvegarde l\textquotesingle{}image des coordonnées passées par position\+Robot superposée à l\textquotesingle{}image d\textquotesingle{}entrée sur img\+Output. \begin{DoxyParams}{Parameters} {\em img\+Input} & Pointeur sur l\textquotesingle{}image d\textquotesingle{}entrée \\ \hline {\em img\+Output} & Pointeur sur l\textquotesingle{}image de sortie ( image d\textquotesingle{}entrée + dessin de la position) \\ \hline {\em position\+Robot} & Pointeur sur la structure position d\textquotesingle{}un robot. \\ \hline \end{DoxyParams} \mbox{\Hypertarget{image_8h_ad904f3348c2d44f9c82435c94cd83844}\label{image_8h_ad904f3348c2d44f9c82435c94cd83844}} \index{image.\+h@{image.\+h}!get\+\_\+image@{get\+\_\+image}} \index{get\+\_\+image@{get\+\_\+image}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{get\+\_\+image()}{get\_image()}} {\footnotesize\ttfamily void get\+\_\+image (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$}]{camera, }\item[{\hyperlink{image_8h_a466446fef9c0348568bc6743186d1a38}{Image} $\ast$}]{mon\+Image, }\item[{const char $\ast$}]{fichier = {\ttfamily NULL} }\end{DoxyParamCaption})} Capture une image avec la camera passée en entrée. En cas de test sans camera, la fonction charge une image. La camera doit préalablement être ouverte via {\itshape open\+Camera}(...) \begin{DoxyParams}{Parameters} {\em camera} & Pointeur sur la camera passée en entrée. \\ \hline {\em mon\+Image} & Pointeur sur une image capturée. \\ \hline {\em fichier} & Chemin du fichier d\textquotesingle{}image \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Retourne -\/1 si une erreur survient. \end{DoxyReturn} \mbox{\Hypertarget{image_8h_aca0662ab31eac7fdb2d64fecc52ff1da}\label{image_8h_aca0662ab31eac7fdb2d64fecc52ff1da}} \index{image.\+h@{image.\+h}!open\+\_\+camera@{open\+\_\+camera}} \index{open\+\_\+camera@{open\+\_\+camera}!image.\+h@{image.\+h}} \subsubsection{\texorpdfstring{open\+\_\+camera()}{open\_camera()}} {\footnotesize\ttfamily int open\+\_\+camera (\begin{DoxyParamCaption}\item[{\hyperlink{image_8h_a739dda3f6f6ddbab22617837b43a692a}{Camera} $\ast$}]{camera }\end{DoxyParamCaption})} Ouvre une camera. Met à jour le descripteur de fichier passé en paramètre pour correspondre à la camera ouverte \begin{DoxyParams}{Parameters} {\em camera} & Pointeur d\textquotesingle{}un file descriptor d\textquotesingle{}une camera ouverte \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Retourne 0 si la camera a été ouverte correctement et -\/1 si une erreur survient. \end{DoxyReturn}