A world in dk(decay/denmark) » images http://rotand.dk Just another pointless weblog Sat, 30 Nov 2013 21:03:48 +0000 en-US hourly 1 https://wordpress.org/?v=4.3.18 Spring is in the air http://rotand.dk/2009/03/12/spring-is-in-the-air/ http://rotand.dk/2009/03/12/spring-is-in-the-air/#comments Thu, 12 Mar 2009 11:31:55 +0000 http://rotand.dk/blog/?p=94 I’ve been out for a walk taking pictures of the emerging spring.

I really like the contrast between the decaying plants from the last season and the new growth. Since the the sun is hanging low, but shining brightly, there also is some very nice shadows.

The growth is still in its infancy, but in a couple of weeks everything will explode in green.

[zenphotopress sort=random number=5 album=2]

In order to show the images I installed Zenphoto and zenphotopress. It seems cleaner than coppermine, both to look at and to work with. And at the same time I changed the theme for the blog, and added a widget to show random images from the gallery.

Some of the images are high-dynamic-range(HDR) images.

mossrooms

I use a point and shoot camera, so I’m limited in the range and do not have access to raw images. But this is how i do it

Use autobracket
This takes 3 images. One with the default settings, two with respectively +/- 1 ev
Use a tripod and self-timer
This makes sure that the images are aligned in the best possible way.
Combine images
I use Qtpfsgui and i finally managed to compile and use hugins align_image_stack. Its necessary to align the images even though i use the tripod, as just a slight vibration will move the images a couple of pixels, and this results in fuzzy images. The align_image_stack is quite powerful, so handheld images is a possibility
Tonemap
I usually use the Mantiuk algorithm, but i tweak it so the colors become more vivid/surreal.

]]> http://rotand.dk/2009/03/12/spring-is-in-the-air/feed/ 1 Collection of Processing.org hacks http://rotand.dk/2009/02/27/collection-of-processingorg-hacks/ http://rotand.dk/2009/02/27/collection-of-processingorg-hacks/#comments Fri, 27 Feb 2009 20:07:06 +0000 http://rotand.dk/blog/?p=74 Its been quite a while since I last posted anything.

That doesn’t mean that i haven’t been coding small hacks, just that i haven’t posted them. But now is probably a good time to show some of the stuff.

As the title suggest it has something to do with processing.org. I have been using processing on and off for some time. Its is really nice when you want to make a quick hack, or as its called in processing a “sketch”.

In no particular order here is some of the fun stuff made using processing.

General remarks

The following sketches and their sourcecode have served as small hacks, hence don’t expect nice comments or optimal algorithms…

shrinkImage

It is possible to remove the line from a picture representing the least amount of information. The algorithm evaluates every pixels “weight” as the absolute difference between the different color channels (r,g,b). And then finds the “lightest path” from the bottom to the top.

This means that “prominent features” won’t be removed or change size when shrinking the image. Here the definition of “prominent features” is high difference in colors between the neighboring pixels.

Have a look at shrinkImage

Room for optimizations :

Eventhough its quite quick at calculating the weights and finding the lightest path, it does so in every iteration. Letting it use a bit more memory and just recalculate the changes when removing a line should speed it up. I found a huge speedup when just having an array with the weights from the last and current line, when calculation the path, so not only would saving all weights require a bit more memory it would also slow down the first calculation. But I’m sure it would give a significant speed up in the next iterations, and a lot of +-1 frustrations 😉

helloFoo

There a some quick getting to know processing hacks, this is one off the. helloFoo

One of the very cool things about processing is the ability to use openGL, so originally this sketch uses openGL. But applets and openGL isn’t exactly the best combination. It can be done, but since it doesn’t work for me (firefox, linux openJDK JRE) i just converted it to standard java graphics. And the effort required to do this, is remove an import and don’t say setup(400,400, OPENGL) but just setup(400,400). This is trivially true the other way around. If you want to use openGL its quite easy.

The sketch is just bouncing balls, when going away from openGL I reduced the size and number of balls, in order to get a decent animation speed.

FooIII

Again used openGl originally FooIII

Some satellites rotating around some satellites rotating around some ….

sndHello

yes sketches tend to have silly names : sndHello

From Clifford Pickovers  book : Computers, Pattern, Chaos, and Beauty – graphics from an unseen world (p 39 section 4.3 snowflakes from   sound)
Draw symmetrically and in “polar form” the fft of the sound, hence creating snowflakes based on the sound.
Music by David Rovics
Choppy sound I had some problems with the sound when run as an applet. You might have better luck using the jar directly or by downloading the sourcecode and running it with processing

