Here I will write, what I need to be sure that I can find again, and far more which I probarbly don't need to find again :)
Saturday, May 30, 2009
Extending windows 7 split screen feature to connected resizing
But a nice feature that could be helpfull when two applications run split screen would be to connect the resizing, such that when i increase the width of VS, the width of Adobe Reader decreases and vice versa.
If the windows shouldn't always be connected, a visible handle with the correct affordance between the windows would allow for both connected and normal behavior.
This could even be extended such that whener two window frames touches each other, that handle appers allowing connected resizing.
Thursday, April 16, 2009
SSD benchmarks using HD tune pro
- Maxtor_6V300F0 - My Maxtor 300GB HD, a refurbished replacement for a 250GB broken Maxtor drive I bought because it was lownoise.
- OCZ_SOLID_SSD - One of my companies OCZ solid harddrives i put to the test, ~64GB
- TS64GSSD25S-M - My Transcend 2.5" Solid State Disk, ~64 GB, bought for testing SSD drives, this was/is the cheapest drive avaliable.


The Transcend and OCZ both have very fast access times, The Transcend is a bit faster than the OCZ, but nothing to talk about. Both SSD's beat the crap out of the HD, as expected...Then a raw Read benchmark that excesizes along the geometry, I would like to have made a read also, but this is not really possible, since HD-Tune requres a unpartitoned drive for this, but the Transcend is my main drive and the Maxtor my storage...


Once again the SSD drives shiness, The Transcend is a bit faster than OCZ again.Finaly lets look at the file benchmark.



This seems more nuanced, The following graphs summarizes the finding cross disk better...


Notice that for small files, the HD is actually faster than both SSD's both in writing and reading. For writing the Transcens is actually the slowest no matter what. While for reading it is the clear winner. The OCZ is almost as fast as the HD in writing, and gives much faster read speed. Hard to decide which one is best... What do you think?
Wednesday, January 28, 2009
New power computer
Among the fancy hardware is a 64GB solid state disk used for O/S = 'Windows 7 Beta'.
As I haven't tried windows 7 on another disk, I can't really see if its faster than a normal disk, but it is fast. I have benchmarked it using Roadkil's Disk Speed V2.0 , I will leave the judging to you:
First the disk info, it is a Transcend 2.5" Solid State Disk. Disk speed reports the following:

And the good stuff, Benchmark.

I did two test, and the numbers does fluctate, but the general picture is the same as above. Notice the fast acces time and excellent random read speeds.
Just for comparison I benched my older Hardisk with disk.


I gues the O/S is happy about the fast access time and random read speed for the solid state disk. But it is interesting that the old disk actually is faster with linear read on small files... anyway thats it for now.
More interesting, HD-Tune says the following,
For the SSD
And the old disk
Saturday, August 9, 2008
Detecting chess moves inter frame
We are making a robot play chess against a human, and thus we need to see the moves the human makes.
The most intuitive is to take an image before the human move
The two columns shows a black pieces move, the left column shows a black pawn move from a white square to another white square, the right column shows a black pawn move from a black to a black square.
First we have before the move
After the move
An the difference.
The above little test shows that it should be easy to detect piece movement (It works equally well with white pieces).
Obviously things look different when there are changes in illumination, we are designing this system to be used for exhibitions, therefore we assumes that there is going to be some changes in the global illumination, although we will set up light and provide a somewhat stable illumination basis. The following two images where taken within a few minutes.

