Posts Tagged 'geometry'

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…’

Hough transform experiment part 1

There are times when you post an image like this

to twitter and everyone is like «wtf is that shit», and then you know it requires some explanation, but you just cant be arsed. Well, it’s «long time no post» situation tonight, so here goes that explanation. Continue reading ‘Hough transform experiment part 1’

Midnight Brainfuck

Did you ever tried to imagine what would rotation of impossible rectangle look like? Well, these guys did but, with all due respect, their results are ugly. I thought I could do better than that, so tonight I made this:

(click it to go to my wonderfl code)

CSI zoom to my house

Some days ago I was thinking how to make deep Mandelbrot zoom to run in real time. We already have shallow low-res zooms running in real time, but deep zooms require more and more iterations per pixel, so unfortunately our only way to work around this seems to be to precompute zoom in some way, and then make whole thing to appear as if it was running in real time, i.e. make it interactive. Obvious way to do this would be to seek in zoom video, but what’s the fun in that? Instead, I was looking for some way to zoom in single image, CSI style. Continue reading ‘CSI zoom to my house’

Better three colors gradient

Three colors gradient is not exactly new subject, but known solutions revolving around affine transformation of right triangle have this annoying problem: color interpolation is different on one edge. This problem vanishes if we use barycentric coordinates to  interpolate color:

Check out this new shader and demo source (see also this post for bender-less implementation).

With this better method available, next question is exactly how much better is it. Following Nicolas’ example, I used random delaunay mesh with colored vertices to see how well would different triangles blend. It appears, however, that triangles edges are still easily noticeable, even though colors now match perfectly :( I guess this is unavoidable with independent triangle gradients. Well… something to think about later; two posts per night are more than enough.

Spherize filter

Last night I was thinking of ways to create “fish eye” effect with flash 3D engines, and decided that Pixel Bender is the way to go. However, two things I’ve found on the internet did not make it look the way I wanted, so I ended up creating my own “spherize” filter:

Of course, it is not limited to 3D – you are free to use it in any other way, too. Continue reading ‘Spherize filter’

Old stuff

February 2019
« Jan    

Oh, btw…