<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">Hola,<br>
      <br>
      el tipo <font color="black" face="Tahoma" size="2"><span
          style="font-size:10pt;" dir="ltr">IplImage es el tipo antiguo
          que se utilizaba en opencv, <font size="2">sigue<font
              size="2"> aparec<font size="2">iendo en las nuevas
                versiones pero des<font size="2">aparecer&aacute;<font size="2">,
                    hay que utilizar a partir de ahora cv::Mat.<br>
                    <br>
                    <font size="2">Para pasar de lo recibi<font size="2">do
                        por Ice a un cv::Mat hay que hacer esto:<br>
                        <br>
                        jderobot::ImageDataPtr data =
                        cprx-&gt;getImageData();<br>
                        <font size="2">colorspaces::Image::FormatPtr fmt
                          =
colorspaces::Image::Format::searchFormat(data-&gt;description-&gt;format);</font><br>
                        colorspaces::Image
                        image(data-&gt;description-&gt;width,
                        data-&gt;description-&gt;height,&nbsp; fmt,
                        &amp;(data-&gt;pixelData[0]));<br>
                        <font size="2">cv::Mat src=image;<br>
                          <br>
                          <font size="2">Si luego quieres mostrar<font
                              size="2"> la imagen <font size="2">en el
                                Gui<font size="2"> puedes<font size="2">
                                    hacer<font size="2">lo as&iacute;<font
                                        size="2"> desde un<font size="2">
                                          cv::Mat</font></font>(en GTK):<br>
                                      <br>
                                      <font size="2">char*
                                        this-&gt;imgSrc = new
                                        char[IMAGE_WIDTH * IMAGE_HEIGHT
                                        * IMAGE_CHANNELS];<br>
                                        <font size="2">memcpy(this-&gt;imgSrc,
                                          (char *)</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></span></font><font
        color="black" face="Tahoma" size="2"><span
          style="font-size:10pt;" dir="ltr"><font size="2"><font
              size="2"><font size="2"><font size="2"><font size="2"><font
                      size="2"><font size="2"><font size="2"><font
                            size="2"><font size="2"><font size="2"><font
                                  size="2"><font size="2"><font size="2"><font
                                        size="2"><font size="2"><font
                                            color="black" face="Tahoma"
                                            size="2"><span
                                              style="font-size:10pt;"
                                              dir="ltr"><font size="2"><font
                                                  size="2"><font
                                                    size="2"><font
                                                      size="2"><font
                                                        size="2"><font
                                                          size="2"><font
                                                          size="2"><font
                                                          size="2">src</font></font></font></font></font></font></font></font></span></font>.data,
                                          IMAGE_WIDTH * IMAGE_HEIGHT *
                                          IMAGE_CHANNELS *
                                          sizeof(char));<br>
                                          Glib::RefPtr&lt;Gdk::Pixbuf&gt;
                                          imgBuff =
                                          Gdk::Pixbuf::create_from_data((const
                                          guint8*)this-&gt;imgSrc,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                                          Gdk::COLORSPACE_RGB,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; false,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 8,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></span></font><font
        color="black" face="Tahoma" size="2"><span
          style="font-size:10pt;" dir="ltr"><font size="2"><font
              size="2"><font size="2"><font size="2"><font size="2"><font
                      size="2"><font size="2"><font size="2"><font
                            size="2"><font size="2"><font size="2"><font
                                  size="2"><font size="2"><font size="2"><font
                                        size="2"><font size="2"><font
                                            color="black" face="Tahoma"
                                            size="2"><span
                                              style="font-size:10pt;"
                                              dir="ltr"><font size="2"><font
                                                  size="2"><font
                                                    size="2"><font
                                                      size="2"><font
                                                        size="2"><font
                                                          size="2"><font
                                                          size="2"><font
                                                          size="2">src</font></font></font></font></font></font></font></font></span></font>.cols,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></span></font><font
        color="black" face="Tahoma" size="2"><span
          style="font-size:10pt;" dir="ltr"><font size="2"><font
              size="2"><font size="2"><font size="2"><font size="2"><font
                      size="2"><font size="2"><font size="2"><font
                            size="2"><font size="2"><font size="2"><font
                                  size="2"><font size="2"><font size="2"><font
                                        size="2"><font size="2"><font
                                            color="black" face="Tahoma"
                                            size="2"><span
                                              style="font-size:10pt;"
                                              dir="ltr"><font size="2"><font
                                                  size="2"><font
                                                    size="2"><font
                                                      size="2"><font
                                                        size="2"><font
                                                          size="2"><font
                                                          size="2"><font
                                                          size="2">src</font></font></font></font></font></font></font></font></span></font>.rows,<br>
                                          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></span></font><font
        color="black" face="Tahoma" size="2"><span
          style="font-size:10pt;" dir="ltr"><font size="2"><font
              size="2"><font size="2"><font size="2"><font size="2"><font
                      size="2"><font size="2"><font size="2"><font
                            size="2"><font size="2"><font size="2"><font
                                  size="2"><font size="2"><font size="2"><font
                                        size="2"><font size="2"><font
                                            color="black" face="Tahoma"
                                            size="2"><span
                                              style="font-size:10pt;"
                                              dir="ltr"><font size="2"><font
                                                  size="2"><font
                                                    size="2"><font
                                                      size="2"><font
                                                        size="2"><font
                                                          size="2"><font
                                                          size="2"><font
                                                          size="2">src</font></font></font></font></font></font></font></font></span></font>.step);<br>
                                          gtk_image-&gt;clear();<br>
                                          gtk_image-&gt;set(imgBuff);</font><br>
                                      </font><font size="2"></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></span></font><br>
      Saludos.<br>
      <br>
      El 30/10/13 15:43, ILDEFONSO GONZALEZ SANCHEZ escribi&oacute;:<br>
    </div>
    <blockquote
