Development of Fixed-point Canny Edge Filter Operation for High-level Synthesis

Hardware implementation of the image processing is important for embedded systems to achieve a high performance and low power. However, the hardware design has high design load. High-level synthesis (HLS) is a technology for automatically converting high level language programs into the hardware language programs. The HLS can make the load of hardware design low. Generally we develop the image processes software using floating-point number. When converting the software using floating-point number to the hardware module, the hardware size and power consumption become large and the operation speed becomes low generally. Thus, the fixed-point software which HLS can convert is needed to acquire the efficient hardware module. The canny edge filter is one of frequently used image processes to detect the edge on the image. In addition, the canny edge filter consists of the promising primitive image processes to be used generally. Thus, we develop a canny edge filter with fixed-point number for HLS. The experiment compares hardware modules using fixed-point number and float-point number respectively. The results show that our fixed-point program can be converted by HLS to the efficient hardware module with smaller size and higher operation speed than the floating-point one.


Introduction
Embedded systems have to support sophisticated image processing while they have to achieve a high performance and low power consumption.Thus, the hardware implementation of image processing is very important for the embedded systems.
However, the hardware design has high design load since it requires designing a high level language expressing the algorithm, developing an HDL program expressing the behavior of the hardware and performing a clock-cycle based operational verification.Thus, the high-level synthesis (HLS) technology automatically converting software in C language into the hardware in hardware description language (HDL) has been researched and developed (1)(2)(3) .
Generally we develop the image processes software using floating-point number.When converting the software using floating-point number to the hardware module, the hardware size and power consumption become large and the operation speed becomes low generally.Thus, the fixed-point software which HLS can convert is needed to acquire the efficient hardware module.Thus, we are developing the fixed-point math elementary functions with compatibility to the math library, which can be converted to the efficient hardware module (4) .
The canny edge filter (5) is one of frequently used image processes to detect the edge on the image.In addition, the canny edge filter consists of the promising primitive image processes to be used generally.Thus, we develop a canny edge filter with fixed-point number for HLS including several generic image processes that can also be converted to each hardware module.In developing, we reuse the fixed-point math library which we have developed.
The rest of the paper is organized as follows.…

Canny Edge Detector Algorithm
The canny edge filter consists four processes.First process is to remove a noise by smoothing the image.This process prevents detection of an unnecessary edge.Second DOI: 10.12792/iciae2015.109process obtains the edge intensity and the gradients' direction.Third process is a line thinning.This process uses the gradients' direction that is calculated by second process.Final process judges the edge.

Floating-point Program
First, we describe canny edge filter in floating-point.In smoothing process, we use the kernel of 5×5.This kernel is shown in Fig. 1.This process performs convolution operation to the each pixel.
Second, the sobel filter obtains the edge intensity and the gradients' direction.The sobel filter performs the 3×3 convolution filter horizontally by using the kernel shown in Fig. 2 (a).Then, the 3×3 convolution filter using the kernel shown in Fig. 2 (b) is performed.The value generated by the former process is x and the value generated by the latter process is y.The edge intensity is calculated by Eq.1.Gradients' direction (tan) is able to calculate by Eq.2.
√ 2 +  2 (1) Third, the line thinning process is performed.The line thinning process uses non-maximum suppression.This process uses the gradients' direction (tan) that is calculated by Sobel filter.By using the tan, directions are categorized into 0 degree, 45 degree, 90 degree, 135 degree.Three pixels of each direction are compared.As a result, the pixel with the maximum value is left.Fig. 3 shows the pseudo code of Non-maximum suppression process.The lines of 1 to 5 indicate that the direction is 0 degree.At the lines of 2 to 4, the value of pixel is 0 when the center pixel (pixel [5]) is not biggest value in three pixels.Similarly, the lines of 6 to 10 correspond to the direction of 45 degree.The lines of 11 to 15 mean the direction is 90 degree.The lines of 16 to 20 show the direction is 135 degree.
Fourth, the process to judge the edge uses hysteresis  threshold process.Fig. 4 shows a pseudo code of hysteresis threshold process.This process uses two threshold that high value and low value.If the value of pixel is bigger than high value, the pixel is edge.If the value of pixel is smaller than low value, the pixel is not edge.Moreover, if the value of pixel is high value between low value, the pixel is edge when the adjacent pixel is edge.

Fixed-point Program
We convert the floating-point canny edge filter into the fixed-point version.In smoothing process, many multiplication and division are used by performs convolution operation of Fig. 1.However, the multiplication and division make hardware size larger.In contrast, the sift operation can be realized by small hardware.Therefore, the kernel is changed to use only sift operations.The approximated kernel is shown in Fig. 5.
However, process image become darkened about 64%.We have to change voluntarily the value of threshold in hysteresis threshold process.
Moreover, Sobel filter process is involved square root operation.We use fixed-point square root operation library (4) .

Experiment and Consideration
We performed HLS to our fixed-point Canny edge detector program by Xilinx Vivado HLS tool to Xilinx FPGA.Used FPGA is zynq.Likewise, we performed HLS and implemented at FPGA for the floating-point Canny edge detector program as a compared target.Fig. 6 to 11 show the result about the number of used registers，the number of used LUTs, minimum period ， maximum frequency，the number of clocks, minimum execution time.
As the result shown in Fig. 6, the number of used registers of fixed-point program decrease 76% compared with floating-point program.The result shown in Fig. 7, the number of used LUTs of fixed-point program decrease 74% compared with floating-point program.Therefore, hardware using our Canny edge filter is able to small compared with hardware using floating-point.
As the result shown in Fig. 8 to 9, fixed-point program is able to short crock period 20% compared with floating-point program.The result shown in Fig. 10, the number of used crocks of fixed-point program decrease 22% compared with floating-point program.As a result in Fig. 11, minimum execution time of fixed-point program is shorter 38% than floating-point program.Therefore, processing speed our Canny edge filter is able to fast compared with hardware using floating-point.
Moreover, Fig. 12 shows two Canny edge detector images by fixed-point program and floating-point program.As you can see, there are a few differences of two images.

Conclusions
We have developed C programs the fixed-point Canny edge filter is able to be HLS.We have proven that hardware size decrease 76% as compared with floating-point program through the logic simulation and implementation experiment at FPGA.Therefore, we have been able to decrease 33% in the execution time.
As a result, we have developed highly useful hardware of fixed-point canny edge filter that is able to be converted by HLS.
As future work, we will propose efficiency index of the process that include multiple processing.