PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

The Schwarz Approach to Intelligent Image Scrolling

After reading about the Microsoft Research paper on Pocket PC Thoughts, I couldn't help but write up my own little unscientific method of intelligent image scrolling. I would like to see image viewers in the future incorporate this display mode. It shall be known as the Schwarz Approach, copyright (c) 2003 by Björn Eike Schwarz, who is to be credited in case this approach or a similar one is used. However, there shall be no fee on using this method, so play around with it if you like. Donations are accepted though :).

The Schwarz Approach
by Björn Eike Schwarz

1. The image is internally converted to greyscale. Also internally, it is cut into as many pieces as necessary of 240*320 each. 240*320 is the size of one AUI (Area of Undetermined Interest).
2. An average value is calculated (the greyscale value you would get if you resized to 1*1).
3. Areas with the highest difference to the mean value generated in 2 are found. Clusters of these will be denoted internally as interesting. This will be referred to as "difference".
4. Areas with a high level of detail are found. These are areas in which certain patterns (for example black, white, black) occur multiple times. These areas are denoted as interesting. This will be referred to as "detail".
5. The most interesting areas of the picture are calculated as follows: interest = ((1/3)*difference+(2/3)*detail)/100.
6. The interest for each area will be assigned to it using this scheme. Now the AUI has become a AKI (Area of Known Interest).
7. The full color image is displayed on the screen, at zoom = 100%. The AKI with the highest calculated interest (as described in 5) is in focus. The image now slowly scrolls to the next relevant area. From there it scrolls to the next significant area, and so on. When the last area is reached, the most interesting area is displayed again. Additionally, there may be an option to jump to the next image.
8. The speed of scrolling should be definable by the user. By default it should be set to about 2 seconds per 72 pixels (equalling one inch).
But then what would happen to an image consisting entirely of pure red, green and blue?

Seriously, though, did you actually try this yet? Does it work well?
I did not say what way the image would be converted to greyscale, good point. You, naturally, assumed the dependence on brightness. It would be a good idea to go by hue and saturation too, and incorporating those with percentages as follows:
-50% brightness
-1/3 hue
-1/6 saturation

Thanks for the input.
Err... sorry to be stupid, but how do you calculate the hue and saturation of a pixel?

Oh, and what would difference and detail be set to numerically speaking in order to calculate interest?
Dave Johnston · 31 Aug 2003, 09:03 UTC
damian wrote:
Err... sorry to be stupid, but how do you calculate the hue and saturation of a pixel?

Oh, and what would difference and detail be set to numerically speaking in order to calculate interest?


I had to work out Hue, sat and light from RGB values about 18 months back for a small java thingy. It took ages to find anything on the web!

I cracked it after looking through Usenet topics (there are a few if you look on Google Groups) and some simple understanding:

Hue is easy:
Starts at pure red, then goes into pure green, then pure blue, then back to pure red. The values inbetween are simply interpolated from the two colours either side.

Imagine we have a table of (64*3=)192 values (0-191). Red is at 0, Green at 64, Blue at 128. If we ask for the value at 0, we'd want to get (255, 0, 0). If we wanted the value at 128, we'd get (0, 0, 255). (Image programs often use a table of 180 or 256 values)

The value therefore at 32 is a mix of red and green (255, 255, 0). The value at 16 would be linearly biased to red (255, 127, 0). Notice that at the exact half-way mark, both are at full brightness (255).

I think that's right. I remember getting confused about whether the value at 32 would be (255, 255, 0) or (127, 127, 0) - (255, 255, 0) is the correct one I believe.

As for saturation and lightness, I can't remember :)
This sounds just like data mining on an image. Sure you could do clustering (e.g. k-means) to determine clusters of AUI that are interesting. You could uses SOMs (self-organizing maps) as a way of doing spatial clustering.

The data mining app I helped make could probably do a lot of this. With the data preprocessing feature, you could do a lot of the data massaging (like conversion to greyscale). You could use entropy or similar measures to determine the interestingness of the data. Then you could cluster or SOM it.

If you want to go even further, you could do hardcore data mining on the image, look for patterns, do supervised learning or association mining, etc.