With the development of modern society, the form and quantity of information is growing rapidly. A large part of it is an image, and the image can present things vividly in front of us, allowing us to accept information more intuitively. At the same time, computers have served as a tool commonly used by people for people's production and life.
Image processing overviewImage processing is a technique that analyzes, processes, and processes images to meet visual, psychological, and other requirements. Image processing is an application of signal processing on the image domain. Most of the current images are stored in digital form, so image processing refers to digital image processing in many cases. This article will briefly introduce the classic algorithms in the field of digital image processing.
Depth-first search algorithm
The method of depth-first traversing the graph (a definition of recursion) is that, given that the initial state of a given graph G is that all vertices have not been accessed, and one vertex i is selected as the initial point of the traversal in G, the depth-first search is performed. A recursive call consists of the following:
(1) accessing the searched neighbor points that have not been accessed;
(2) Mark this vertex as an accessed node;
(3) Searching for the unvisited neighboring points of the vertex, and if the neighboring point exists, the same access and search are performed from the neighboring point.
Depth-first search algorithm implementation:
1. Use the stack to implement. The related algorithm implementation is summarized as:
(1) Push the initial node onto the stack.
(2) While (stack is not empty) {
(3) Take out the stack vertices and temporarily store the node_t information of this node.
(4) Access the node and indicate that it has been accessed.
(5) Put the top element of the stack out of the station.
(6) For (traversing the neighboring unvisited nodes of node_t) {
(7) Put it on the stack.
}
}
Note: Be sure to pop the access node first, then push its neighboring unvisited nodes onto the stack. Remember, no, my previous experience, if there is no neighboring point, it will pop out, otherwise it will not leave the station, but the node is marked as the access node.
2. Use recursion to achieve. The related algorithm implementation is summarized as:
(1) DFS (initial node)
(2) FuncTIon DFS (one node) {
(3) Access the node and indicate that it has been accessed.
(4) For (traversing the adjacent unvisited nodes of the node) {
(5) DFS (this adjacent node).
}
}
The most basic two algorithms in this graph traversal, BFS, DFS, are selected into the top ten algorithms of this graph algorithm, which is undisputed.
Because of these two kinds of search algorithms, the application is widely and important.
For more information on this BFS, DFS algorithm, please refer to:
http://blog.csdn.net/v_JULY_v/archive/2011/01/01/6111353.aspx
Third, A* search algorithmBoth DFS and BFS are blind searches when expanding child nodes, that is,
It does not choose which node is better in the next search and jumps to that node for the next search.
In the case of bad luck, it is necessary to test the complete solution set space. Obviously, it can only be applied to search problems with small problem size.
The A* algorithm, as an important one in heuristic algorithms, is widely used in optimal path solving and some strategy design problems.
The most core part of the A* algorithm lies in the design of its evaluation function:
f(n)=g(n)+h(n)
Where f(n) is the estimate of each possible test point and it consists of two parts:
Part, g(n), which represents the cost from the starting search point to the current point (usually represented by the depth of a node in the search tree).
Part, h(n), represents the most important part of the heuristic search, the current node-to-target node estimate.
More, please refer to:
Classical Algorithm Research Series: I. A* Search Algorithm
Attached:
Flood Fill
LeeMaRS, wtzyb4446:
In the graphics, Flood Fill is filled with water and is used to fill the area.
It's like going to the water in one place, the water will spread all around, until the high ground blocks.
Flood Fill is to search for the same point fill from one point to the next until there are different points.
The Flood Fill we use and this almost principle are a form of BFS.
Suppose that a large drop of red ink is dropped in (i, j), then the water begins to spread, and it is dyed up and down, ie (i-1, j), (i+1, j), (i, j- 1), (i, j+1) these four points. Then, start staining from the four points and then to the surroundings. . . Until I hit a certain boundary.
The idea of ​​converting this to BFS is that the initial element in the queue is (i, j), and then (i, j) is extended to get (i-1, j), (i+1, j), (i, J-1), (i, j+1) These four states are added to the queue. Dequeue (i, j) and continue to expand the next node. in this way
16+ Years Experience Smart Watch manufacturer, ITOPNOO Provide One-stop Smart Wearable devices Solutions For You.
Our Smart Wearable products include android smart watches, Watch For iPhone, Bracelet and Wristband etc.
Leading healthcare navigation services for individuals and families who are generally healthy or face serious medical issues, and health services for employers.
The Trends New Watches Designs. Custom smart watch products designed with the vision of our clients' brands in mind.
Wholesale smart watches,Best Smart Watches,Gifts Wholesalers, smart watch manufacturer
TOPNOTCH INTERNATIONAL GROUP LIMITED , https://www.mic11.com