Giter VIP home page Giter VIP logo

obvius's Introduction

Intro

Obvius was an image processing software which was created by Eero Simoncelli, David Heeger and E.J. Chichilinsky at the MIT. Several Contributors added functionality to it. Patrick C. Teo added a GL implementation. The software got out of use in the mid 90’ies presumly by abondon CommonLisp code at all.

The main idea of Obvius is image processing for academic and research. There is no explicit focus on speed or high performanc computing. But nearly all low level functions are implemented in C. This may be a good idea or not in 2020. There have to be tests if this affects the performance to the better or not.

For now it is my goal to resurrect as much of legacy functionalty as possible. The purpose of Version 3.X will be to be a reference point to the modernized version 4.0. See below for a wish list of features in Version 4.0

In the meantime this means struggling with CommonLisp code from the 90ies, which works nearly out of the box. But there are good reasons to do so. There are very good tutorials under the tutorial folder, not all of them work, especially mouse bindings are not implemented yet. If most of their content work, one can update them to newer versions still having a reference.

Obvius was intended to be used as a companion to Emacs. In the original version there was en extra emacs mode which used a specialized REPL. As of 2020 I prefer to use SLIME or SLY for this purpuse. There are no plans to revive the emacs modes bundled with the legacy code now.

In this repository i bundle the original code which is downloadable from MIT under the legacy folder. Please pay special attention to the original license which makes this software usable for educational and researching purposes only. I try to contact the original authors to put a more modern license into it which will serve the same goals.

Screenshot

shot01.jpg

Original Readme

OBVIUS (Object-Based Vision and Image Understanding System) is an image-processing system based on Common Lisp and CLOS (Common Lisp Object System). The system provides a flexible interactive user interface for working with images, image-sequences, and other pictorially displayable objects. By using Lisp as its primary language, the system is able to take advantage of the interpretive lisp environment (the “listener”), object-oriented programming, and the extensibility provided by incremental compilation.

The top-level of OBVIUS is implemented in Common Lisp, thus providing an interpreted, object-oriented programming environment. The low-level floating point operations are implemented in C for efficiency. A graphical user interface, based on menus and dialog boxes is also provided, in addition to the Lisp interpreter (listener). In the typical mode of interaction, the user types an expression to the lisp listener (or enters a command in a dialog box) and it returns a result. A picture of that result will then be automatically displayed in a window. Each window contains a circular stack of pictures. The user can cycle through this stack using mouse clicks with certain shift (“bucky”) key combinations. Commonly used operations such as histogram and zoom are also provided via mouse clicks.

The system provides a library of low-level image processing routines. Some examples of these are

  • arithmetic operations (add, multiply, lookup-table point

operations, etc)

  • image statistics (mean, variance, kurtosis, maximum, histograms etc)
  • convolutions, Fourier transforms, Hilbert transforms
  • geometric operations (crop, slice, rotate, flip-x, etc)
  • comparisons (greater-than, etc)
  • synthetic image generation
  • matrix operations

OBVIUS also provides postscript output of pictures. Writing new operations in OBVIUS is relatively simple, and it is straightforward to add new viewable and picture types.

State

The last version as far as I know of was Obvius 3.0. So the current branch will be Version 3.1. It is intendended to recover as much as possible of the previous version’s functionality. Even though I dont’ have any Screenshots or other material, I try to guess what Obvius looked like.

When i ressurrected Obvius there were some minor problems with CLOS to be solved and the graphics backend had to be written completely new. Luckily Obvius was designed in a way that made it possible to add new graphics backends without interfering too much with the core functions. I decided to use an immediate mode gui called nuklear on top of the glfw-library. Both are available through Quicklisp by Bodge. This should make porting to other OS’s than UNIX possible. An immediate mode gui allows to add a fully controllable render loop. This makes it possible to add windows (in Obvius called panes) at runtime and remove them at any time without stopping the app. For displaying Pictures a couple of GL commands need to be performed mostly concerning texture creation. For every picture to be displayed a GL- Texture is created and displayed in the nuklear windows (panes in obvius). This works quite well and the nuklear library saves the trouble of redisplaying and moving windows. On the contrary is the situation with the drawing objects. Drawing objects are Graphs and other diagrams which have been drawn line by line and point by point to a foreign array back in the 90ies. This foreign array had been blitted to the (X)-Screen and was so to be seen at the display. For a workaround i use the drawing capabilities of nuklear to draw graphs etc. every frame to the nuklear window. This is quite a waste and will change in future.

Tested

  • arch Linux and SBCL 2.0.0
  • Ubuntu 18.04.3 and SBCL 1.4.5
  • windows 10 and SBCL 2.0.2, MSYS2
  • There are rumors it ran successfully on MacOS/SBCL

What works

  • displaying pictures
  • cycle panes
  • popping pictures
  • simple graphing
  • blurring
  • There is a release with precompiled Libs for Linux,MacOSX and Windows - i have unfortunatly no way to test for MacOS