cite="mid:CC0F537F9925BF4BA4887593569E01C66301C8CD@AMSPRD0411MB400.eurprd04.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">Hola,<br>
        <br>
        voy a intentar ser mas concreto en la duda :<br>
        <br>
        <font color="black" face="Tahoma" size="2"><span
            style="font-size:10pt;" dir="ltr">El componente que estoy
            haciendo en estos momentos, tiene 2 hilos:<br>
            -El primero (control), se encarga de conectar con ice y
            guardar los datos en una clase de memoria compartida, en la
            que las variables las estoy declarando como est&aacute;ticas.<br>
            -El segundo (Gui), se encarga de recoger esa imagen, del
            tipo&nbsp;&nbsp; jderobot::ImageDataPtr, la pasa al tipo
            colorspaces::Image (con formato rgb8). Y esta es la que
            muestro en 4 pantallas distintas, la intenci&oacute;n es aplicar un
            filtro a 3 de ellas.<br>
            <br>
            Entonces lo que intento y no consigo es:<br>
            -iterar o realizar alguna modificaci&oacute;n con funciones sobre
            le tipo de dato colorspaces::Image (con formato rgb8):<br>
            &nbsp;&nbsp;&nbsp; (Estas funciones las he encontrado en
            visionlib/colorspaces/image)<br>
            &nbsp;void toGRAY8(Image&amp; dst) const throw(FormatMismatch);<br>
            &nbsp;&nbsp;&nbsp; void toYUY2(Image&amp; dst) const throw(FormatMismatch);<br>
            &nbsp;&nbsp;&nbsp; void toHSV8(Image&amp; dst) const throw(FormatMismatch);<br>
            &nbsp;&nbsp;&nbsp; void toYCRCB(Image&amp; dst) const
            throw(FormatMismatch);<br>
            -O bien pasarla a IplImage (Para el cual si puedo iterar),
            lo que no consigo es convertir la imagen en este tipo.<br>
            -O bien trabajar con el tipo de dato Mat (Que por lo que he
            visto es la propia de opencv), que me esta mostrando todo en
            negro.<br>
            <br>
            Entonces las convinaciones posibles que puedo hacer son:<br>
            -</span></font><font color="black" face="Tahoma" size="2"><span
            style="font-size:10pt;" dir="ltr"><font color="black"
              face="Tahoma" size="2"><span style="font-size:10pt;"
                dir="ltr">jderobot::ImageDataPtr</span></font>---&gt;</span></font><font
          color="black" face="Tahoma" size="2"><span
            style="font-size:10pt;" dir="ltr"><font color="black"
              face="Tahoma" size="2"><span style="font-size:10pt;"
                dir="ltr">colorspaces::Image--&gt; display OK<br>
                -</span></font></span></font><font color="black"
          face="Tahoma" size="2"><span style="font-size:10pt;" dir="ltr"><font
              color="black" face="Tahoma" size="2"><span
                style="font-size:10pt;" dir="ltr"><font color="black"
                  face="Tahoma" size="2"><span style="font-size:10pt;"
                    dir="ltr"><font color="black" face="Tahoma" size="2"><span
                        style="font-size:10pt;" dir="ltr">jderobot::ImageDataPtr---&gt;</span></font></span></font></span></font></span></font><font
          color="black" face="Tahoma" size="2"><span
            style="font-size:10pt;" dir="ltr"><font color="black"
              face="Tahoma" size="2"><span style="font-size:10pt;"
                dir="ltr"><font color="black" face="Tahoma" size="2"><span
                    style="font-size:10pt;" dir="ltr"><font
                      color="black" face="Tahoma" size="2"><span
                        style="font-size:10pt;" dir="ltr"><font
                          color="black" face="Tahoma" size="2"><span
                            style="font-size:10pt;" dir="ltr"><font
                              color="black" face="Tahoma" size="2"><span
                                style="font-size:10pt;" dir="ltr">colorspaces::Image---&gt;</span></font></span></font></span></font></span></font></span></font></span></font><font
          color="black" face="Tahoma" size="2"><span
            style="font-size:10pt;" dir="ltr"><font color="black"
              face="Tahoma" size="2"><span style="font-size:10pt;"
                dir="ltr"><font color="black" face="Tahoma" size="2"><span
                    style="font-size:10pt;" dir="ltr"><font
                      color="black" face="Tahoma" size="2"><span
                        style="font-size:10pt;" dir="ltr"><font
                          color="black" face="Tahoma" size="2"><span
                            style="font-size:10pt;" dir="ltr"><font
                              color="black" face="Tahoma" size="2"><span
                                style="font-size:10pt;" dir="ltr">cv::Mat---&gt;

                                KO (en negro)<br>
                              </span></font></span></font></span></font></span></font></span></font>&nbsp;<br>
            <br>
            Un saludo y muchas gracias,<br>
            <br>
            Ildefonso </span></font><br>
        <div style="font-family: Times New Roman; color: #000000;
          font-size: 16px">
          <hr tabindex="-1">
          <div style="direction: ltr;" id="divRpF234599"><font
              color="#000000" face="Tahoma" size="2"><b>De:</b>
              <a class="moz-txt-link-abbreviated" href="mailto:jde-developers-bounces@gsyc.es">jde-developers-bounces@gsyc.es</a>
              [<a class="moz-txt-link-abbreviated" href="mailto:jde-developers-bounces@gsyc.es">jde-developers-bounces@gsyc.es</a>] en nombre de ILDEFONSO
              GONZALEZ SANCHEZ [<a class="moz-txt-link-abbreviated" href="mailto:i.gonzalezsan@alumnos.urjc.es">i.gonzalezsan@alumnos.urjc.es</a>]<br>
              <b>Enviado:</b> mi&eacute;rcoles, 30 de octubre de 2013 13:08<br>
              <b>Para:</b> jde-developers<br>
              <b>Asunto:</b> [Jderobot] Im&aacute;ges y sus tipos de datos<br>
            </font><br>
          </div>
          <div>
            <div style="direction:ltr; font-family:Tahoma;
              color:#000000; font-size:10pt">Hola buenas tardes,<br>
              <br>
              tengo dudas sobre el tipo de datos de los siguientes tipos
              de im&aacute;genes:<br>
              -jderobot::ImageDataPtr// la que se recibe del plugin de
              jderobot<br>
              -colorspaces::Image //Esta la muestro correctamente pero
              no consigo iterar sobre ella.<br>
              -IplImage//He encontrado algoritmos para iterar pero no
              consigo pasar la imagen a este formato.<br>
              -cv::Mat //cuando paso la imagen a este formato y la
              muestro aparece negra con puntos blancos.<br>
              <br>
              Me gustar&iacute;a tener claro para que sirve cada una, que
              campos contienen para poder iterar sobre ellas y como
              podr&iacute;a cambiar el formato de unas a otras.<br>
              <br>
              Gracias y un saludo,<br>
              <br>
              Ildefonso Gonz&aacute;lez S&aacute;nchez<br>
              <br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Jde-developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Jde-developers@gsyc.es">Jde-developers@gsyc.es</a>
<a class="moz-txt-link-freetext" href="http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers">http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>