<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi everyone,<br>
      <br>
      An update on the situation:<br>
      <br>
      1) bug reported for IPD.<br>
      2) workaround for my workflow.<br>
      <br>
      1) See: <a class="moz-txt-link-freetext"
        href="http://forge.scilab.org/index.php/p/IPD/issues/1603/">http://forge.scilab.org/index.php/p/IPD/issues/1603/</a><br>
          Are the devs of IPD reading this mailing list (I know Allan
      used to read it)?<br>
          I can give them a hand troubleshooting what's going on if they
      want.<br>
      <br>
      2) I gave up on proper image processing in Scilab (ie with lots of
      bells and whistles) and decided to support one image format (PPM
      as it's a very simple format).<br>
          So now, I convert all the images I need to process to PPM
      (using convert from ImageMagick) and load them in Scilab with the
      function below.<br>
          (hacked in an hour, so it's far from perfect, feedback is
      welcome)<br>
      <br>
      function img=read_ppm_file(ppm_file)<br>
         //function to read ppm file P6 (binary RGB 8bit/channel)<br>
         //<br>
         // Typical file header:<br>
         //<br>
         //  1 P6<br>
         //  2 389 308<br>
         //  3 255<br>
         //<br>
         // Magic number P6<br>
         // white space (here CR or LF)<br>
         // Width whitespace Height<br>
         // White space (here CR/LF)<br>
         // Maximum value (here 255 mean 1 byte per pixel per channel)<br>
         // White space<br>
         // Height=H Width=W => H rows from top to bottom of W
      pixels, each pixel a rgb triplet, each channel on one byte if
      MaxVal<=255.<br>
         //So starting from the end we should have 3*H*W bytes to read.<br>
      <br>
         //getting file size in byte<br>
         [x, ierr] = fileinfo(ppm_file);<br>
         file_size=x(1);<br>
         //reading the header<br>
         fd=mopen(ppm_file,'r');<br>
         txt = mgetl(fd,3);// TODO : no exactly what's in the format
      specification<br>
         mclose(fd)<br>
        <br>
         magickN=txt(1);<br>
         maxval=eval(txt(3));<br>
        <br>
         if magickN~="P6" then<br>
            warning("Cannot handle PPM files other than P6 (binary RGB
      file)");<br>
         elseif maxval > 255 then<br>
            warning("Cannot handle PPM files with channels encoded on
      more than 1 byte");<br>
         else<br>
            //good to go P6 PPM file encoded with 1 byte per channel<br>
            //getting W & H<br>
            tok=tokens(txt(2));<br>
            W=eval(tok(1));//width of the image<br>
            H=eval(tok(2));//height of the image<br>
            //Now we need to read 3*H*W bytes from the end of the file<br>
            bytoread=3*H*W;<br>
            startpos=file_size-bytoread;<br>
            fd=mopen(ppm_file,'rb');<br>
            mseek(startpos,fd);<br>
            dat=mgeti(bytoread,'uc',fd);//raw data<br>
            mclose(fd);<br>
         end<br>
         //separating the channels<br>
         // TODO : can we get something more elegant than transpose
      & reverse of 1st dim ?<br>
         r=matrix(dat(1:3:$),W,H).';<br>
         g=matrix(dat(2:3:$),W,H).';<br>
         b=matrix(dat(3:3:$),W,H).';<br>
         r=r($:-1:1,:);<br>
         g=g($:-1:1,:);<br>
         b=b($:-1:1,:);<br>
         // building the hypermatrix from the channels<br>
         // TODO : more elegant way to fill the image?<br>
         img=uint8(hypermat([H,W,3]));<br>
         img(:,:,1)=r;<br>
         img(:,:,2)=g;<br>
         img(:,:,3)=b;<br>
      endfunction<br>
      <br>
      <br>
      I hope someone might find it useful,<br>
      <br>
      Antoine<br>
      <br>
      <br>
      Le 01/13/2016 11:20 AM, Philipp Mühlmann a écrit :<br>
    </div>
    <blockquote
cite="mid:CACf7ODuo_q88b52kT9uTpf4=_2Zw2qCop3GnKy6nfxxzWrxcnQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>mh, I never additionally installed OpenCV to be able to use
          IPD...it just worked "out of the box".</div>
        <div> </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2016-01-13 9:38 GMT+01:00 <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:amonmayr@laas.fr" target="_blank">amonmayr@laas.fr</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"><span>
                <div>Le 01/13/2016 08:34 AM, CHEZE David 227480 a
                  écrit :<br>
                </div>
                <blockquote type="cite">
                  <div>
                    <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Calibri",sans-serif;font-size:11pt"
                        lang="EN-US">Same conclusion for me and also
                        question reagrding scilab 6</span></p>
                  </div>
                </blockquote>
              </span> Well, I use both scilab 5.5.X and 6.0.X but:<br>
              <br>
              //scilab 6.0.X<br>
              --> atomsInstall('IPD')<br>
              atomsInstallList: The package IPD is not available<br>
              <br>
              Antoine
              <div>
                <div class="h5"><br>
                  <br>
                  <blockquote type="cite">
                    <div>
                      <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Calibri",sans-serif;font-size:11pt"
                          lang="EN-US"></span></p>
                      <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Arial",sans-serif;font-size:10pt"
                          lang="EN-US"> </span></p>
                      <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Arial",sans-serif;font-size:10pt"
                          lang="EN-US"> </span></p>
                      <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Arial",sans-serif;font-size:10pt">David</span></p>
                      <p class="MsoNormal"><span
style="color:rgb(31,73,125);font-family:"Calibri",sans-serif;font-size:11pt"> </span></p>
                      <p class="MsoNormal"><b><span
                            style="font-family:"Calibri",sans-serif;font-size:11pt">De :</span></b><span
style="font-family:"Calibri",sans-serif;font-size:11pt"> users
                          [<a moz-do-not-send="true"
                            href="mailto:users-bounces@lists.scilab.org"
                            target="_blank">mailto:users-bounces@lists.scilab.org</a>]
                          <b>De la part de</b> Philipp Mühlmann<br>
                          <b>Envoyé :</b> mardi 12 janvier 2016 20:11<br>
                          <b>À :</b> Users mailing list for Scilab <a
                            moz-do-not-send="true"
                            href="mailto:users@lists.scilab.org"
                            target="_blank"><a class="moz-txt-link-rfc2396E" href="mailto:users@lists.scilab.org"><users@lists.scilab.org></a></a><br>
                          <b>Objet :</b> Re: [Scilab-users] An Image
                          processing toolbox that *works*</span></p>
                      <p class="MsoNormal"> </p>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <p style="margin-bottom:12pt"
                                  class="MsoNormal">Hello,</p>
                              </div>
                              <p class="MsoNormal">I've been using IPD
                                and SIVP a lot with Scilab 5.5.1 and
                                5.4.1...on WinXP 32 bit and Win7 64 bit.<br>
                                <br>
                                Both times with IPD 8.3.2-0</p>
                            </div>
                            <div>
                              <p class="MsoNormal"><br>
                                IPD would be my favourite.</p>
                            </div>
                            <div>
                              <p class="MsoNormal"> </p>
                            </div>
                            <div>
                              <p class="MsoNormal"> </p>
                            </div>
                            <p style="margin-bottom:12pt"
                              class="MsoNormal">Anybody uses IPD with
                              Scilab 6?</p>
                          </div>
                          <p class="MsoNormal">Best regards,</p>
                        </div>
                        <p class="MsoNormal">Philipp</p>
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div>
                                    <p style="margin-bottom:12pt"
                                      class="MsoNormal"><br>
                                      <br>
                                    </p>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <p class="MsoNormal"> </p>
                        <div>
                          <p class="MsoNormal">2016-01-12 13:43
                            GMT+01:00 Samuel Gougeon <<a
                              moz-do-not-send="true"
                              href="mailto:sgougeon@free.fr"
                              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:sgougeon@free.fr">sgougeon@free.fr</a></a>>:</p>
                          <blockquote style="border-width:medium medium
                            medium 1pt;border-style:none none none
                            solid;border-color:currentColor currentColor
                            currentColor rgb(204,204,204);padding:0cm
                            0cm 0cm
                            6pt;margin-right:0cm;margin-left:4.8pt">
                            <p class="MsoNormal">Hello,<br>
                              <br>
                              Le 12/01/2016 12:53, <a
                                moz-do-not-send="true"
                                href="mailto:antoine.monmayrant@laas.fr"
                                target="_blank">
                                <a class="moz-txt-link-abbreviated" href="mailto:antoine.monmayrant@laas.fr">antoine.monmayrant@laas.fr</a></a> a écrit :</p>
                            <blockquote style="border-width:medium
                              medium medium 1pt;border-style:none none
                              none solid;border-color:currentColor
                              currentColor currentColor
                              rgb(204,204,204);padding:0cm 0cm 0cm
                              6pt;margin-right:0cm;margin-left:4.8pt">
                              <p class="MsoNormal">Hi everyone,<br>
                                <br>
                                This message is not a rant (but it
                                could).<br>
                                I am truly looking for an image
                                processing toolbox that works with
                                current versions of Scilab and a
                                decently modern OS.<br>
                                I tried every toolbox I've found but
                                without success:<br>
                                <br>
                                SIVP: requires an outdated version of
                                libtiff that I don't know how to install
                                on my system.<br>
                                <br>
                                IPD: does not seem to work properly:
                                ReadImage fails:</p>
                            </blockquote>
                            <p style="margin-bottom:12pt"
                              class="MsoNormal"><br>
                              Works for me with Scilab 5.5.2 / win7_x64
                              :</p>
                            <blockquote style="border-width:medium
                              medium medium 1pt;border-style:none none
                              none solid;border-color:currentColor
                              currentColor currentColor
                              rgb(204,204,204);padding:0cm 0cm 0cm
                              6pt;margin-right:0cm;margin-left:4.8pt">
                              <p class="MsoNormal">-->dir *.png<br>
                                 ans  =<br>
                                <br>
                                foo.png Google_logo.png ico.png
                                scilab.png<br>
                                <br>
                                -->atomsLoad IPD<br>
                                <br>
                                Start IPD - Image Processing Design<br>
                                    Load macros<br>
                                    Load dependencies<br>
                                    Load gateways<br>
                                    Load help<br>
                                    Load demos<br>
                                <br>
                                 ans  =<br>
                                <br>
                                !IPD  8.3.2-0  allusers 
                                SCI\contrib\IPD\8.3.2-0  !<br>
                                <br>
                                -->i = ReadImage("Google_logo.png");<br>
                                <br>
                                -->size(i)<br>
                                 ans  =<br>
                                <br>
                                    95.    275.    3.</p>
                            </blockquote>
                            <p class="MsoNormal"><br>
                              Do you get an error whatever is the image
                              you try to load?<br>
                              You may report the error you get @ <a
                                moz-do-not-send="true"
                                href="http://forge.scilab.org/index.php/p/IPD/issues/"
                                target="_blank"> </a><a
                                moz-do-not-send="true"
                                href="http://forge.scilab.org/index.php/p/IPD/issues/"
                                target="_blank"><a class="moz-txt-link-freetext" href="http://forge.scilab.org/index.php/p/IPD/issues/">http://forge.scilab.org/index.php/p/IPD/issues/</a></a>
                              + posting the image triggering it.<br>
                              <br>
                              Cheers<span style="color:rgb(136,136,136)"><br>
                                <span>Samuel</span></span></p>
                            <div>
                              <div>
                                <p class="MsoNormal"><br>
_______________________________________________<br>
                                  users mailing list<br>
                                  <a moz-do-not-send="true"
                                    href="mailto:users@lists.scilab.org"
                                    target="_blank">users@lists.scilab.org</a><br>
                                  <a moz-do-not-send="true"
                                    href="http://lists.scilab.org/mailman/listinfo/users"
                                    target="_blank">http://lists.scilab.org/mailman/listinfo/users</a></p>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                        <p class="MsoNormal"><br>
                          <br clear="all">
                          <br>
                          -- </p>
                        <div>
                          <p class="MsoNormal">There we have the salad.</p>
                        </div>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
users mailing list
<a moz-do-not-send="true" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a moz-do-not-send="true" href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
                  </blockquote>
                  <br>
                  <br>
                </div>
              </div>
              <pre cols="72"><span class="HOEnZb"><font color="#888888">-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Antoine Monmayrant LAAS - CNRS
 7 avenue du Colonel Roche
 BP 54200
 31031 TOULOUSE Cedex 4
 FRANCE

 Tel:<a moz-do-not-send="true" href="tel:%2B33%205%2061%2033%2064%2059" target="_blank" value="+33561336459">+33 5 61 33 64 59</a></font></span><span>
 
 email : <a moz-do-not-send="true" href="mailto:antoine.monmayrant@laas.fr" target="_blank">antoine.monmayrant@laas.fr</a>
 permanent email : <a moz-do-not-send="true" href="mailto:antoine.monmayrant@polytechnique.org" target="_blank">antoine.monmayrant@polytechnique.org</a>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

</span></pre>
            </div>
            <br>
            _______________________________________________<br>
            users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.scilab.org/mailman/listinfo/users"
              rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature">There we have the salad.</div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Antoine Monmayrant LAAS - CNRS
 7 avenue du Colonel Roche
 BP 54200
 31031 TOULOUSE Cedex 4
 FRANCE

 Tel:+33 5 61 33 64 59
 
 email : <a class="moz-txt-link-abbreviated" href="mailto:antoine.monmayrant@laas.fr">antoine.monmayrant@laas.fr</a>
 permanent email : <a class="moz-txt-link-abbreviated" href="mailto:antoine.monmayrant@polytechnique.org">antoine.monmayrant@polytechnique.org</a>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

</pre>
  </body>
</html>