For Version 3.1 I have tried to be as little intrusive as possible to the core legacy code. There are no changes or at least little changes to the core mechanics. The display of Graphs and other drawing ojects is now a real cycle burner. Drawing objects are redrawn every frame which is quite a waste of ressource. My idea to solve this is to draw graphs only once on with Zach Beans vecto library and then generate a GL-Texture the same way as with pictures.

TODO

  • Code cleanup
  • Add support for color images
  • Zooming
  • Dithering???
  • Test the Tutorials
  • Make the graphic backend more robust
  • rework the foreign function interface
  • adapt the documentation
  • lots of minor glitches

Far Goals

For Version 4.0 getting rid of unnecessary dependies in legacy code is planed.

  • there is no need for a self written garbage collector anymore
  • the memory management can be safely done by Lisp
  • replace the static array creating either by static-vectors or ffa
  • reduce the dependencies of foreign code. Get as much functionality into lisp as possible.
  • replace matrix code by BLAS calls or similar
  • make porting to other OSes possible (library compilation)

Installation and Set Up

Download a copy of this rep and put it in a folder under ~/quicklisp/local-projects/

Then load it with:

(ql:quickload "obvius")

There is a step-by-step installation guide: https://github.com/thicksteadTHpp/Obvius/wiki/Install

Library Compilations

[UPDATE 2020-03-06] Ther should be no dependency on libtiff anymore.

[UPDATE 2020-03-06] Load obvius via quicklisp and the library should be automatically compiled. Assumed that you have cmake and dependencies installed. (tested on LINUX, Windows10 with MSYS2)

If you load obvius via quicklisp, the asdf-system (on which quicklisp is built upon) will try to compile the c-library. If that does fail - it will try to download a precompiled library.

On Windows you should have MSYS2 installed. (and some build tools)

There is a precompiled library in the bin folder, but this may not work. For obvius to work a foreign library has to be (re-)compiled. Be sure to have CMake and libtiff installed.

[LINUX] and [MACOS ]Go to c-source folder and type:

mkdir build
cd build 
cmake ..
cmake --build .
cmake --install .

[Windows] Go to c-source folder and type

mkdir build
cd build 
cmake -G "MSYS Makefiles" ..
cmake --build .
cmake --install .

This should be enough - I hope. I am no expert when it comes to Makefiles and c-compiling stuff. Any help is appreciated.

Depedencies

There are a lot of dependencies. Luckily a big part comes with quicklisp. I tried to bundle as much dependencies as possible in the repo. For GLFW to work look at bodge-glfw and bodge-nuklear All the rest should be installable via Quicklisp.

If you want to compile the c-library you have to install a build environement. With recent Linux distros this should come out of the box. For Windows i recommend to use MSYS2.

Basic Usage

When obvius is loaded go into the obvius package by

(in-package :obv)

and then load the test images with

(make-test-images)

which should print a lot of stuuf on the RPL. These are logging snippets i added to the code to get into the working. These are for learning purposes only and will be removed soon. You can now display the pictures with

(display einstein)

or

(display reagan)

Now look into the tutorials folder and follow the obvius tutorial for basic usage.

Known Bugs

  • a lot
  • if an error occurs inside the render loop glfw produces memory faults
  • you have to kill the lisp process and start a new one

Acknowledgements

Thanks to David Heeger and Eero Simoncelli for designing Obvius, to vurtun for nuklear.h, to Pavel Korolev for making it possible to use it from CommonLisp.

obvius's People

Contributors

thicksteadthpp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cl-kuthirgal

obvius's Issues

New build system based on cmake

The legacy build system is based on a single Makefile. If we want to compile on all three major platforms we have to change that. A good candidate is cmake which offers the tools to compile on
Linux,MAC and WINDOWS. Look into crosscompile branch

Darwin

Something like

(defparameter *foo* 
  #+(and unix bar) "aa"
  #+(and darwin bar) "bb")

Will not work as intended, since DARWIN is also a UNIX. Thus both forms will be read.

Any use of DARWIN in conditional readers would need to be checked.

Better

(defparameter *foo* 
  #+(and unix (not darwin) bar) "aa"
  #+(and darwin bar) "bb")

make test cases

make test case to have code coverage and continuously test the software.

(obv.lib::download-lib) fails ?

macOS 10.15.3 & sbcl 2.0.2

CL-USER> (obv.lib::download-lib)
..Try to download precompiled library for osx 
...from: https://github.com/thicksteadTHpp/Obvius/releases/download/v3.2.1/libobvius.dylib.-x86_64-osx-v3.2.1 Downloading "https://github.com/thicksteadTHpp/Obvius/releases/download/v3.2.1/libobvius.dylib.-x86_64-osx-v3.2.1" (Unknown size)
[md5] checking file integrity: /Users/foo/.cache/common-lisp/sbcl-2.0.2-macosx-x64/Users/foo/quicklisp/local-projects/obvious/bin/libobvius.dylib
[md5] integrity check: NIL[download] delete (probably) compromised file: /Users/foo/.cache/common-lisp/sbcl-2.0.2-macosx-x64/Users/foo/quicklisp/local-projects/obvious/bin/libobvius.dylib
NIL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.