Slit-scanning

The former applet relied on an external library for the sound, ther are quite a few libraries available. I did use GSvideo to hook up my crappy webcam and do some video effects. I experimented with slit-scanning in different ways.Unfortunately this won’t run as an applet and it might only run on Linux.

By creating a cube of the images, where the z-axis represents time, its possible to play back different parts of the movie from different layers in time. Which makes for some quite interesting and dizzing effects.

For example a time buble where playback is delayed around a “bulge in the timespace continuum” :s (a video of some guy playing with it (timebuble1.avi) some sourcecode for a similar effect where the mouse pointer moves the buble (TimeCube.pde) another more “traditional slitscan” (CamWarpTime.pde) .

In general there is plenty of room to fiddle with the code, there a functions like selectSlice or initQueues where its decided how to slice time. its great fun to play with..

]]>
http://rotand.dk/2009/02/27/collection-of-processingorg-hacks/feed/ 0
Matrix Multiplication http://rotand.dk/2008/06/14/matrix-multiplication/ http://rotand.dk/2008/06/14/matrix-multiplication/#comments Sat, 14 Jun 2008 16:03:46 +0000 http://rotand.dk/blog/?p=69 Who would have thought that matrix multiplication could be beautiful ?

linear tranformation by matrix multiplication

The very short desctiption :

inspiration from an example of homogeneous coordinates in my linear algebra book and lectures about lineartransforms.

There is a jar, with sourcecode, if you want to se it “live” or twiddle with it.

tegneri

]]>
http://rotand.dk/2008/06/14/matrix-multiplication/feed/ 4
Phone images http://rotand.dk/2008/03/19/phone-images-electronic-porn/ http://rotand.dk/2008/03/19/phone-images-electronic-porn/#comments Wed, 19 Mar 2008 16:15:00 +0000 http://rotand.dk/blog/2008/03/19/phone-images-electronic-porn/ I finally got around to snapping some pictures of the “new” rotary phone.

check out those bells

There are more in the gallery

I have been using gnome-blog for posting the last couple of blogpost. And Its quite neat, its an panel applet and it makes posting so much easier since its integrated into gnome. I feel that its missing some features like multiple drafts and the ability to insert images. Inserting images should be possible, with the most recent version, if the blog supports it. But well i do not know if wordpress supports it or if the version in the ubuntu repositories is the most recent. I tried getting the tarball but there was some dependency issues.

Speaking of panel applets i highly recommend bubblemon. It shows cpu, bandwith and memory usage as a “bubbling aquarium”.

]]>
http://rotand.dk/2008/03/19/phone-images-electronic-porn/feed/ 0
xonix mobile edition http://rotand.dk/2007/07/28/xonix-mobile-edition/ http://rotand.dk/2007/07/28/xonix-mobile-edition/#comments Sat, 28 Jul 2007 02:29:49 +0000 http://rotand.dk/blog/2007/07/28/xonix-mobile-edition/ Having toyed around with J2ME for the freeVibes, I got a bit hooked on coding for the mobile phone.

So I started to recreate the classic oldskool game Xonix, it’s a game I really like. So simple and addictive. It’s not the first time I’m coding it, I have made it as an applet about a year ago (Xonix applet). As well as being a fun game to play I find it a fun game to code too. Though I have had my share of frustrations. The basic functionality is a fillalgorithm, that has to fill an area on both sides of the line / trail you make with the ‘pilot’. This has to be fast and efficient – nobody likes a game where you have to wait for updates.

xonix screenshot

When I first made the game i found a neat fill-algorithm. (flood fill wikipedia). So it should have been a piece of cake to implement it in J2me, its java… I deliberately choose not to reuse old code, as I feared it would be horrible ugly. And a course in datastructures and algorithms should have given me some tools to make a better / cleaner implementation. Then the woes began. J2ME, has no ArrayList it has vector and a stack, and the are not generic so no typecasting. I made a version using Vector, but somehow i managed to use all the memory. When I look back I have a nagging suspicion that the Vector isn’t to blame – but rather me that somehow feed it to much data. No matter what it was I got rid of the Vector and started using arrays, and using indexing like in images or c-“double”arrays (index = x + y * WIDTH). Finally it could fit in memory.

