Saturday, 21 April 2012

After I have upgraded to 2.6.38-9-generic kernel I got the following message and I have tried many thing but this is how I have solved the problem.

Gave up waiting for root device. Common problems:
-Boot args (cat /proc/cmdline)
-Check rootdelay= (did the system wait long enough?)
-Check root= (did the system wait for the right device?)
-Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/disk/by-uuid/310147a9-f21c-4e7c-aeb0-18f31073da58 does not exist. Dropping to a shell!

The simulation shows an "Agent-world" represented by a grid of squares. Agents survive in this world by eating plants. There are four types of plants that occur in various quantities. Agents are able to consume a combination of plants and gain more energy. The energy levels decreases as they live and as they roam to other squares in the gird. Creatures can carry a limited amount of plants so then can eat when it is needed. If the creatures can create two combinations at once then the most energetic combinations of plants will be eaten first.

In the “Agent world” there could be maximum of two types creatures in the world.

The agent types:

SimpleCreature: Less intelligent creature.

IntelCreature: Most intelligent creature.

SimpleCreature:

A simple creature will be born in the agent world with a limited amount of energy.
The creatures move around the world in random directions in a consecutive manner, for random amounts of times, with an intention to feed to survive.
A simple creature can carry a limited amount of plants.
This creature eats plants when it's energy goes down less than it's energy limit. (When it feels hungry)
The creature is able to consume compounds(CP)of plants (P) of varied types (t) that they carry, and gain more energy than it would if it eats them individually. Such that:

CP = {Pt1, Pt2, Pt3, Pt4}

Creatures can only see the plants in the same square as it is.
When the world has been resized, eventually the creatures will follow back in to the world.
Each individual creature has got a unique ID. This phenomenon has been recorded on the video.

The simulated environment in which the creatures act:
The “Agent world” is a grid of squares.
The plants and the creatures will be in this grid.

IntelCreature:

Only an IntelCreature can look around. These creatures can only see only one square around ahead, as well as the square it is interpolated. They can also see the the plants as well as the creatures in its range of vision.

The creature can remember the creatures and the plants in the squares that it can see (This memory is limited). Although the vision is perfectly accurate only within its local square. Just after it has been born, IntelCreature will be in an Observation mode, so that it will observe the world by capriciously observing the world until it finds more than one plant. Then it will start going after the plants intentionally that it sees around. A creature may decide to go after plants that are more therapeutic than the others. Such plants may be the plants that could complete a combination.

If two creatures meet together in one square they start talking to each other, asking about the plants that the other creature carry. Then the first creature will propose to the other creature for a shared combination, with the amount that it would like to share. Such that:

If the other creature agrees then they will consume the plants and share the energy amount. When they share the plant combinations, they will get the double the amount of the normal combination, hence it is more desirable for the creatures to share. The creatures can decide to be partners with another one, and go for other plants that one of the creatures have seen. Furthermore when the creatures are in the same square, they may request other creatures to be parters, a creature will request to be a partner of another creature, if the plant the second creature is going after, interests the first creature. If the second creature agrees to be partners, then it will make a leader and partner relationship between each other. The first creature that made the request will be the partner and the other will be the leader. After the leader gets the plant, the energy amount will be shared. Finally the partnership will end and the two creatures will go their own ways. In the situations where the plants that are subject to the partners engrossment have been taken by some other creature, the partnership will immediately end. When the partnership has been made, the colour of the red circle, will change to a light yellow colour if it is a partner, and the colour of the leader's circle will change in to dark yellow. This is demonstrated in the figure blow.

A creature can make partnership with another one, only if the both of the creatures are neither a partner or a leader. If the creatures do not carry any plants and it can not remember any plants, it goes back to the Observation mode to collect information about the world(Grid). If the creature can not carry any more plants, it will stop travelling to save the amount of energy that it will loose by going to other squares.

What are plants?:

There are four types of plants in the world.

Green plants, Red plants, Yellow plants, and Magenta plants.

The plants are represented in small squares with the colour of their names.

Each plant holds different energy levels.

A plant set consists of a set of random types of plants.

The plant sets appears in the “Agent world” in arbitrary places.

The amount of the plants that will be put in to the grid is variable.

In the world there will be a constant amount of plants at a time.

The size of the “Agent world” is variable.

The number of types of plants are in the world are variable.

The energy of creatures will be consumed until it dies. The energy consumption speed is variable.

If the creature moves to a different square, more energy will be consumed than if it stays in the same square.

The log output of the software which show

what a particular simple creature does

what a particular creature that looks around does

the interaction of a two creatures who meet

The above description about the "AgentWorld" is just a brief introduction about the project. Accordingly there are many other theoretical and technical details that I have not introduced to you in this article. Although if you are interested, I am happy to supply you with further details on this project.

Wednesday, 18 April 2012

The new arrival to my playing card collection. Bicycle Actuators Artist Edition deck has been designed by Lance T. Miller. This is a great piece of art work that was hand drawn by the designer. Only 2500 decks have been printed and all of the decks have been individually numbered.

Wednesday, 4 April 2012

Have you ever searched google for images? I am sure everyone who is reading this article has done this before more than once. Wouldn't it be nice if you could search images for the similar images, for a given image? So for an example, if you want to search for an image of a particular object, by supplying a probe image (a image which to find similar images of) to the search engine, you can search for images that are similar to the given image.

Content-based image retrieval (CBIR) or Query by image content (QBIC), is an active area in Computer Vision research. Comparing images using cross-correlation efficiency was similar to the state of the art for CBIR in the early 1990s. Comparing the colours in the probe image and other test images, is one conservative way of doing this. Histogram is a good way of discriminating the colours in an image.

One way of doing this is explained below. There are many ways of doing this although this is not necessarily the right or the best way of doing it.

Split the R,G,B channels of the probe image

Split the R,G,B channels of the "test image" that is subject to comparison.

Calculate the histograms of the R,G,B channels of each images.

Calculate the cross correlation of the R, G, B channels of the probe image and the "test image" histograms. Such that,

The result (r) of a cross correlation calculation lies between -1 and +1. If the value is +1 in average the two images are identical. If it is -1 then the images are identical but the image looks like a photographic negative version of the probe image. If r=0 then the images are on average very unlike each other.

People who are interested in Computer Vision are likely to be familiar with the OpenCV library. The following code snippet (incomplete) is an example for calculating the cross correlation co-efficiency using the OpenCV library in C.

In the matrix above it shows the amount of test cases for the each picture in the “test” column, True Positives, True Negatives, False Positives and False Negatives in the next four columns. Then the application calculates the accuracy, recall, precision and specificity as follows, and displays in the next four columns. The last “class” column show the type of picture that it has carried out the test on,Precision is the number of relevant pictures that are retrieved, divided by the total number of of pictures retrieved. Recall is the number of relevant pictures retrieved divided by the total existing relevant pictures. The specificity and the accuracy is calculated as below

As you can see above, the application has failed to find the True
Positives for the “box” and “cockeral” pictures. So in
contrast it has found False Positives in all cases. The best case is
the tests on the ornament pictures as it has found 7/8 TPs and 1/8
FPs. Overall this algorithm has done 68 test cases and have found 31
True Positives and 37 False Positives, but no True Negatives or False
Negatives.

The matrix below, is the class confusion matrix.

Confusion matrix calculated from mycbir

expected

actual box cockeral dog horus ornament penguin reindeer tortoise

box 0 0 0 0 0 0 0 1

dog 0 0 6 0 0 0 0 0

horus 0 0 1 7 0 0 0 4

ornament 1 1 0 0 7 2 7 0

penguin 1 0 0 0 1 8 0 0

reindeer 5 7 0 1 0 0 1 2

tortoise 1 0 1 1 0 0 0 2

The columns and rows indicates that, the classes in the rows titles
were obtained when the classes in the column title should have been
found (Rows as obtained results, columns as expected result). The
numbers indicates the number of times it has been obtained. So as an
example, as the worst case: in the “box” column,

ornament =1, penguin = 1, reindeer = 5, tortoise = 1 has been
obtained when “box” pictures should have been found. But it has
not obtained any “box” pictures as the value of the “box” raw
is 0.

As I have mentioned earlier the best results has been obtained on the
tests with the “ornament” picture. It has obtained the correct
“ornament” pictures 7 times and a penguin picture just one time.

Conclusion:

Cross correlation is not the best Content based Image Retrieval technique to date, though it helps us to understand how the histograms of two images can vary or can be complementary. But it is no doubt that analysing just the colours in images are a good way of characterising them though it is hard to compare two images using just this factor.