• No results found

Bitmap image format is one of the easiest image file formats to work with because of its simple encoding scheme. Bitmap images are used in this thesis also because the image load and store operations can easily be performed by the file handling operations in C. In this file format, each pixel can hold a number of bits corresponding to the range of colours that the pixel can represent. The bits per pixel stored in a bitmap image can vary from 1 bit for black and white to 32 bits supporting a variety of colours. The bitmap image has a file structure which consists of four different sections - the bitmap file header, the bitmap information header, the color palette table and the image data in pixel arrays as portrayed in Figure 15.

Bitmap File Header Bitmap Information

Color Palette Table

Image Data

Figure 15: Internal file structure of a bitmap image

3.4.1 Bitmap File Header

The composition of bitmap file header according to[51] is depicted in Table 1. The bitmap file header has a size of 14 bytes. The first 2 bytes are constant values that are the header fields used to identify bitmaps. The pair of ASCII values presented in Table 1 are the values specifying Windows bitmap images which are used in this thesis. The next set of 4 bytes is used to store the size of the bitmap image file. The next 2 locations, each of size 2 bytes are reserved bytes. These reserved values depend on the application used to create the image.

42 The last set of 4 bytes in the 14 bytes, determines the offset, which is the starting address of the first byte of image data calculated from the bitmap file header.

Table 1: Bitmap File Header[51] Number of bytes Information stored

2 0X42 and 0x4D values are stored to identify the header

4 Size of the file in bytes

2 Reserved

2 Reserved

4 Offset bytes

3.4.2 Bitmap Information

The bitmap information header as shown in Table 2, as per [51] contains information regarding image dimensions, colour format and the type of compression used for the bitmap. The initial 4 bytes are used for the storage of the bitmap information header size, which is normally 40 bytes. The next set of 8 bytes, stores the bitmap image width and height in terms of pixels respectively in 4 bytes each. The next 2 bytes store the number of planes, which is 1 in our case. The bits per pixel, which indicates the colour intensities of a pixel is stored in the next 2 bytes. Compression type is indicated in the adjacent 4 bytes and the image size in bytes is stored in the 4 bytes next to it.

43 Table 2: Bitmap Information[51]

Number of bytes Information Stored

4 Size of bitmap Info Header

4 Image Width in pixels

4 Image height in pixels

2 Number of planes (always 1)

2 Bits per pixel

4 Compression Scale (0,4,8)

4 Image Size (in bytes)

4 Image Resolution in the X direction (pixel/m) 4 Image Resolution in the Y direction (pixel/m)

4 Number of colour maps used

4 Number of important colours used

3.4.3 Color Palette table

The color palette table section of the bitmap file structure stores information about the blue, green and red colour components for the image. The components depict the intensities of blue, green and red shades in the image considered. The values are retained as zero for the components as this thesis uses grayscale images for the experiments.

3.4.4 Image data

The actual bitmap image data, that is, the pixel values are stored in this section of the bitmap file structure. The values are stored as bytes from left to right in consecutive rows. The pixels are stored form bottom to top in this section of the bitmap file structure. To elaborate, the pixels in the bottom left corner are represented by the first byte and the pixels in the top

44 right corner is stored in the last byte. In this thesis, the image is used as a two dimensional array as it is the easiest way for division of the image into square blocks for enabling data parallelization.

45

Chapter 4

Canny Edge Detection Implementation and NoC

Simulation

There are 3 different implementations of the Canny Edge Detection (CED) algorithm in the scope of this thesis: the sequential, implementation using pure data parallelism and implementation using the mixed parallelism. The sequential implementation executes the instructions sequentially as the name suggests. While the pure data parallelism uses only data parallelization for all the different stages as the name suggests, the mixed parallelization strategy uses a specific type of parallelization for each stage of the algorithm based on the different operations that need to be performed and the data it works on. The first section explores the various coding platforms which were used for the application development taking into consideration the advantages and disadvantages with respect to our final goal. The second section details the implementation of the bitmap image features and parallelization features. The third section gives a brief idea of the important makefiles used in the simulator. Finally, we describe the NoC simulation framework used in this thesis to run all three implementations of (CED).

Related documents