DISTRITO DE TICLACAYÁN, PROVINCIA DE PASCO
ANTECEDENTES DE ESTUDIOS:
we have to process the list, (for example if we have to scale the image we need both WHITE and BLACK cells), the W HITE cells can be obtained using the information stored in the BLACK cells.For example in Figure 4.4, consider the second cell. The runlength is equal to 10(say r1) and Sum is equal to 30(say s1). Suppose now we want to find the W HITE cell proceeding it. From the first cell the runlength is equal to 5(say r2) and Sum is equal to 0(say s2). We use the first two cells to find the W HITE cell in between. The runlength for this W HITE cell will be equal to s1 -s2 -r2 and the Sum will be equal to s2 +r2. Similarly for other W HITE cells.
10 29 b
k 4 73 b /
Figure 4.4. New list obtained after removing
the iist"given in Figure 4.3. the WHITE cells from
The third item in our data structure is the colour information. This colour information can be removed by assuming that the first cell will always corresponds to the white cell. But in some cases where we need to move
inside the list, this information will be of great help. We will see this in the next chapters. Since same list is used for different operations, therefore all the list in the database have the colour information for each cell.
The left pointer helps in increasing the mobility inside the list. For example consider the list given below,
CHAPTER 4. SCAN CONVERSION AND SCALING OF IMAGES.
5 -1 w / 10 29 b 5 59 W > 4 64 b
1 __________
Temp. Pointer ( T )
Suppose our temporary pointer is at the second cell as shown above. If the colour for that cell has changed to ”w" then we need to add the two
neighbouring W HITE cell to that to form a single cell. Using the left pointer we can go to the left cell. The three cells can then be merged together to form a single cell.The pointer can be changed thereafter, see below.
This pointer to be changed
20 59 64 b
This pointer toWchanged Temp.Polnter ( T )
Initially the Temp.Polnter was at the 2nd cell(see above). By using the command T = T(left), the Temp.Polnter will now point at the 1st cell. The runlength for the first cell will now be equal to the sum of the runlengths of the three cells i.e., 20. Sum for this cell will be -1. The link next will now point at the 4th cell and the left pointer of the cell will now point at the 1st cell (shown dark).
4-3.2 Scanning ;
Here an image Is taken, which is stored In the database and then using murray polygons either horizontal or vertical, we scan the whole image. The collection of runlengths and the murray radices used to scan the image are then stored in the database.The procedure to store an Image or a list in a database is given in chapter 3. Before the scanning is done we have to decide about the murray radices to be used.
CHAPTER 4. SCAN CONVERSION AND SCALING OF IMAGES.
To get the murray radices, we need to know the dimensions for the image. Generally the dimensions for an image are known to us but if not then the standard function X.dim and Y.dim (see PS-algol[Carrick, Cole, and
Morrison(1987), and Morrison(1988)], can be used to get the x and the y dimensions of an image. Once we know the x and the y dimensions, murray radices can be defined. The only point to remember is that the product of the x-radices should be equal to the x dimension of the image. Similarly for the y-radices.
4-3.3 Algorithms :
Here two algorithms, one which uses method 1 and the other which uses method 2, are given.The results obtained by both the algorithms on different images are compared and are given in the next section. The two procedures corresponding to two lemmas (i.e., lemma 3 and Iemma4), described above are given below, “
! This procedure finds the corresponding points in a tile. I The Input is the ith point given on scant and the x and I the y dimensions for the tile.
let pnt.ln.scan2 = p ro c (in t l,n,m > int)
begin
le t y := I d iv n
le t X := If y rem 2 = 0 then i rein n else n-1-(i re m n) let z := if X rem 2 = 0 th en m*x+y
e ls e m *x+m -1-y
I '
2 I the corresponding point on the second scan is z. end
CHAPTER 4. SCAN CONVERSION AND SCALING OF IMAGES.
I This procedure finds the corresponding points in a block having ! smallest tile of size x-dimension * y-dimensions.
I The input is the ith point given on scant and the murray radices. I The vector Fix are the sizes of the corresponding blocks, e.g. I Pix(t) = r-\*T2, Pix{2) = rg^r^ and so on.
I The vector block gives the position of the point in an image.
I The vector mult.factor gives the point x-|,X2, .... (see sec 4-2.2, Iemma2) let scan.conversion = proc(*int r,Pix,block,mult.factor;int i > pntr) begin
le t j := 1;let C := i
fo r i = upb(Pix) to 1 by -t do I This statement will give the
{block(j) :=i div Pix(i) I position of the point relative to the i := i-Pix(i)*block(j) I blocks of sizes Pix(i) .
] := j+1} j:=1
fo r i = upb(r)-1 to 3 by -2 do I It gives the point x i,X2, ... {m ult.factor(j):=p nt.in .scan2(block(j),r(i),r(i+1))
iH + 1 }
le t tile.start.pnt := 0; let x:=0 ]:=1
fo r i = upb(Pix) to 1 by -1 do I This gives value A. {tile.start. p n t:=tile.start.p n t+ b lo ck(j)*P ix(i)
x:=x+Pix(i)*m ult.factor(j) jH + 1 } le t y := C-tile.start.pnt let z := pnt.in.scan2(y,r(1),r(2)) let M := x+z end
Theory :
The algorithm takes a list of runlengths which has been stored in the database.lt will deal only with the runlengths and secondly it deals only with the black cells. Time and space is saved by not considering the white cells.
CHAPTER 4. SCAN CONVERSION AND SCALING OF IMAGES.
Let ri,rg be the murray radices. The number of points in a image will then be given as the product of all murray radices, i.e.,
no.of.plxels = r^ *rg* *rn
We are interested in finding the runlengths corresponding to another scan. Initially we will assume that the linked list (say list.2) for scan2 has only one cell with the runlength equal to the number of pixels in an image. Sum equal to zero and the color for all the pixels is white i.e.,'’w". From the linked list which is obtained after scanning the image in the horizontal direction i.e. scant, we look for those cells which are black in color. Since we have the record for the number of pixels used before that cell i.e.. Sum, we can easily find the start point for that cell and the number of pixels of that color i.e., runlength. Using either of the two methods discussed above, depending upon the scan used for scanning the image, the corresponding point on the second scan can be determined. Lemma 3 is used when our whole image is
represented by a single block i.e., we scan the image using a linear horizontal murray scan. When the image is represented by a collection of small tiles, we
use Lemma 4. For each black point we will find the corresponding point in the
CHAPTER 4. SCAN CONVERSION AND SCALING OF IMAGES.