Hacker News new | ask | show | jobs
by akashakya 553 days ago
I did something similar a few years back. I find the Hilbert curve pattern much more interesting.

https://github.com/akash-akya/hilbert-montage

Not an original idea, it was inspired by someone else at that time.

2 comments

Interesting: at first blush, it looks like it's clustered based on image similarity rather than time?

But that must be wrong, the README.md mentions it visualizing time.

I'd love to understand a bit more.

The README.md punts to Wikipedia on Hilbert curves, which is classic Wikipedia, makes sense if you understand it already :) and a 20 minute video on Hilbert curves, which I find hard to commit to, assuming its unlikely it touches on movie visualization via Hilbert curves.

It's definitely hard, and not your responsibility, to explain the scientific concept.

But, I'd love to have your understanding of how the visualization is more interesting.

A Hilbert curve is a mapping between 1D and 2D space that attempts to preserve locality. Two points that are close in 2D space tend to map to two points that are close in 1D space and vice versa.
Tl;dr fancy way to map 1D time to 2D image

If you imagine a movie as a line along the time axis with each frame as a pixel, there are multiple way to create an 2D image.

Bargraph is simple approach, but essentially it is still is a one dimensional. We are only using x axis.

Zig-zag pattern is another approach, where you start from top to bottom, left to right. But in this case the relative distance between close frames aren't fully preserved. Two distant frames might appear together, or close frames might end up far apart, which leads to odd looking artifacts.

Hilbert curve is a pattern to map 1D to fill space (2D) such that relative distance between any two points (frames) on the 1D line is somewhat preserved. That's why it appears as clump/blob.

Here it is hard to see the movie progression from start to end but all frames from a scene are always closer, which was what I was aiming. I find it interesting that visual aspect (color/scene) is easy to see here but temporal aspect isn't.

I was excited about the whole 1D to 2D mapping aspect at that time, leading to this toy.

Another good example of hilbert curves as visualization is this online bin file analyzer:

https://binvis.io/#/view/examples/elf-Linux-ARMv7-ls.bin

Nice project and thanks for all your work maintaining vix!