Labels

Showing posts with label digital. Show all posts
Showing posts with label digital. Show all posts

Wednesday, 10 June 2015

Research Post Appendices

Appendix i. Accurate Matching

The use of an accurate, or at least acceptably inaccurate matching method needs to be found. In almost all situations accuracy is traded for speed.Some methods of comparing images that I investigated (and used):
  • Perceptual HASHing
  • Mean Squared Error
  • Structural SIMilarity

Perceptual HASHing

Perceptual hashing is useful for a number of things in this project however not creating the actual mosaic. The primary use of this algorithm is for locating duplicates. the reason for this is that phashes can be compared and a measure of difference (from 0-36) between hashes can be acquired very fast. The main reason why this algorithm is not good for creating mosaics is due to the way that it is processed, the order of operations goes as such:


This is great because you can tell the bit difference and its fast, unfortunately some of its strengths are also its weaknesses concerning mosaic creation: it doesn't care about scaling, rotation or colour.
Due to the way that the hashes are compared, rotation doesn't matter (the same image rotated will still have a Hamming distance of 0), because they are all reduced to the same size (so that the hashes have the same size and can be compared) scaling is irrelevant, and because the image is converted to greyscale colour is irrelevant. This was useful for matching and deleting duplicates in the first round of image collection, however was wildly inaccurate for matching against the reference image.

Mean Squared Error

Mean Squared Error was the best algorithm for comparing against the reference image. This is because it is so basic.
Unfortunately the primitiveness of this algorithm means that you can only compare images of the same size.
The algorithm goes like this (assume that the images are 3x3):
  • This gets the error:
[ 3 2 5 ]   [ 1 0 3 ]    [ 2 2 2 ]
[ 2 1 4 ] - [ 1 1 2 ] = [ 1 0 2 ]
[ 5 1 2 ]   [ 3 1 2 ]    [ 2 0 0 ]

  • Square that:
[ 2 2 2 ]        [ 4 4 4 ]
[ 1 0 2 ] ^2 = [ 1 0 4 ]
[ 2 0 0 ]        [ 4 0 0 ]

  • Get the mean:
(4+4+4+1+0+4+4+0+0)/9 = 2.33333r

Because this can be applied to arrays of arbitrary dimensions, it can operate on colour (alpha channels even!), and gets a measure of dissimilarity that is standard.
This was the algorithm that was primarily used for the mosaic creation.

Structural SIMilarity

I still do not fully understand how structural similarity works (a lot of really complex mathematics), but I did find that the version that I used didn't fully take into account colour and had issues with incorrect detection.
Maybe later I will go back and look into it further.


Appendix ii. IpA vs ApI

The distinction between these two high level algorithms and understanding of why they are different is very important to understanding the methods behind mosaics that I have been creating.

IpA

Image per Area (IpA) is where you divide the reference image up into equally sized sections, that approximately add up to the number of images you have to compare, and then each image is compared against each reference section and ranked based on its similarity, the rankings are stored in a list for each section.
When the time comes to perform placements on the reference image, a random reference section is selected from the list of sections to be processed and the highest ranked image that is not in the list of used images is placed, 
the image is added to a list of used images and the reference section is removed from the list of reference sections to be processed, repeat.
This places all images into a grid, and makes sure there are no repeats (it does end up with a few leftover images, due to the way it divides up the reference images).


ApI

The IpA algorithm set is in stark contrast to the other high level algorithm that I have termed Area per Image (ApI).
ApI is implemented in a less structured but more scalable than IpA, this is because it has less set restrictions on the amount of accuracy that it can have in the placement of the images, and less restrictions on the actual placement of the images. It is also an "Embarrassingly Parallel" process.
In ApI placement the placement images are grouped into a list, the number of different scaling values is set, the number scatters is set, of and the number of recursion passes is set. Once this has happened each image is rescaled on a gaussian distribution with the mean centred around the average size for all the images, this is done a number of times. For each time the image is rescaled a number of points are scattered around the reference image and a comparison is made for the image at each of these points, the highest similarity comparison point is selected. This image again scattered around that comparison point, with the region within which it is scattered around being 6x the size of the scaled image itself. This is repeated for the number that recursion passes was set to, each time the number of scatters and the region being multiplied by 1/n. At each point in this recursion process, if a better comparison score is detected, it is selected as the origin for the next recursion. When n reaches the number of recursions, it returns the last comparison point (the highest similarity score), compares this to best scores of the alternate scaling values (acquired using the same process), and stores the data.
This data is then sorted into reverse order (best scores at the end), and placed on a blank, black image, from first to last so that the best scored images are placed on top.

