Domestic embedded DSP experiment box operation tutorial Chuanglong Ordinance 5 12 edge detection

Mondo Technology Updated on 2024-01-29

Learn Xi the principles of Canny edge detection, master how to read images, and display images before and after edge detection on LCD.

In digital images, the edge refers to the most significant part of the local change of the image, and the edge mainly exists between the target and the target, between the target and the background, and is the discontinuity of the local characteristics of the image, such as the sudden change of gray scale, the icon of texture structure, the icon of color, etc. Although the reasons for the edge points of the image vary, they are all points on the graph where the gray scale is discontinuous or the gray scale changes sharply, and the edge of the image is divided into step, slope, and roof.

An edge is actually a collection of points on an image whose gray level changes rapidly. The method of calculation is by way of derivatives and differentiation.

Derivative: The slope of a point on a continuous function, the larger the derivative means the greater the rate of change, and the place with the greater the rate of change is the more "edge", but it is not commonly used in computers, because at a slope of 90 degrees, the derivative is infinite, and it is difficult for the computer to represent these infinite things.

Differentiation: x changes dx on a continuous function, resulting in y changing dy, the larger the dy value, the greater the change, then calculate the differentiation of the whole image, the size of dy is the strength of the edges. Relation of differentiation to derivatives: dy = f '(x) dx.

Canny edge detection is a technique that extracts useful structural information from different visuals and greatly reduces the amount of data to be processed, and is now widely used in various computer vision systems. General criteria for edge detection include:

1) Detecting edges with a low error rate means capturing as many edges in the image as accurately as possible.

2) The detected edge should be precisely positioned in the center of the real edge.

3) The edges given in the image should only be labeled once, and where possible, the noise of the image should not produce false edges.

To meet these requirements, Canny uses the variational method. The optimal function in the Canny detector is described using the sum of the four exponential terms, which can be approximated by the first derivative of the Gaussian function.

Among the commonly used edge detection methods, the Canny edge detection algorithm is one of the tightly defined methods that can provide good and reliable detection. It has become one of the most popular algorithms for edge detection due to its advantages of meeting the three criteria of edge detection and the simple implementation process.

The Canny edge detection operator is a multi-level edge detection algorithm, and the goal of Canny is to find an optimal edge detection algorithm. The meaning of optimal edge detection is:

1) Optimal detection: The algorithm can identify as many actual edges in the image as possible, and the probability of missing the real edge and the probability of falsely detecting the non-edge are as small as possible

2) Optimal positioning criterion: the position of the detected edge point is the closest to the position of the actual edge point, or the degree of deviation of the detected edge from the real edge of the object due to the influence of noise is minimal;

3) One-to-one correspondence between the detection point and the edge point: The edge point detected by the operator should correspond to the actual edge point. To meet these requirements, Canny uses the Calculus of Variations, a method of finding functions that optimize specific functions. The optimal test is represented by four exponential function terms, but it is very close to the first derivative of the Gaussian function.

1) Apply Gaussian filtering to smooth the image with the aim of removing noise;

2) Find the intensity gradients of the image

3) Apply non-maximum suppression technology to eliminate edge false detection

4) apply the method of double thresholds to determine possible (potential) boundaries

5) Utilize hysteresis techniques to track boundaries.

For example, with a double threshold t1 and t2 (t1 t2), a point greater than t2 is definitely an edge, and a point less than t1 is certainly not an edge. The point between t1 and t2, through the edge point that has been identified, initiates a search, the reachable point is the edge, and the unreachable point is not the edge.

In the program process design, the peripheral enablement configuration is first, followed by LCD pin multiplexing configuration and LCD interrupt configuration, then the initialization of the LCD display, and finally the BMP image in the engineering directory is read and processed for edge detection, and the image before and after edge detection is displayed on the LCD.

VLIB is a TI software library that accelerates assay development and improves performance by up to 10x. VLIB is an extensible library optimized for the C6x DSP kernel. The collection of more than 40 cores includes background modeling and subtraction, object feature extraction, tracking and recognition, and low-level pixel processing.

Includes Windows and Linux installation executables for C64X+, C674X, and C66X processors. Each executable installs a component package repository, a documentation directory, an Eclipse plug-in directory, and an extended component directory structure that contains component libraries, header files, and test examples.

The TMS320C6748 processor uses VLIB C674X 3 3 2 0.

Will install to CCS55, and the corresponding folder will appear after the installation is completed. Source code path: vlib c674x 3 3 2 0 packages ti vlib src

The hardware interface used in this experiment is LCD, and the required hardware is an experimental board, a ** device, an LCD and a power supply.

Hardware connections

1) Connect the USB interface of the device and the computer, 2) Turn the DIP switch to debug mode 01111, connect the power supply of the experimental box, and turn the power switch to power on.

Software Operation

To import a project, select the corresponding project in the demo folder.

Compile the project and generate an executable file.

Connect the CCS to the lab box and load the program.

Once the program is loaded, click Run the program.

After running the program, the CCS Console window will print the relevant information, and the LCD will display the title.

After a short period of time, the image processing is complete, and the LCD displays the image before and after the edge detection processing.

After the experiment, click the yellow button to pause the program, then click the red button to exit the connection between CCS and the experiment box, and finally the experiment box can be powered off.

Related Pages