Monday, September 3, 2012

SOCIS - part 4

This post is concerned with a first attempted smoothing implementation incorporated into the POT software.

As mentioned in the beginning, the purpose of this project was to eliminate discontinuities which arose from using the pairwise orthogonal transform. In the previous post we saw how we can have strong variations of the rotation parameter. One approach at solving the discontinuity problem would be to 'smoothen' this parameter. A simple way of doing this is with the formula tNew = 0.875 * tPrev + 0.125 * tCurrent. In this formula we see that the new value for the rotation parameter is biased mostly towards the previous value thus decreasing large variations.

Let's see some comparative images. First without any smoothening:


We've seen this before. The left-most image is the original, the middle image is after applying POT and BIFR (non optimal rate allocation) and the right-most is after applying POT and waterfill. The discontinuities are clearly visible.
Now we have a look at how things improve by using the previous formula:


It's somewhat better, but the discontinuities are still very much there. "VERT" comes from vertical, because the smoothening is vertical, that is the rotation parameters are smoothened according to previous values from the same band.
Notice the variation of the t parameter after smoothing:

Clearly we can do better. For starters, let's see what happens if we increase the smoothing, that is, we change the formula so that we have more bias towards the previous value, to something like: tNew = 0.98 * tPrev + 0.02 * tCurrent.
In this case the images look like this:


Even better, but we still have discontinuities. And what about the t parameter?

We haven't taken into account something, which is the fact that the t parameter is periodic on the interval [-1,1]. This means that if we have a current t value of -0.98 and a previous value of 0.8, then when applying the formula, the actual value we should use for tCurrent should be 1.02 because of the periodicity, to obtain a final result slightly greater than 0.8. Care should be taken so that when situations like this arise the final result is within the [-1, 1] interval. If we correct the formula to take into account this periodicity we obtain the following:


And:

In the BIFR image the discontinuities are still noticeable. There is one more thing we can do and that is to smoothen the means as well. Initially the means for the image looked like this:

After we apply the same smoothing formula (no worries about periodicity this time) we get this:

And our result for the image is:

This time we can say that no discontinuities are visible in either image.

There is still one thing to be fixed in this case and that is an anomaly which can be seen in the image, discontinuities which appear in the northern part. They seem to have appeared after adapting the formula to take into account t's periodicity.


Correcting this shouldn't be a problem.

What comes next is to incorporate the metrics computations into the POT software and adjust the smoothing method accordingly. For now, the formula is fixed/constant. In terms of implementation, the correction can be easily achieved by having a class which specifically handles this sort of things and passing along a references of an instance of this class to all other methods.

No comments:

Post a Comment