• No results found

3-6 Scanning and Drawing of an Image:

As defined earlier an image is nothing but the collection of pixels or dots defining a rectangle. Since a murray scan is a space filling curve, it will pass through each and every pixel in an image recording the colour information and the number of successive pixels with the same colour. Before scanning an

CHAPTER 3. SCANNING AND DRAWING OF THE IMAGES.

image we have to decide the murray radices. Murray radices can be obtained by factorising the x and the y dimensions of an image. Only point to remember is that the product of the x-radices must be equal to the x-dimension of the image and similarly for the y-radices. If the dimensions of an image cannot be factorised then we will use only two murray radices equal to the x and the y-dimensions of an image. The sequence of colour and run length are then coded to minimise the data required to describe the image. The image is usually split into bit planes and each bit plane considered separately as a black and white image (i.e. on or off). In the case of black and white images there is no need for colour information as the run lengths alternate between black and white. However, the first output in the sequence must obey a

convention, usually taken as first run length is white. If the first run length is one of black pixels then a zero is output first. With this information an image can be easily described and thus reconstructed from the run lengths at any required position. For example, the simple rectangular image (Figure 3.4), have been scanned using a murray polygon with x-radix 6 and y-radix 3.

(a) 0.4,3,1.8,1,1 Black

(b)

2,2,4,2,2,2,4

I I

White

Figure 3.4. (a) Here the first runlength is zero since the starting point in the image belongs to the black cell.

(b) Here the first runlength is not zero since the starting point in the imagebelongs to the black cell.

CHAPTER 3. SCANNING AND DRAWING OF THE IMAGES. The collection of runlengths and the murray radices used to scan the image are then stored in the database or in a file and can be used for further processing which we will discuss in the following chapters.

It is assumed that the murray scan will be able to take advantage of any inherent structure in the image. Since the murray scan is moving around in two dimensions a point on the murray scan will have four possible directions to move rather than the standard linear scan with fly back which has only one possible direction to move. The pixels coherence can therefore be exploited in the case of the murray scan than that of standard linear scan with fly back.

Hence a murray scan with its localized scanning patterns has a better chance of capturing a few long runs of pixels of the same value. One could conclude that the murray scan will therefore produce less runlengths than that of the standard linear scan with fly back. But it is not always true. The explanation for this is as follows. Consider a large homogeneous connected color blob with a well defined boundary as shown in Figure 3.5.

CHAPTER 3. SCANNING AND DRAWING OF THE IMAGES.

mm.

Figure 3.5. Boundary point possibilities in the two cases.

a) Murray scan. In case Ml the scan touches the boundary only in one point, whereas in the case of M2 - MS , it touches the boundary either in two points or more.

b) Linear scan . In case LI it touches the boundary in only one point i.e. tangent. In the case of L2 and L3 the bourxfary points are two or more.

Most linear scan run lengths will pass through two of these boundary points for each run corresponding to the entry and exit points of run. There will be exceptions to this case when a horizontal line touches only one boundary point and similarly when a part of the boundary is itself a horizontal line. The

exceptions tend to cancel each other and the number of run lengths is roughly proportional to half the number of boundary points on the blob. In the case of a murray scan these exceptions will be different. Since a murray scan is frequently changing direction there are likely to be more instances when the scan either meets the color blob in just a point or several boundary points and other cases when an internal run meets the boundary and then turns back into the blob thus giving a long run length associated with a particular blob (see Figure 3-5a). Since boundary points are used up in a different way to that of a standard linear scan, the total number of runlength will be affected. Further in the case of a standard linear scan a break of runlength can be a minor advantage in favour of murray scans. Since a murray runlength passing through an interior of a color blob will be long, there will therefore be some long

CHAPTER 3. SCANNING AND DRAWING OF THE IMAGES. runlength associated with a particular color blob and consequently since the total number of runs Is approximately constant in comparison to linear scan with flyback, there will be a large number of short run lengths to compensate for this and thus will have a different distribution to that of a standard linear scan. This distribution may be exploited in a final coding of the run length for storage or transmission. For more detail refer Buntin{1988).

3 6.1 How to draw images using a sequence of runlengths :

Since the runlength sequences are associated with their color, the reconstruction from the runlengths at any required position will be very simple. W e will explain this with the help of an example. The color

information, runlengths, and the murray radices corresponding to an image is given below,

co lo r “> w b w b w b w

runlengths -> 4, 5, 1, 1, 2, 1, 1

x-radices > 3 y-radlces > 5

We will start from the first point i.e., (0,0). Since the first runlength is 4 and is white, we will move four steps in accordance to the scan direction, giving value on (or 1) to these four points. Next runlength is 5 and it corresponds to the black cell, so the next 5 points will get the value o ff( or 0) and so on. The final image Is given in Figure 3.6

1

CHAPTER 3. SCANNING AND DRAWING OF 7VIE IMAGES.

Figure 3.6. Construction of an image from a sequence of runlengths.

The procedure which will draw the image back on the screen using the runlengths is given below. This procedure will take a linked list of runlengths and the murray radices.

I The input are the murray radices and the list of runlengths.

let draw.image = proc(*int r; pntr LIST)