And then I started looking for graphics, a nice game really depends on nice sprites – much more than a beautiful algorithm. I couldn’treally find any and its quite painful, at least for me, to make sprites. It gets real ugly, real fast – hmm no it gets real ugly real slow, because i’m no good at creating graphics. Well the frustrations grew and I ending up abandoning the project. The basic gameplay works, but is buggy and as mentioned the graphics sucks.

xonix screenshot 2

All in all it was quite fun programming, and some day i might give it another go.

]]>
http://rotand.dk/2007/07/28/xonix-mobile-edition/feed/ 0
FreeVibes http://rotand.dk/2007/06/27/freevibes/ http://rotand.dk/2007/06/27/freevibes/#comments Wed, 27 Jun 2007 11:57:33 +0000 http://rotand.dk/blog/2007/06/27/freevibes/ Finally the summer-holiday arrived, now its time to do some fun coding.

I bought myself a new mobile, a Nokia 6300, it’s got all the bells and whistles. Hmm well at least those I could afford. I choose this mobile because it has : Java, mp3 -player, bluetooth and memorycard.

I must admit that i might be a bit of a nerd, so I just had to code something for it. And after “hello world” I found a small and some would say useless application to code.

FreeVibes

I must say I got inspired by vibelet and the article in wired ( Hold the Phone, It’s a Sex Toy ). As the title suggest, its well vibrating. I think that vibelet – though i haven’t seen their program, must be making quite an profit. Because getting a java-enabled phone to vibrate constantly, is quite easy.

So now its Time for FreeVibes, a free software version.

FreeVibes splash ducky
That’s the fancy splash screen And when its in vibrating mode, this little duck is there. And now why a rubberduck ? ( answers )

If you want to try it out, here are the jar and jad files. Just put them on your java-enabled mobile phone. I have just tested it on my telephone, It should work on any new mobile (with java) :

Jad File
Jar File
Source code

Installation

  1. Download the jar and jad file and place them on the phone in the same directory.
  2. Run the applet
  3. Have fun

Technicalities

Getting things to work with ubuntu feisty fawn.

I use SUNs java 6 and the wireless toolkit for the J2me.

Nokia has a nice area with information about coding for their phones (forum.nokia.com). But i didn’t have any success using their eclipse plugin and carbide.j seems to be a windows application. But eclipseME worked like a charm.

When setting up a device for EclipseME i had to make sure that it was MIDP 2.0 and CLDC 1.1. It wasn’t the default and the Nokia 6300 can’t handle MIDP 2.1.

They code and design is inspired by Nokias tutorial on making MIDP 2.0 games.