In my works I used both these methods, first IpA (for the background) and then ApI (for the detail).

Appendix iii. How to avoid duplicates

After the previous appendices this one seems almost like an afternote. It is almost irrelevant in comparison to the depth of the previous ones, however it is actually one of the most fundamental parts of how I created these mosaics, and what makes them unique is their ability of only have unique images in the database.
The way in which it was done is this:

  • (for each image: generate phash and store in the database)
  • (for each phash in the database:
  •     (compare this phash against every other phash
  •         (if the difference is under a specific value: delete the lower res image, and remove it from the database)))
This is just basic duplicate removal, however it is key to the kind of images that I have created.

Tuesday, 9 June 2015

Research write-up

Over the course of my photomosaic project I have needed to do a bunch of research into the art form and the available software out there.

Most of the software/services that I found either didn't match images very well (see app i. Accurate matching), only match to a grid (see app ii. IPA vs API), scale everything down (see app. iii. Scaling up) or repeat images (app iv. How to avoid repeats).

I found someone who claims to be the "inventor" of the photomosaic here, and while, yes he has photomosaics, they are all only matched to a grid.

I found a photomosaic stiching program called mazaika, and while the feature list is quite impressive, it has less accurate matching than my sofware and only matches to a grid. It also uses the (terrible IMO) feature to mask bad matching, where it colour corrects the images to the reference image.

I ran across an interesting method of grid mosaic tile matching using a "nearest neighbour" algorithm. This leverages machine learning to create a satisfactory result, however it does so to an approximation accuracy rather than an exact one. Also the creator has a good flow for generating tiles.

I've also read up on some of the other methods that people have used to create mosaics both online and offline, most of them only use one technique and/or modify the source images rather than arranging them.

Here is a quick list of some of the options that I investigated:

  • http://www.theartoftylerjordan.com/make-an-easy-photo-mosaic-in-photoshop-2/
  • http://www.mazaika.com/
  • http://tvldz.tumblr.com/
  • http://www.photomosaic.com/portfolio.html
  • http://mosaically.com/
  • http://www.canvaspop.com/photo-mosaic
  • http://www.mosaizer.com/

Friday, 1 May 2015

Changed major video work

The work that I was previously doing for "Creative Possibilities in Video" was a work inspired by the book Flatland and Don Hertzfeld's "Rejected" animations, however... I'm not doing that anymore.

The reasoning behind this is that in my spare time, I've been making some music videos using software that I've written for a jazz musician called John Mackey. I now feel like these works are becoming some of my stronger works for the year and so rather than continue in an uphill battle pushing a time consuming animation project, I decided to pivot and change the project to be on these works.

A sample of one of these works:

.

Unfortunately Vimeo doesn't allow me to upload any more of these yet. So I am going to upload them at a rate of 1-2 per week.

Soon I will also publish a short demonstration of how I have been using this software to create things and some of the common tweaks to the source that I've done during the production of these kind of works.

Also an interview with John Mackey about the other half of these works will follow.

Wednesday, 6 August 2014

IR Timelapse

I have been doing some IR photography, time-lapses in specific.
This one was made using a raspberry pi and the NoIR camera with 15 second shots and was filmed between the hours of 5am and 1pm.


Tuesday, 10 June 2014

Major Project Update

I've finished the major project as a combination of some works that fit with the IWP I did, and some works which are less architecture interactive and more general.

A brief rundown of the work that I've been doing:

