Archive for October, 2010

Inverse homography using drawTriangles()

Flash player version 10+ native drawTriangles() method is perfect for programming homography (2D transformation that preserves lines) because of its support for UVT data. In general case, however, homography requires solving 8×8 linear equations system, so noone can be arsed to code that. Instead they implement one of two special cases – mapping rectangle to or from quadrilateral. So far, only 1st case was implemented using drawTriangles, while 2nd case was done using filters. Well, no longer so – it turned out, inverting T values in Zeh code was sufficient to make it work backwards:

One interesting thing about this code is that noone really knows exactly how it works :) I didn’t have to study all the math behind Zeh code in order to “invert” it, and Zeh… well, let me quote:

I was lucky enough to get what I wanted working after a good amount of crazy trial and error (and beer)

Advertisements

Improving marching squares

Right. Today is the day of improving 2×2 marching squares flavor described in wikipedia. A year ago Sakri Rosenstrom found that it is flawed:

As you can see, two checkerboard-like patterns are ambiguous, but the algorithm ignores it, causing random deadlocks as a side effect. So I tried to find some solution to this by posting the problem at wonderfl; and then I just couldn’t wait :) Well, my solution uses 2 to 4 pixels out of 2×2 window and seems to work on crazy images, so I’m happy. But if you suddenly find some better way, let me know.

Hough transform thing continues…

Previously on «Hough transform»: brave lone coder decides to explore random line detection algorithm; he splits the experiment in parts roughly corresponding to pixel bender kernels that he needs to write; he writes a post with many words that noone reads, and shares the demo that noone finds impressive.

Well, just so that you know, the experiment continues, and the demo is a bit better now:

Continue reading ‘Hough transform thing continues…’


Old stuff

October 2010
M T W T F S S
« Sep   Nov »
 123
45678910
11121314151617
18192021222324
25262728293031

Oh, btw…