The images I used are from the openclipart collection, hacked together with GiMP and Inkscape, and I use obexftp to transfer the files to the phone.

]]>
http://rotand.dk/2007/06/27/freevibes/feed/ 2
Linkdump I http://rotand.dk/2007/06/13/linkdump-i/ http://rotand.dk/2007/06/13/linkdump-i/#comments Wed, 13 Jun 2007 08:42:39 +0000 http://rotand.dk/blog/2007/06/13/linkdump-i/
  • comercials from the good old days
  • ]]>
    http://rotand.dk/2007/06/13/linkdump-i/feed/ 0
    We are Here http://rotand.dk/2007/06/07/we-are-here/ http://rotand.dk/2007/06/07/we-are-here/#comments Thu, 07 Jun 2007 20:15:09 +0000 http://rotand.dk/blog/2007/06/07/we-are-here/

    ‘Pale blue dot’ on YouTubeFound this on youtube. Its great. It certainly puts things in perspective. Eventhough its the “harsh reality” its uplifting and beautiful. It spoken words from Carl Sagan, there seems to be several different versions with different images. I found this one to be particular good.

    As a sidenote posting youtube clips on wordpress is a PITA, it seems that the editor is a bit to active.

    ]]>
    http://rotand.dk/2007/06/07/we-are-here/feed/ 0
    Cellular Automata II http://rotand.dk/2007/05/30/cellular-automata-ii/ http://rotand.dk/2007/05/30/cellular-automata-ii/#comments Wed, 30 May 2007 20:46:28 +0000 http://rotand.dk/blog/2007/05/30/cellular-automata-ii/ As mentioned before I’ve made a one dimensional Cellular Automata(CA). And although it was intriguing they quickly became very predictive. Actually it was in two dimensions. As the a y-coordinate represented time, but since the states were only depending an the adjacent neighbor’s to the right or left its considered to be one-dimensional.

    But they are not as fascinating as CA’s where you expand the neighborhood to include all the eight adjacent cells. That’s called the Moore Neighborhood.

    Representing the time dimension. As the intersting part is the evolution of the system, representing time is essential. With a two-dimensional CA it has to be done using animations, and who doesn’t like blinking pixels. This makes CA’s makes even more fun.

    In order to decide the state of a cell I look at the Moore neighborhood for every cell on the grid, and count how many neighboring cells are alive. If a cell is alive, then we have to determine whether it survives or dies. If a cell is dead / empty there is the posibility of birth. By defining how many neighbors a cell has to have to survive, and hov many it takes to “give birth” it is possible to run the automata. And this is enough to define a highly complex behavior.

    The ubiquitous Conway’s game of life survives if there are 2 or 3 neighbor’s alive and a cell is born if 2 cells are alive, this can be written as : S/B = 23/2. Using a notation like this makes it easy to try out new rules, just adjusting the S/B sets.

    I made a small c++ program again using CImg to render these automatons. It’s a rather quick hack, and as such there are plenty off room for optimizing.

    But for now it does its job and I don’t intend to develop it further, at least for now. And I think that CIimg might not be the best api for this, I need to look into SDL.

    I spent way too much time hacking around to get a nice coloring scheme, and well CImgs intended users are making image manipulation, and not generating images from scratch. SDL is’t intended to generate images from scratch either, but as far as i can tell its easier to manipulate images as int arrays.

    Well it does work and i were able to try out some of the rules listed at Wikipedia article about Life like cellular automatons, there online java simulators somewhere on the Internets so I won’t bother to upload any videos – as its much more fun to watch in action an play about with the settings as you go along. If you want to play with the code, well here it is : Cellular Automaton code it’s ugly and you need CImg.h

    And now I’ve just downloaded EvoCell which has all the features and a lot more.

    Online simulator : MJcell this is a very good implementation. Its fast and has lots of rules and patterns

    ]]>
    http://rotand.dk/2007/05/30/cellular-automata-ii/feed/ 0
    Finite Automatons and images http://rotand.dk/2007/05/28/finite-autamatons-and-images/ http://rotand.dk/2007/05/28/finite-autamatons-and-images/#comments Sun, 27 May 2007 21:45:56 +0000 http://rotand.dk/blog/2007/05/28/finite-autamatons-and-images/ At a lecture about regular expressions and automatons, we were introduced to the posibility of using automatons to compress images. During the course we have worked with a java package for automatons, so i made a quick hack to render regexps as images.

    The concept is that every acepting state represents black area, and and using a recursive definition of the areas.

    area

    Here is the area for the string “031”

    Using this recursive definition it is posible to adress alle aereas, well in reality I choose a “resolution” and using strings upto a certeain length. I generate all the strings and check whether they are accepted, and should be colored.

    A couple of examples.

    • regexppicure
    • regexppicure2
    • regexppicure3

    The hack I used to make the images above (regexp_picture_render), you need the dRegAut packackage thou it might work with this (http://www.brics.dk/automaton/)

    Here is a few regexps to try out, some are more interesting than others…

    • (1+0+2+3)*(30+03+12+21)
    • (0+1+2+3)*(22+11+00+33)(1+2)
    • (0+1+2+3)*(33+00)(1+2+3+0)*(0+3)
    • (1+2+3)*03(1+2)
    • ((0+1+2+3)*(12+21))+((03+30)(0+1+2+3)*)
    • (((0+1+2+3)*(12+21))+((03+30)(0+1+2+3)*))(1+2+3)*(1+2)
    • (((0+1+2+3)*(12+21))+((03+30)(0+1+2+3)*))(1+2)(1+2+3+0)*(0+3)
    • (((0+1+2+3)*(12+21))+((03+30)(0+1+2+3)*))(1+2+3)*03(1+2)
    • (((0+1+2+3)*(2+1))+((2+1)(0+1+2+3)*))(1+2+3+0)*0(1+2)
    • (((0+1+2+3)*(2+1))+((2+1)(0+1+2+3)*))(1+2+3+0)*3(0+3)
    • (1+2+3+0)*(1+2)(0+3)(1+2)
    • (1+2+3+0)*(1+2)(0+3)(1+2)
    ]]>
    http://rotand.dk/2007/05/28/finite-autamatons-and-images/feed/ 0