I streamlined my VideoSquarees and added significantly more clips (pretty much doubled the number of clips available.

I updated some of my projects to include use the NSWindower system (which is a bitch to use because it means actually learning all of Apples development systems).

I added a 3D sketch of the Joints application, with fractal branching and 3D collision physics with ofxMSAPhysics.

I also created a new video project to generate an infinite business advetisement.

EDIT:
I've finished the business advertisement.


Sunday, 13 April 2014

Update on Major Project

I think this project deserves an update.

I've been messing around with ofxNSWindower, and have managed to get a fullscreen GL context on one screen while maintaining a control GUI on the other. Ive been told to invest a little more in the visual component of this artwork so I'm going to start doing that a bit more. A quick gallery of stills:


Squarees(left), and Squidees(right) being projected on the Peter Karmel building at ANU:



a screenshot of Fluidees:


and a screenshot of Rainees (they do actually move):


I've also been working on another project that grabs short video clips and incrementally loops them called VideoSquarees (this has been updated to run more efficiently, and with a longer loop cycle): 


I put some of my efforts into what might be considered a side project unless I can find an application for it in the overarching project:

Thursday, 20 February 2014

Spherical

I've been playing around with meshes in oF and I found a cool algorithm to create a 3d sphere of points using segments and a radius here. I also found a way to scramble the points from the set segment line by changing a variable.

I used the product of the points position relative to the centre of the sphere and an array (see C++ vector) of scaled noise values to change the position of the points.

Once I had the positions moving and changing to noise I added the other drawing modes like applying a subsection of the noise array to entire rows of the sphere.

Then I applied a mesh to the points in the sphere and drew the mesh to screen

I also added a simple UI for control of the object, along with lighting, and colour between the vertices.

At this point it looked a bit like this:



Also I used this method of getting normals for the faces of the object:
for all the vertices in the mesh except the first and last, add a normal at the normalized vector of the perpendicular between the previous and the next vertices.
Then I tweaked the lights a bit and considered the project finished, however I kept having problems with the addon I used to do the UI (ofxSimpleGuiToo) not saving the settings sometimes and not loading them from the XML file correctly (for some unknown reason, I think because its not compatible with oF 0.8.0)

I also wanted to implement some post processing fx. I hunted around for a bit and found ofxPostProcessing, and then implemented it.

By this point ofxSimpleGuiToo was having a conniption and wouldn't do anything that I asked of it and so I decided to upgrade to the elegant but slightly more complex, ofxUI, which is by far the superior technology.

Here are some screenshots of the finished product, along with a demo video:












Spherical Demo from Gareth Dunstone on Vimeo.

Thursday, 18 July 2013

Messing around with linux

Over the past couple of weeks I haven't been doing much coding or art.
I've been immersing myself in the art of server maintenance.

I compiled my first custom Linux kernel (Gentoo), unfortunately it was a x86 kernel not a x86_64 and I needed sleep desperately. I got given a IBM eServer (346?) xSeries with dual Xeon 3.2ghz processors. So I've been playing around with that (currently its running Arch Linux).

I got more familiar with the use of bash scripting to start programs on linux servers. I followed a guide over here only used the system crontab because it lets me do things as different users :) I did this because bfgminer kept crashing within a screen session and killing the session it was in (not giving me any reason). This way: it crashes -> cron runs the script every 5 minutes -> the script checks if bfgminer is running -> if bfgminer isn't running restarts a new screen session and bfgminer inside it (success YAY).

EDIT:
Also for those running Ztex FPGA devices. YOU CAN RUN IT AT A NORMAL USERLEVEL!
You don't need to run everything as root (particularly if you are using bfgminer like me).
The information you need to know is here.

Tuesday, 21 May 2013

Autonomous Agents, Genetic Algorithms and balancing Natural Selection

For the past week I've been working almost exclusively on a branch of the flocking algorithm used in FishBirds to create a Predator vs Prey program, however it has proved to be much more fruitful than that.
Since starting last friday I have learned how to implement effective natural selection and semi random evolution like this:

 - Predator dies constantly.

 - More prey is introduced when under a certain number.

 - Predator and preys values (speed, agility, weight, sight) are decided randomly with a bell curve around set values.

 - Some Predators are born better and hence do much better, and stay alive much longer.

 - Some prey are born better at escaping predators and hence also stay alive much longer.

