• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Compiling SSIM on Mac

    November 25th, 2014
    tech  [html]
    If you want to examine the distortion that comes from a lossy compression algorithm, it's helpful to have a tool that's a good proxy for asking a person "how similar are these two images"? The standard algorithm for this is SSIM, but there are several implementations. I was initially using Pornel's dssim, but I wanted to compare this to Mehdi's SSIM. Mehdi's doesn't document how to compile it on a mac, so here's what worked for me:

    1. Install OpenCV
      1. Download OpenCV for linux/mac. I downloaded 2.4.9 from opencv.org/downloads.
      2. unzip ~/Downloads/opencv-2.4.9.zip
      3. cd ~/Downloads/opencv-2.4.9/
      4. mkdir build && cd build
      5. cmake -G "Unix Makefiles" ..
      6. make -j8
      7. sudo make install
    2. Download SSIM.ccp: wget http://mehdi.rabah.free.fr/SSIM/SSIM.cpp
    3. The SSIM.cpp file needs a small change: replace "#include <iostream.h>" with "#include <iostream>".
    4. Compile with:
      g++ -I/usr/local/include/opencv \
          -L/usr/local/lib/ \
          -lopencv_core \
          -lopencv_highgui \
          -lopencv_imgproc \
          SSIM.cpp \
          -o ssim
    5. Enjoy using SSIM: ./ssim a-original.png a-modified.png

    Recent posts on blogs I like:

    100 years of whatever this will be

    What if all these weird tech trends actually add up to something? Last time, we explored why various bits of trendy technology are, in my opinion, simply never going to be able to achieve their goals. But we ended on a hopeful(?) note: maybe that doesn…

    via apenwarr December 2, 2021

    Major errors on this blog (and their corrections)

    Here's a list of errors on this blog that I think were fairly serious. While what I think of as serious is, of course, subjective, I don't think there's any reasonable way to avoid that because, e.g., I make a huge number of typos, so many tha…

    via Posts on November 22, 2021

    Experiences in raising children in shared housing

    Sometimes I see posts about people’s hope to raise children in a group housing situation, and it often seems overly optimistic to me. In particular they seem to expect that there will be more shared childcare than I think should be expected. Today I talke…

    via The whole sky October 18, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact