Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation
…or more simply, sharpen on steroids.
It was three weeks ago when my brother Alberto told me about a quite new paper entitled Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation [Lischinski et al. 2008]: in fact we had a talk or two about general photographic techniques some days before and, since i’m interested in the computational side of the subject, i asked him to let me know more about it whenever he got the chance, and so he did.
He was reading a Davide Barranca’s article explaining the basics of image sharpening and exposing various different methods in order to achieve it, so that one can manage to construct his own sharpening strategy, depending on his needs: the aforementioned paper is being referred by the article due to the fact that the new technique demonstrates how it is possible to make use of a better edge-preserving operator called WLS (or weighted least squares) that leads to better results with lot less artifacts and permitting detail manipulation at arbitrary scales: by looking at some sample images produced with it (and published on the Lischinski project page here) i instantly grasped what my brother’s excitement was about and decided i needed to know more about it: i was so eager to dive into it to the point i didn’t even noticed there was an example movie right there to see more of it!
Anyhow, considering computational photography was a brand-new field to me, i’m rather satisfied with the results: the sharpen is polished and the gain in both detail and depth level are impressive, while trying to intentionally cause artifacts is somewhat difficult, in the sense one have to boost detail frequencies to rather extreme values in order to cause artifacts and chromatic aberrations: in fact, considering the way actual tools currently work, i wonder why WLS-based strategies have still to take the lead in well-known commercial applications.
Unfortunately, as you may already know, i don’t have much free time to dedicate to most of the things i’m interested in, so this post is sort of an introduction while the rest will follows: it could take a while for me to write more about it, but i’ll try to share the time between coding and blogging, in the meantime i’m posting some results with it, but please, don’t laugh at the GUI too badly, its still all of an experimental thing and it’s just.. well.. usable ;-P
Note that the videos here don’t give justice to the real results due to the compression going on with both the Xvid codec and YouTube, so look at the HD version if you can.
The following video try to demonstrate some more detail exaggeration:
Compiz-like wobbling windows in AS3
This code was intended to be released back in October last year, but i never managed to do it since it needed some refactoring, some changes and had to be quite decent to present: then in November i got the chance to work with some very talented guys over at Jooce, in Paris, so i never got back to write something about it.
Btw, if you never tried Jooce then give it a try, it really deserves it!
Read more
Fixed point math in pure CPP
NOTE
This post has been previously published on 2007/Oct/31: due to my move to another server i’m now in the process to manually recover the comments for this article. Fixed!
Some time ago i was asked to publish my implementation of fixed-point math, mainly regarding embedded architectures where IEEE floating point computations have really bad performances. What i want to give you here is a pure-c++, template-based implementation of a fixed-point datatype: this thing is more of a test in order to see how much an object-oriented implementation can perform, being in contrast to a more traditional implementation. As expected, operator overloading and temporary object creation overhead are the main issues with a full-oo implementation as this one, anyway, its a damn nice way to exercise yourself in writing c++ policy-based templated code ;)
An AS3 profiler
NOTE
This post has been previously published on 2007/Oct/17: due to my move to another server i’m now in the process to manually recover the comments for this article. Fixed!
I’m currently working on an early-stage, more of a proof-of-concept thing, but i needed to know more about the code performances: googling for an ActionScript profiler just showed up ASProf, an AS2 profiler. So i decided to port to AS3 the C++ profiler i wrote for Aqua, the cross-platform framework i was working on until April: the original C++ implementation has been developed after being inspired by an article of Steve Rabin in the Game Programming Gems 1 book, that’s a nice one to have on the shelf together with some other great books of which i could post something about them later.
It is always wise to remember that if you are serious about code profiling, you’ll be better to search for some professional tools: in the C++ arena my choice would be this one, but if you plan to have lunch and dinner for the next couple of months give Eletric’s one a try, it really deserves a look.
Unfortunately for the AS3 world, i just haven’t found anything really usable for it up to now, so i just thought to release it under a zlib/png license and some hints on how it works here.
ProfilerConfig.Width = stage.stageWidth; ProfilerConfig.ShowMinMax = true; prof = new Profiler( 32 ); addChild( prof );
Hydra considerations
While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release:
- it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel as here, select two images and refresh; you should be now looking at the image you loaded via “Load Image 2…”: now rename “in image4 srca” to be “in image4 srcc” and refresh. Wrongly, you are now looking at the first image
- the GUI doesn’t release cpu/gpu resources while minimized in order to relieve the machine from the rendering process
Aside that, i’m looking forward to try all this cool stuff with Astro!