I did however find this system lacking in its complexity and method of "evolution" so I decided to try my hand at a genetic algorithm. I wanted something where the offspring was given values similar to the parent, but that could also drastically deviate from them. So I put together a moving mean. And implemented 2 different types of reproduction, time and "well fed". This more detailed list:

 - Predators die constantly, and die faster the smaller the flock is.

 - Predators reproduce when a certain amount of prey is eaten in a certain timespan and when they are of reproducing age (this is to stop the predator slamming into a group and then all its children reproduce causing a huge increase in number of predators).

 - Predators spawn one offspring, and stay alive (this is to for competition between generations).

 - Prey reproduces by staying alive for  certain amount of time. Prey then has 2 offspring, and dies.

 - The moving mean: The normal of the gaussian distribution of random values for the offspring are the current values of the parent. This ensures a good development of genetics and keeps the gene pool relatively diverse.


Problems that I have encountered:

 - If the flock is under a certain number and there are a certain number of predators. The predators will continue to live on the small amount of food that the prey provide.

 - Performance. In a perfect world I would be able to have a flock size of anything. Unfortunately the components of a computer, and Processing have limits. I have been pushing these and I think its time to move on to something more powerful, at least for a language (Discussion in my next post)

 - The flock is limited at the moment. It stops multiplying once it reaches a certain size. This was implemented to reduce performance issues and hence has stopped me producing a more realistic simulation.

 - I couldn't work out how to implement a method of generation counting. I'm sure with more time I could work out how to do it, but I don't want to spend any longer on this project.

I've published a final video to Vimeo.

In conclusion I think I am now significantly more adept at coding than I was last week.
I had a more in depth exploration of OOP, and became much more experienced in balancing systems. I learned how to implement some more advanced random statistical tools to give more useful data. And I learned how to implement genetic algorithms.

Wednesday, 24 April 2013

Github, and finished project.

I started a git, and started some repositories.

https://github.com/stormaes/singing-fishbirds/tree/local

Everything is on there. I'm not going to speak much about it because most of its in the readme and I don't want to repeat myself, because I hate repeating myself.

But I will say this: that project, was HUGE.

I have used 3 new programs, 2 new languages, learned to use 2 new libraries. And then compiled all that into a single project, learned how to use Git. Then wrote a 1300 word readme.

Goodnight internets.

Tuesday, 5 March 2013

More improvements to Arcc.cc, particularly the content loading on square and hexagon.
I used jquery to hide all the content first

$(document).ready(function(){
$('#video0, #video1, #video2').fadeTo(0,0)
$('#video, #video1, #video2').hide();


Then once the selection on the navbar is clicked (#intro0), hide the other content that may be active(#video1, #video2) and fade in the content.

$('#intro0').click(function(){
$('#video1,#video2').hide();
$('#video0').fadeTo("slow", 1);


Once the navigation has been clicked, bind to the 'ended' event, and when the even triggers fade out and return to frame 0. (this is not present in hexagon, as there is no end. The hover functions work all the time after the navigation has been clicked)

$("#video0").bind("ended", function() {
$('#video0').fadeTo("slow", 0);
this.currentTime = 0;


Hover functions: when the ended event has triggered enable hovering over the content so that it can be played again.

$('#video0').hover(function(){
$('#video0').fadeTo("slow", 1);},
function(){
$('#video0').fadeTo("slow", 0);}
);
});
});


This code is then just copied over with different entries, to hide the other content and show the correct content.

The only problem I have found with this code is that when the video has ended, and the hover function is run, if the video is restarted more than twice and ended, the hovering gets increasingly longer response times. I think i can fix this by stopping the hover function on ended before restarting it. I don't know how to do this yet, and the bug is low priority.

I was helped with this code with direction from Christopher Fulham, and actual jQuery help from <insert classmates name who I have shamefully forgotten here>.


Wednesday, 27 February 2013

Processing experiments with flocking

For the past 2 days I have been intensively into Processing. I've spent about 20 hours out of the past 48 coding.
The result has been that I've created a few Processing sketches, all on the subject of "flocking". Each of the boids detects the proximity of its peers and steers towards the average direction of the "flock". They also repel each other, and attract towards each other to form the "flocks". When the boids collide they both take a new vector of the average sum of the previous ones.
For some of these sketches, colour is controlled by the weighted number of nearby boids, some of them alpha is the attribute thats modified, and for all of them diameter/size is also controlled by size of the flock.

For colourising the main 3D sketches I mapped the boids location in 3D space to control the values of RGB. There is also basic user interface for the 3D sketches, allowing the user to change colour modes between B&W, Blue & Black, and Rainbow, and to change the camera mode between spiral rotation, level rotation, and mouse rotation. There is also facility to pause the camera so the user may examine the flocking inside the cube.
The 2D sketches respond to mouse gestures and the boids repel away from the mouse.

Also most of the 2D sketches are js compatible and you can view one of them here, its #04.

I used heavily modified code from these locations:
http://www.openprocessing.org/sketch/47022
http://processing.org/learning/topics/flocking.html


3D sketches


Video of 3D Flocking Demo


2D sketches

Monday, 25 February 2013

More work done on hexagon page

So...
I'm back at uni and working hard again.
Today a bit more work was done on Arcc.cc, specifically the hexagon page (link for the lazy). It still has a couple of small pieces of code that need to be written (or rewritten) but overall its functionality is acceptable.

Breakdown of changes:
1. Switched from iframes to javascript.
  • Removes the reliance on openprocessing.com.
  • Faster load times.
  • No java applet permission requests as it draws straight to canvas.

2. Changed from a straight up layout to request and interaction based, also changed the size of sketches.
  • Gives a more clear place for viewing.
  • No more confusion and scrolling.
  • Borders to know that happens when you click a navigation button.
  • Allows for more organisation and layout, and sets a set size for sketches.
  • Con - the change of size of one sketch causes quite intensive load (this is due to the sketch itself as well as the fact that it is being drawn in a browser).

3. Implemented JQuery.
  • Can modify content on the page much, much easier.
  • Quickly implemented and can be quickly added to.


What I learned from today (in chronological order):
  • My Web Development class is not nearly as fast paced and awesome as my Internet Art class.
  • Hackertyper.net is good for trolling other students who aren't as computer literate as I am.
  • JQuery is AWESOME! and can do all the things.
  • Revere Occam's Razor. It is your god.

Thursday, 4 October 2012

Particle Systems!

For the past couple of days, other than doing the usual processing work, I have been getting back into the habit of playing around with Maya. I started off getting reacquainted with the program and then once caught up on what I already knew I decided to push my knowledge a little further and experiment with particles. There was a preliminary experiment to this video however its not as emotive or awesome as this one is.
I made this for a girl called Emily. Its an abstract piece based on emotional life experience (of finding love and all that jazz).
The music is Nannou by Aphex Twin.

Monday, 3 September 2012

First Processing sketch

This is my first uploaded processing sketch. This was generally an exercise in using functions and getting processing to do what i want. Soon enough I might update this with the ability to "listen" to sound and music and derive its activity (and possibly colour) from beat, frequency etc. It's called "Crosses" and I've also chosen to release it under GPLv3.

Monday, 25 June 2012

Company animations

I've been becoming more and more fascinated with film credits, and so I've been making more of them.
this is one for a fictional company called Bent Ring.
It was really created so I can explore and manipulate liquids in Maya, hence the centre of the rings..




I dislike the fade in of the text so I will probably change that. Update: This is the new version:

Wednesday, 6 June 2012

GOON!

My increasing alcoholism has given me a deeper appreciation of a certain cheap wine.
In homage to that cheap wine I have created this.
I like the little things at the start of animated movies (the credit for the animation company) and I liked making this so I'll probably create a few more.
Creating this was quite simple, I learned how to attach a brush to a curve, manipulate curves better and easier.
Im quite happy with this one, however it could have done with a little bit better lighting (not as intense and white).

Sunday, 3 June 2012

Exploding Moon

I created this in maya after playing around a lot more with dynamics and shatter effects.
pretty basic but it was a lot of fun to make.


Friday, 25 May 2012

Playing around with Maya

After much trepidation and sleepless nights I'm finally able to say that I feel relatively confident in my skill with a 3D modelling program... I'm only able to say this because I tonight produced something that I'm actually happy with. Enjoyable as it is to mess around with polygons, bump mapping, nDynamics, texturing, artificial lighting etc. having something to show from all the time invested is nice as well... Here is one of the products of that time invested... A Shattered Moon...
EDIT:
More snaps!