• 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:

    How to Build High-Speed Rail with Money the United States Has

    The bipartisan infrastructure framework (BIF) just passed the Senate by a large margin, with money for both roads and public transportation. Unlike the 2009 Obama stimulus, the BIF has plenty of money for high-speed rail – not just $8 billion as in the 20…

    via Pedestrian Observations July 31, 2021

    Collections: The Queen’s Latin or Who Were the Romans, Part V: Saving And Losing an Empire

    This is the fifth and final part (I, II, III, IV) of our series asking the question ‘Who were the Romans?’ How did they understand themselves as a people and the idea of ‘Roman’ as an identity? Was this a homogeneous, ethnically defined group, as some ver…

    via A Collection of Unmitigated Pedantry July 30, 2021

    Songs about terrible relationships

    [Spoilers for several old musicals.] TV Tropes lists dozens of examples of the “I want” song (where the hero of a musical sings about their dream of escaping their small surroundings). After watching a bunch of musicals on maternity leave, I’m wondering h…

    via The whole sky July 17, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact