<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">El 12/03/14 20:31, Edgar Barrero Mateo
      escribi&oacute;:<br>
    </div>
    <blockquote cite="mid:BLU0-SMTP311DD33CB18C11A8D36AF619E760@phx.gbl"
      type="cite">
      <pre wrap="">Quiz&aacute; es una duda tonta la que planteo pero bueno. &iquest;que devuelve en cada 
petici&oacute;n Ice cameraview? Es un array de pixeles RGB?&iquest;que formato 
exactamente tiene esa imagen?</pre>
    </blockquote>
    <br>
    <br>
    Todo depende del componente que env&iacute;e la imagen. En mi caso yo env&iacute;o
    desde Android im&aacute;genes en formato NV21.<br>
    <br>
    <br>
    <br>
    <blockquote cite="mid:BLU0-SMTP311DD33CB18C11A8D36AF619E760@phx.gbl"
      type="cite">
      <pre wrap="">&iquest;Otra pregunta en el mismo sentido es qu&eacute; devuelve exactamente 
pclRGBDServer?</pre>
    </blockquote>
    <br>
    <br>
    A esto no te voy a responder, pero te animo que consultes el c&oacute;digo
    de la interfaz:<br>
<a class="moz-txt-link-freetext" href="http://svn.jderobot.org/jderobot/trunk/src/stable/interfaces/slice/jderobot/">http://svn.jderobot.org/jderobot/trunk/src/stable/interfaces/slice/jderobot/</a><br>
    <br>
    <br>
    <br>
    <blockquote cite="mid:BLU0-SMTP311DD33CB18C11A8D36AF619E760@phx.gbl"
      type="cite">
      <pre wrap="">Y por &uacute;ltimo y para no tener que volver a hacer preguntas tan simples, 
&iquest;Hay alg&uacute;n sitio donde encontrar algun manual o explicaci&oacute;n de cada 
componente?</pre>
    </blockquote>
    <br>
    <br>
    Lo mejor es consultar directamente el c&oacute;digo. Comprobar&aacute;s que est&aacute;n
    muy documentados y casi todo el c&oacute;digo es autoexplicativo.<br>
    <br>
    Ejemplo:<br>
<a class="moz-txt-link-freetext" href="http://svn.jderobot.org/jderobot/trunk/src/stable/interfaces/slice/jderobot/image.ice">http://svn.jderobot.org/jderobot/trunk/src/stable/interfaces/slice/jderobot/image.ice</a><br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">  /**
   * A single image served as a sequence of bytes
   */
  class ImageData
  { 
    Time timeStamp; /**&lt; TimeStamp of Data */
    ImageDescription description; /**&lt; ImageDescription of Data, for convienence purposes */
    ByteSeq pixelData; /**&lt; The image data itself. The structure of this byte sequence
                          depends on the image format and compression. */
  };
</pre>
    <br class="Apple-interchange-newline">
    Tal y como puedes ver la imagen en s&iacute; es una secuencia de bytes sin
    ning&uacute;n formato en particular. El formato en el que se env&iacute;a esa
    secuencia de bytes est&aacute; definido en:<br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">  /**
   *  Static description of the image source.
   */
  class ImageDescription 
  {
    int width; /**&lt; %Image width [pixels] */
    int height;/**&lt; %Image height [pixels] */
    int size;/**&lt; %Image size [bytes] */
    string format; /**&lt; %Image format string */
  };</pre>
    <br>
    Es decir, en la descripci&oacute;n de la imagen (y no en los datos de la
    imagen) se indica en qu&eacute; formato est&aacute;n los datos.<br>
    <br>
    Yo implement&eacute; en colorspaces un conversor de NV21 (el formato nativo
    de Android) a RGB:<br>
<a class="moz-txt-link-freetext" href="http://svn.jderobot.org/jderobot/tags/Jderobot-5.2.0/src/libs/colorspaces/imagecv.cpp">http://svn.jderobot.org/jderobot/tags/Jderobot-5.2.0/src/libs/colorspaces/imagecv.cpp</a><br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">const Image::FormatPtr ImageNV21::FORMAT_NV21 = Image::Format::createFormat("NV21",CV_8UC2,&amp;ImageNV21::createInstance,&amp;ImageNV21::imageCvt);
</pre>
    <br class="Apple-interchange-newline">
    <br>
    Ahora se usan otros m&eacute;todos para convertir esa secuencia de bytes
    (sea cual sea el formato) a RGB (8 bits por canal y 3 canales). Si
    miras el c&oacute;digo de introrob:<br>
<a class="moz-txt-link-freetext" href="http://svn.jderobot.org/jderobot/trunk/src/stable/components/introrob/control.cpp">http://svn.jderobot.org/jderobot/trunk/src/stable/components/introrob/control.cpp</a><br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">    void Control::createImage(Api *api) {
        cvReleaseImage(&amp;image);
        this-&gt;image = cvCreateImage(cvSize(api-&gt;imageData1-&gt;description-&gt;width, api-&gt;imageData1-&gt;description-&gt;height), 8, 3);

        memcpy((unsigned char *) image-&gt;imageData, &amp;(api-&gt;imageData1-&gt;pixelData[0]), image-&gt;width * image-&gt;height * 3);
/*
        colorspaces::Image::FormatPtr fmt = colorspaces::Image::Format::searchFormat(api-&gt;imageData1-&gt;description-&gt;format);

        if (!fmt)
            throw "Format not supported";
*/
        api-&gt;imgBuff =
                Gdk::Pixbuf::create_from_data((const guint8*) this-&gt;image-&gt;imageData,
                Gdk::COLORSPACE_RGB,
                false,
                this-&gt;image-&gt;depth,
                this-&gt;image-&gt;width,
                this-&gt;image-&gt;height,
                this-&gt;image-&gt;widthStep);

    }
</pre>
    <br class="Apple-interchange-newline">
    Si usas introrob como base obtendr&aacute;s la imagen en formato RGB
    preparada para ser analizada. Mira este ejemplo:<br>
<a class="moz-txt-link-freetext" href="http://svn.jderobot.org/jderobot/trunk/src/stable/components/introrob/MyAlgorithms.cpp">http://svn.jderobot.org/jderobot/trunk/src/stable/components/introrob/MyAlgorithms.cpp</a><br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">        imageCameras2openCV(); //Esta funci&Atilde;&sup3;n es necesario llamarla ANTES de trabajar con las im&Atilde;&iexcl;genes de las c&Atilde;&iexcl;maras.
        IplImage src = *this-&gt;imageCameraLeft; //Imagen de la c&Atilde;&iexcl;mara izquierda

        for (i = 0; i &lt; src.width; i++) {
            for (j = 0; j &lt; src.height; j++) {
                if (((int) (unsigned char) src.imageData[(j * src.width + i) * src.nChannels] &gt; 120) &amp;&amp;
                        ((int) (unsigned char) src.imageData[(j * src.width + i) * src.nChannels + 1] &lt; 70) &amp;&amp;
                        ((int) (unsigned char) src.imageData[(j * src.width + i) * src.nChannels + 2] &lt; 70)) {
                    cont++;
                    src.imageData[(j * src.width + i) * src.nChannels] = 255; //R
                    src.imageData[(j * src.width + i) * src.nChannels + 1] = 255; //G
                    src.imageData[(j * src.width + i) * src.nChannels + 2] = 0; //B
                }
            }
        }
</pre>
    <br class="Apple-interchange-newline">
    <br>
    Espero que te haya servido de gu&iacute;a (m&aacute;s que ayuda).<br>
    <br>
    Un saludo.<br>
  </body>
</html>