and the difference:
Two thing are worth noting here, first off all, there is visible changes in the light at locations where there are no changes in respect to piece content. Furthermore, the white knight moved from [G1], is rather difficult to see.Thresholding the image yields:
This test until now points toward a possibility of only using changes in intensity between frames for detection of where pieces move from and toI really find it difficult to believe that this simple approach is stable when global illumination changes more than what I have sample images for right now. To compensate for the illumination problems, I hope that the difference off edge images of before and after are more robust for global light illumination, lets see how it looks.
first the difference of the two black pawns for comparison:
Is is easy to see that once again detecting what pieces have moved should be doable.Now on the image with the illumination problems, I have thresholded the images right away,
and it seems like it should be possible to find the pieces. Note that there are pixels which are noise, they can be removed in some different ways, by smoothing the image multiple times before edge detection, some of the pixel noise can be removed, as the following image shows:
Actually, From the test I have made right now, it seems like the Intensity image can be used for reasonable performance, the problem I currently can see is that in the thresholded image, finding an circle at the knight location seems non trivial and finding the circles are rather important since this is probably what we are going to use a input for the robot.A tuned circle Hough transform reveals the following circles in the problematic images using intensity and a static threshold of 0.1 (intensity in the range [0:1]), the read areas are where the pieces where before, and the yellow are where they are after. The Hough transform has been tuned to not making any false negatives.
From the above image, we can see that the size of some of the circles doesn't fit with the size of the pieces. I expect that further processing can find the correct size, and also negate false positives
Using the thresholded difference of edges as input for the hough transform yield:
Once again, the parameters off the hough transform was tuned to make no false negatives, but to capture all positives, far more false postives are produces compared to using the intensity difference image. The sensitivity off the hough transform was actually slightly decreased, but the image was smoothed several times for achieving the desired result.
Conclusion: I would say that both off the discussed methods looks promising for identifying areas off interest for more complex processing.
The following problems need to be solved next:
- Investigate how this works when illumination changes
- Kill false positives
- Identify the square that the change are in so the chess engine can be informed about the move
First we detect the area of interest by threshing the difference of edges
Then we dilating with a 3x3 square kernel 9 times and find connected component in the dilated image, components with smaller width or height than an pawn radius are discarded. We are only interested in pieces which are moved between squares, evaluating
This leaves us only with the squares pieces have moved from and to which are handled by logic.
Tuesday, August 5, 2008
Excellent Python IDE wanted
I would also like to use my crappy via epia, since it doesn't make any noise (fan-less), and that is a good thing. On my powerfull rather powerful laptop I am using eclipse+PyDev for my python. The epia chokes when I use eclipse, starting is is about a minute, and opening a file is about equaly slow... On a good day, if I click on the output from the debugger, it takes arround 5 minutes to open the file which othervise is handy for seeing the function signature. and usually it just stalls...
No, I am not satisfied with some texteditor+syntax highlighting if I can get more :), So I went hunting for a nice python IDE.
My first try was Gedit which is a texteditor with syntax highlighting... It works fine and a few years ago before I was used to visual studio and eclipse, I would probably be happy...
Then I tried Komodo-edit-4. Komodo-edit-4 seems really nice, they have a professional looking website and the installation worked right away. Upon first run it prepares code-intelligence, therefore my expectations were high when it finally loaded... Initially there is no way to execute the file you edit, which pretty much means that it is an text editor with syntax highlighting. This can be changed by adding a command to the 'toolbox', Interestingly enough, I cannot see how to stop running wild programs :). Kommode-edit shows auto completion on the standard python stuff, sadly it apparently doesn't work with site-packages like OpenCV, on the other hand, this might be a problem with the OpenCV implementation, because It is possible to fake the auto completion wizard with something like.
* non functional code begin
X = CvMat
X.[gives the selection choices]
* non functional code end
but typing
cv
doesn't bring up any choices like
cvCreateMat(...)
cvCreateImage(...)
etc.
Komodo-edit does seem better than Gedit because it features completion on the standard python stuff, Furthermore it also shows the arguments for the signature when calling methods on build in objects. Komode-edit does realtime syntax checking, nice when you forget to add commas when initializing list like you are used to from MATLAB / Octave :). It is possible to go to the documentation for in.sites packages, and unlike eclipse it actualle happens rather fast after the request.
Kommodo has some real crappy project stuff, I cannot figure out what it does besides from listing the files in the directory where the project file is... WTF, for python programming it doesn't seem to add any value.
Overall, I would say that Komodo-edit has some very nice features, but the lack of direct execution makes mewish for something more... There is a version called Komodo-IDE which cost money and apparently adds the feature off an interactive console, and I would guess, also the possibility to execute the script directly, since it has debuggin facility.
The next IDE I looked at was DrPython I didn't expect much, but it delivers what it promises: There is no code-completion, but syntax highlighting, code folding and the possibility to execute directly from the editor. Upon errors in the scripts, the editor set the cursor at the detected error. It is also possible to have separate tabs with python running in a window.
Sunday, July 27, 2008
Epia EX1000 on ubuntu 8.04LTS
It was already running fedora core 8, and I had downloaded the pre-upgrade to FC9, that didn't really go to well, and i ended up with a system that couldn't boot. Since Fedora is damn huge *and I don't have a dvd burner in my old stationare, I decided to try the new ubuntu 8.04LTS desktop edition.
Here's the list of things I have to remember when installing again.
* I had to specify VESA on the kernel promt to be able to boot to the installer.
* When installed, create a new boot entry without vesa to enable non-vesa drivers (I don't know if this is actually necessary)
* use the xorg.conf below to enable openchrome drivers
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by failsafeDexconf, using
# values from the debconf database and some overrides to use vesa mode.
#
# You should use dexconf or another such tool for creating a "real" xorg.conf
# For example:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
EndSection
Section "Device"
Identifier "unichrome"
# Driver "via"
Driver "openchrome"
Option "ActiveDevice" "LCD"
# Option "TVOutput" "S-Video"
# VideoRam 65536
# Insert Clocks lines here if appropriate
Option "VBEModes" "true"
Option "SWCursor" "true"
EndSection
section "Monitor"
Identifier "viewsonic"
Option "DPMS"
EndSection
Section "Screen"
Identifier "Screen 1"
Device "unichrome"
Monitor "viewsonic"
DefaultDepth 24
Subsection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
screen 0 "Screen 1" 0 0
EndSection
Section "Module"
Load "glx"
Load "GLcore"
Load "v4l"
EndSection
Section "ServerFlags"
EndSection
*****************
Thats about it. Via seems to start to support the linux community, for some interessting reading about this see: Decent Linux Drivers: Seriously, what is going on? you will be shocked. And while we are at it if you already have a via graphics chip and have experienced some linux problem, why don't you sign the petition for decent linux drivers?
Tuesday, March 11, 2008
Object pose estimation
For the chess robots, it would be nice if it could prepare a game off chess from scattered pieces, to be able to do this the robot must know what pieces are what and their orientation in 3D space to grab em.
Also dubbed object picking in 3D.
The Method
The plan is rather simple, Construct a 3D model consisting of few points for each chess piece, segment the silhouttes from the picking scene, fit the constructed model to the silhouttes. The Best fit should be the chess piece.
I assume that there from one image will be lots of problems obtaining a usefull silhoutte, therefore using multiple images and corelating the probability off the recovered models, could be a method for increasing detection rate.
Construction the model.
First silhoutte images was generated of key orientations. Images from the front and the side was acquired off the chess pieces. The silhoutte was segmented using a threshold and a search for the biggest blob. example of segmented knigh given below.

To mark the points of interes, the defining object points, a program to mark the pieces was/are being developed. The program uses OpenGL for the visuals, the planes can be dragged to the best position. Example image given below, also for the knight.

The above image shows the knight approximately aligned and with example points marked. It is not obvious from this image, but when the are rotated it is visible that the scale of the images is not correct right now. Images are currently always stretced to fit a square. Scaling them individually might be a sollution, the question is if I should use the original image sizes or make it possible to scale the images in the program.. Anyhow, on the next picture you can see the problem that the foot is not the same sice of both silhouttes, like they should be.

- Optimized for chess pieces ( variable names in the code )
- Transform the images in their respective planes.
- Scale the images in their respective planes.
- can rotate 3D object
- nice vis using OpenGL custom shader
- Can save/load parameters to/from file
- Zooming ability of head and foot of pieces
Nice to have features:
make it possible to rotate the planes, right now it looks like it is not required, but for feature completness off the programm it would be nice.
Known Bugs:
When an area is zoomed, the intersection of mouse click rays and the planes are wrong.
Initiating Master Project
We are programming two ABB robots model IRB140, so they can play chess against each other. We will use a ready chess engine, and the only communication between the robots will be the vision system.
Update, The robots are gonna play against each other using network communications, but will also play against humans, here we are going to use some image processing. The Report will get uploaded.
Saturday, December 1, 2007
Crossing modals, brain adaption test
Future City
To understand the concept, think that you do not own a house, instead, you own a location, and a configuration amount. The configuration amount + your imagination is the only limit, when you want a house, you comuninicate to your configuration, that it must manifest a given house. If you have more need of a garden, a swimming pool and/or something else, you communicate the wish to your configuration and it obeys.
The idea is now introduced, you might be thinking; crazy idea, how is this possible. it is simple. you own millions of nano robots, which can attach to each other to form inanimate objets at least.
I estimate this is possible in 10-50 years from now.
But I am not sure how we can preserve nature in such a city. ofcourse there could simply be spots of nature enviroment, and small capsules and perhaps a tunneling system where the configarable robots lives, in this way the configuration can manifest where it is needed... and live in harmony with nature.
Friday, October 19, 2007
3d laser scanner
In reality, it is because I am bussy working on a 3D laser scanner with a friend of mine from the school, We have created a blog, right here on blogspot, which we hope to use as a journal for what we have done.
Sunday, October 7, 2007
Fast median image
While reading a paper about 3D object reconstruction, the authors mention that median images would be good to surpress camera noise... They state that thre downside of mediam images are that they are slow to calculate.
I would say... not soo. The update pr. pixel can be made as a O(log(n) ) problem.
if we treat every pixel value as a sorted lost, insertion can ( as far as i remember, be given the complextiy as stated), the rest is straight forward. The reading of a pixel value will be a table lookup -> resulting in a O(1) complexity.
The following defines the interface as I think it shall be.
class MedianImage {
- MedianImage( width, height, filterdepth )
- void Accumulate( x, y, value )
- datatype Get(x,y)
- datatype AccumulateAndGet( x, y, value )
Another possible interesting thing to look at would be the pixelwise variation, a very crude measure of camera noise could be made like this, furthermore, it would be possible to use this information as a simple activity localization.
class StatisticalMedianImage : MedianImage {
- datatype GetVariance( x, y )
One yet undefined thing is what data we choose to throw away when adding pixel values to a full buffered pixel, I propose throwing away the pixel whit the longest distance to the median of that pixel.
I will implement this as soon as possible. now I will sleep.
Saturday, October 6, 2007
Shit vista!
The good thing is that I have installed xp on a partition also now.. sob really looking forward to installing linux...
Wednesday, October 3, 2007
New laptop - It is nice ;)
Actually, I was thinking "I don't need a new laptop", until my old trusted IBM P-IV 1.4 GHz laptop began to have big problems accesing disks attached to the secondary controller. I even tried to revoke my zombi celeron 500MHz Toshiba laptop with a mixed succes... Now it is reminding the audience of an old movie.. The computer shows randomly white stribes on the screen, and sometimes, begin fading to.. white... from outside to the center of the monitor, whery odd, and the machine is frozen while it is experiencing these magical moments...
O.K. enough babling
The new excellent machine is a Fujitsu siemens 2GHz turion64x2 with loads of hd(320GB), 2GB of memory AND: gf8600GT graphics :D. The last was the primary requirement for buying a new pc, since I will now be able to code the GPU in C.
mmmm power.
Machine, full name FUJITSU SIEMENS Xa AMILO 2528, is generally perfoming excelent. the bad part is, that I have not been able to install any linux distributions yet, I think they fail to find the dvd-drive, and thus cannot read the media :(.
Machine ships with Windows vista, which I had sworn I would never get to use, but once again I am beaten by microsoft and the masses, and what can a poor man do... But it runs better that I expected, everything is ALMOST as snappy as with KDE on my P-IV2,4GHz ;).
Now, what have caught me with so amazing surprize, is the bizarre amount of windows vista updates I am downloading and installing. I have activated the baground installation and download of updated, and now, 3 dayes after I bought machine, I still have to wait around 1-2 hours every day on windows shutting down, and windows starting... configuring updates, 1-2 hours every day. way to go microsoft. you have made the fastest machine i have ever had the on average slowst starting device I have ever owned. I will not even coment on the other bizare things vista throws on me. I will instead try to get the most out of the operating system.
And in 3-4 month, I will hand in my assignment, kill vista, liberate the free people and install linux...
luckily there is lot of fun stuff I can use it for, I have installed visual c++ 2008 beta , SDL-development, platform SDK and openGL, next thing I will download is Nvidia's CUDA, and then the fun begins :)
ohh and another fun thin, which I have to share with the world...
Note: "Fuldført" means completed, "Mislykkedes" means failed... If in doubt, this is the log of windows update...

The really funny part is the attemts to update to .NEt 3.0 since visual c++ ships whit .NET3.5...
Sunday, September 30, 2007
Compiling codeblock from svn on ubuntu 7.04
the solution was found here
UPDATE: the wxwidgets which are in the stock ubuntu repositories are buggy, follow the instruction here, if wxwidgets hangs.
Monday, September 24, 2007
VIA Epia EX1000 an installation adventure
Ofcourse I think that being power effecint is excelent so discovering the VIA-epia ex1000, and reading their adds promising that I would both safe the planet, get super effecint computing and doing this fanless, I decided to buy one.
It is important to note that I do, and did not, plan for using this computer for playing games. Mostly I will do write some code, browse the net and sometimes watch a movie and all the time listen to music. This means that the computer doesn't need 8processors, 6GB of rams and ~1TB harddrive ;)-
Here is the wonderfull machine right after unpacking it.
It is clear from the photo that it is actually a very small computer (mini-itx form factor)
The key specs are:
- VIA C7 1GHz processor
- S3-unichrome pro II IGP graphics card
- Fanless
- 17.5 x 17.5 cm footprint
After about 1-hour, I had taken a cd-rom drive from my old computer, a sata-harddrive whit a unused partition and welded a switch for that easy on/off function a computer really needs :).
Sabayon: nogo
My initial try was sabayon which as expected didn't work, sabayon is targeted high-end computers, so I would have been surprised if it worked... to be fair, the sabayon live-cd did a fall-back to a text installer, so I would still be able to do an installation, but sabayon without the graphics is... just wrong :)
Ubuntu + official VIA driversUbuntu on the other hand booted just fine, installing everything goes whitout any problems, and network is working without any problems. The graphics card and sound is a totaly different story, I haven't really worked on trying to get the sound to work yet, but managed after a few days to get the officiel VIA drivers to work, I have never seen so horrible installation instructions... opengl acceleration is with the offcial drivers working fine. but playing movies with mplayer and totem works rather badly, the cpu-usage was arround 60-70% for fullscreen lowres video, and it is supposed to be hardware accelerated according to via's website.
While searching I found the openchrome drivers, so I decided that I would like to try the perfomance of these, since the openchrome drivers are distributed as source, I installed gentoo, then I am sure that the source I have avaliable is the source used to compile the running system.
Gentoo + openchrome drivers
So I installed gentoo, having some problems getting the drivers to work, ( network also works out off the box ). After a day or two + some help from the openchrome user-list, I finaly get X accelerated, that is, there is 2D acceleration, no 3D, and playing video is still as cpu intensive as finding the complete chess game tree...
I still never got sound to work in linux (yet), bt at this point in time, I decided that I really wanted too how the machine really performs, whit fully functionell drivers etc.
Windows XP
sob, I decided to install XP
Installation goes without any problems, out of the box, network works (y), no surprise, I insert the VIA-driver cd, and installs everything.
The EX1000 now features sound, 2D and 3D graphics accelerationd and working composite tv-out for my pal-tv , the s-video out produces black and white pictures, no mater what I select of color type.
Everything seems fine, until I loads a video from you-tube, the machine play's the video at an amazing 3-4fps in fullscreen (1280x1024) and a little faster at (1024x768) still far from usable.
Sample game perfomance - system meltdown.
To do a quick test of 3D, I installed Dungeon Siege II, which I was able to play without problems with my ti-42000. Not so smooth on this machine, with some good will, it could be considered playable, but for some reason the machine crashed from the transiotion from level one to level two, reseting the machine resulted in black screen! All semed very bad, I did shutdown the machine and went to bed, next day the machine wouldn't boot, complaining some file was corrupt, ofcourse, I don't know if this is a faulty disk, or a hot motherboard which issues crazy commands to the disk... I can only speculate, reinstall, and retry. which will be done.
Sound
For now, the machine have overall disappointed me. Thats why I was pleasently surprised by the clear sound comming from the sound card, VIA DO call it HD audio, and altough I don't give much for these kinde of noncense buzz words (I believe in signal to noise ratio ;) ) , I have never heard so noiseless sound from a computer before, This makes me considerable more happy.
Video playback
With the drivers installed and everything, I suspected that the machine would be able to play any kind of movie, playing DVD's is no problem, everything goes smoothly, the processor is working at arround 60-70%. Since the machine has hdtv output (it says so in the bios), I decided that I would try to download some hdtv sample movies, her the perfomance is.... strange I think the correct word is, it seems like everything is playing ok, at least it can play a wmv-720p sample movie, almost whitout problems, and ofcourse there is more delay with a wmv-1080p movie. The strange thin is, that the sound and image is not syncronized... This might be a driver problem...
Overall
I have build a machine, which was supposed to replace my old machine, but to be honest, I am very dissapointed, the machine is simply to slow. Perhaps I was to naive, to think that a 1GHz ulv machine could satisfy my desires. I am currently considering wheter I will use this machine instead of my VHS and dvd, const are mostly slow bootup time, pros are sofa surfing :)
Thursday, September 20, 2007
Energy waste
Happily inserting the device between the socket and my epia, I almost recieved a hard-attack. My old power supply (soon to be replaced) uses a whooping 18W when the computer is turned off !!!!!!!!!
What the hell is this shit, it cannot be true, ok I looked in the manual for the measurement device, and it states that there is one can expect an error on 10-15%, espicially below 60W, still, assuming it is 15% to much it is showing I still waste at least 15W every single minute.
Just thinking, should I now conclude that I have to use the machine all the time to reduce the energy waste ;)
Note: The crappy power supply is a Chieftec HPC-360-202.
//TODO - add a list showing power consumption from my computers given different workload, suggestion are welcome for what I should try
Wednesday, September 19, 2007
Solved ATI problems AX800pro ubuntu
the final error message I zoomed in on after long time was.
From /var/log/Xorg.0.log
(EE) fglrx(0): [agp] unable to acquire AGP, error ""xf86_ENODEV""xf86_ENODEV""
from the kernel (dmesg):
[fglrx] Internal AGP is not supported in 2.6 kernel.
The sollution was found from here:
http://forum.ubuntuusers.de/topic/86634/30/
(even though I don't understand german :) )
This did the trick !
rm -fr /lib/modules/2.6.20-*-generic/kernel/drivers/edac
Ahh on to opengl programming.
Drawing a triangle...

