.. Paul Ivanov's Random Remarks documentation master file, created by .. |squared| ======================================================== .. |squared| unicode:: πr U000B2 .. .. contents:: on this page... :class: document OSA Fall Vision Meeting Spectrum Recovery Competition, 2011 =========================================================== The `Optical Society of America`_ `Fall Vision Meeting`_ is holding a `Spectrum Recovery Competition`_ . You can find all of the details on the official website, below I provide a Python port of their matlab code. .. _Optical Society of America: osa_ .. _Fall Vision Meeting: fvm_ .. _Spectrum Recovery Competition: src_ Spectrum Recovery Code (Python) ------------------------------- ``SimpleIllumEstimation.py`` (download_) (`view source`_) -- the Python equivalent code of ``SimpleIllumEstimation.m`` program provided by the `OSA Spectrum Recovery Competition, 2011`_ organizers. .. _view source: #source-code .. _download: SimpleIllumEstimation.py .. note:: * The code requires numpy_ and scipy_ (for reading ``.mat`` files), and optionally depends on matplotlib_ (if you want to look at the images). * If someone asks_, I'll be happy to provide ``.npz`` version of the ``.mat`` files, removing the ``scipy`` dependency. * The code will download and extract the ``ContestImageData.zip`` file from the official website if it can not find the data directory or the zip file. So all you need to do is `grab the python file`_ and run it. * Feel free to uncomment the ``raw_input`` lines, to insert pauses if you are running inside IPython_ with an interactive matplotlib_ backend such that the ``plt.show`` commands do not block. * If the official ``estimatedIllumSpds.txt`` is not found, we will fetch it from the official website for you as well. * Note that this code saves the estimate computed on your machine to the file ``myEstimatedIllumSpds.txt``, and compares is to the official `estimatedIllumSpds.txt`_ . The values stored in the two files should be identical. Indeed, I've ensured that the formating is the same, such that the only difference between the two is the trailing whitespace on each line found in the original which you will not find in the file the python program generates. Please `contact me`_ with your feedback. .. _asks: #contact .. _contact me: #contact .. _grab the python file: download_ .. _estimatedIllumSpds.txt: estimatedIllumSpds_ .. _OSA Spectrum Recovery Competition, 2011: src_ .. seealso:: `Python for Scientific Computing`__ -- a great list of resources put together by Fernando Perez. __ fdo_py4sci_ Source Code ----------- View the source code below, or download_ it. .. literalinclude:: SimpleIllumEstimation.py Back to my `research`_ page. .. include:: ../../contact.txt .. include:: ../../links.txt .. _estimatedIllumSpds: http://color.psych.upenn.edu/osacontest2011/estimatedIllumSpds.txt