Hardware resource allocation optimization method and system based on AprilTag
By adopting downward search strategy and path compression strategy in the hardware resource allocation optimization method of AprilTag tag, the problem of inefficiency of traditional methods when dealing with cross-row pixel connectivity relationships is solved, and more efficient hardware resource allocation and reduced memory usage is achieved.
Patent Information
- Application Number
- CN202510373126.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-24
AI Technical Summary
The traditional hardware resource allocation optimization method based on AprilTag tag lacks effective strategies when dealing with connectivity relationships across row pixels, resulting in increased memory usage and inefficient processing.
A downward search strategy is adopted. When the pixel value of the point is equal to the pixel value below, not only will the conventional connection domain analysis be performed, but the parent node of the corresponding pixel in the previous row is also pointed to the current pixel in the next row, reducing the comparison and judgment of cross-row pixels, and using a path compression strategy to reduce the recursion depth and search time.
It improves the efficiency of handling the connectivity relationship between cross-row pixels, reduces the use of hardware resources, avoids multiple backtracking and comparison processes in traditional methods, and improves the search efficiency.
Smart Images

Figure CN120198273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a hardware resource allocation optimization method and system based on AprilTag tags. Background Art
[0002] In the field of computer vision and image processing, connected domain analysis is a crucial basic technology, which is widely used in target detection, image segmentation, feature extraction and other aspects. Among them, AprilTag is a visual tag widely used in robot navigation, augmented reality, industrial automation and other fields. Its accurate recognition and analysis cannot be separated from the efficient hardware resource allocation optimization method based on AprilTag.
[0003] Traditional hardware resource allocation optimization methods based on AprilTag tags are mainly based on classic algorithms, such as two-pass scanning and recursive methods. The two-pass scanning method usually requires two complete scans of the image. In the first scan, a temporary label is assigned to each connected area, and in the second scan, areas with the same connectivity are merged into the same label. The recursive method determines the connected area by recursively checking adjacent pixels.
[0004] The traditional hardware resource allocation optimization method based on AprilTag lacks an effective strategy when processing the connectivity relationship of pixels across rows. When processing two adjacent rows of pixels, it is usually necessary to retain the complete data of the previous row for comparison and merging with the current row, which further increases the memory usage. Therefore, the present invention proposes a hardware resource allocation optimization method and system based on AprilTag. Summary of the invention
[0005] In order to solve the above technical problems, a method and system for hardware resource allocation optimization based on AprilTag tags are provided to solve the above problem of lack of effective strategies.
[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is: A hardware resource allocation optimization method based on AprilTag tags, comprising: S10, obtaining an image to be processed; S20, scanning the image to be processed and constructing a pixel matrix; S30, processing the pixel matrix according to the pre-algorithm of AprilTag to obtain a reconstructed pixel matrix; S40, obtaining a connected area according to the reconstructed pixel matrix; S50: Obtain a processed image based on the connected area.
[0007] Preferably, the steps of scanning the image to be processed and constructing a pixel matrix are as follows: S21. Scan each pixel point in the image to be processed to construct a pixel matrix; S22. Taking the lower left corner of the pixel matrix as the origin, the direction along the length of the pixel matrix from the origin is the x-axis direction, and the direction along the width of the pixel matrix from the origin is the y-axis direction to construct an xy coordinate system, and the scale of two adjacent pixel points on the coordinate axis is 1; S23. Use the pixel information of each pixel point to supplement the information of each point in the pixel matrix.
[0008] Preferably, the steps of processing the pixel matrix according to the preprocessing algorithm of AprilTag and obtaining a reconstructed pixel matrix are as follows: S31. Perform grayscale processing on the image to be processed; S32. Calculate the gradient magnitude and direction of each pixel; S33. Construct a first threshold according to the pixel value, and screen the gradient magnitude according to the first threshold; S34. Track adjacent edge points along the gradient direction to form continuous edge segments; S35. Obtain the pixel values of each point after multi-step processing, replace the pixel matrix, and obtain a reconstructed pixel matrix.
[0009] Preferably, the steps of obtaining a connected domain according to the reconstructed pixel matrix are as follows: S41. Extract the pixel values of each point in the reconstructed pixel matrix; S42. Construct a second threshold; S43. Compare the pixel value with the second threshold; S44. If the pixel value of this point is equal to the threshold, there is no need to perform connected domain analysis, and assign 0 to its root node; S45. If the pixel value of this point is not equal to the second threshold, connected domain analysis is required; S46. Obtain the connected domain according to the connected domain analysis.
[0010] Preferably, the steps of obtaining a connected region according to the connected domain analysis are as follows: S461. Compare the pixel value of this point with the pixel value on the left; S462. If the pixel value of this point is not equal to the pixel value on the left, compare downward and construct a connected domain; S463. If the pixel value of this point is equal to the pixel value on the left, obtain the left root node of the left pixel point; S464. Obtain the left parent node of the left pixel point and compare it with the left root node; S465. If the left parent node is the same as the left root node, continue to read with the left root node as the address; S466. If the left parent node is different from the left root node, continue reading with the left parent node as the address, and perform path compression during the reading process to directly point the parent node of the intermediate node to the root node; S467. Scan the connected region after the scanning loop stops.
[0011] Preferably, if the pixel value of this point is not equal to the left pixel value, compare downward, and constructing the connected domain includes the following steps: S4621. Extract the pixel value below this point and compare it with the pixel value of this point; S4622. If the pixel value of this point is not equal to the pixel value below, mark it as an independent region and directly output; S4623. If the pixel value of this point is equal to the pixel value below, obtain the lower root node of the pixel point below; S4624. Obtain the lower parent node of the pixel point below and compare it with the lower root node; S4625. If the lower parent node is the same as the lower root node, use the lower root node as the address and loop through the connected domain analysis. At the same time, point the parent node of the corresponding pixel in the previous row to the current pixel in the next row until the loop stops; S4626. If the lower parent node is different from the lower root node, continue reading to the left with the lower parent node as the address, loop through steps S464 - S467, and at the same time point the parent node of the corresponding pixel in the previous row to the current pixel in the next row.
[0012] Preferably, obtaining the processed image based on the connected region includes the following steps: S51. Extract the root node of the connected region; S52. Obtain the number of connected domains within the connected region; S53. Obtain the stored data based on the number of connected domains; S54. Re - replace the pixel values of the connected region according to the stored data; S55. Generate the output image based on the replaced pixel values; Among them, the calculation formula for the stored data is:
[0013] In the formula, is the stored data, is the number of connected domains within the connected region.
[0014] Preferably, a hardware resource allocation optimization system based on AprilTag tags is proposed to implement the above - mentioned hardware resource allocation optimization method based on AprilTag tags, including: Control module: The control module is used for data transmission within the system; Image acquisition module: The image acquisition module is used to acquire images to be processed; AprilTag module: The AprilTag module is used to pre-process the image; Data storage module: The data storage module is used to store data in the system; Data conversion module: The data conversion module is used to extract the data in the storage module and convert it into pixel values; Image generation module: The image generation module generates corresponding pictures according to system data.
[0015] Compared with the prior art, the advantages of the present invention are: by adopting a downward search strategy, when the pixel value of the point is equal to the pixel value below, not only the conventional connected domain analysis is performed, but also the parent node of the corresponding pixel in the previous row is pointed to the current pixel in the next row, which is more efficient in processing the connectivity relationship of cross-row pixels and avoids the process of multiple backtracking and comparison required by traditional methods. When processing the current row of pixels, if it is found that there is a connectivity relationship with the pixels in the previous row, the parent node of the pixels in the previous row is updated to the corresponding pixel in the current row. In subsequent processing, the transmission relationship of the parent node can be directly used to quickly determine the connectivity of the cross-row pixels without the need to repeatedly compare and judge the pixels in each row, which effectively solves the shortcomings of the traditional method in cross-row processing. When recursively searching for the root node, a path compression strategy is adopted to directly point the parent node of the intermediate node to the root node. When the root nodes of these nodes are searched again in the future, the root node can be directly found, which reduces the recursive depth and search time, improves the search efficiency, and forms an effective connectivity strategy based on this method to reduce the usage of hardware from the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a hardware resource allocation optimization method based on AprilTag tags and a flow chart of steps S10-S50 in the system proposed by the present invention; Figure 2 A schematic diagram of a hardware resource allocation optimization method based on AprilTag tags and a flow chart of steps S21-S23 in the system proposed by the present invention; Figure 3 A schematic diagram of the process of steps S31-S35 in a hardware resource allocation optimization method based on AprilTag tags and a system proposed by the present invention; Figure 4 A schematic diagram of a hardware resource allocation optimization method based on AprilTag tags and a flow chart of steps S41-S46 in the system proposed by the present invention; Figure 5Flow diagram of steps S461 - S467 in an optimization method and system for hardware resource allocation based on AprilTag tags proposed by the present invention; Figure 6 Flow diagram of steps S4621 - S4626 in an optimization method and system for hardware resource allocation based on AprilTag tags proposed by the present invention; Figure 7 Flow diagram of steps S51 - S55 in an optimization method and system for hardware resource allocation based on AprilTag tags proposed by the present invention; Figure 8 Block diagram of an optimization method and system for hardware resource allocation based on AprilTag tags proposed by the present invention. Detailed implementation
[0017] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art can think of other obvious variations.
[0018] Refer to Figure 1-8 As shown, an optimization method for hardware resource allocation based on AprilTag tags includes: S10. Obtain the image to be processed; S20. Scan the image to be processed and construct a pixel matrix; S30. Process the pixel matrix according to the pre - algorithm of AprilTag to obtain a reconstructed pixel matrix; S40. Obtain the connected regions according to the reconstructed pixel matrix; S50. Obtain the processed image according to the connected regions; Those skilled in the art can understand that an image is essentially composed of numerous pixel points. By scanning each pixel point in the image and constructing a pixel matrix based on the position and pixel value of the pixel points, the image data can have a structured feature, which is convenient for subsequent algorithm operations. The pre - algorithm of AprilTag includes steps such as grayscale processing, gradient calculation, threshold screening, and edge tracking. Grayscale processing can reduce the complexity of the image and reduce the interference of color information; gradient calculation can find the regions where the pixel values change drastically in the image, that is, the edge parts; threshold screening can remove noise and unimportant details and enhance the edge features, which helps to improve the clarity of the subsequent generated image. By obtaining the connected regions, it is convenient to uniformly replace the connected domains with the same pixel value. Replace the pixel values of the connected regions according to the number of connected domains within the connected regions, so as to perform connected domain analysis and processing on the image.
[0019] Such as Figure 2As shown, the steps of scanning the image to be processed and constructing a pixel matrix are as follows: S21. Scan each pixel point in the image to be processed to construct a pixel matrix; S22. Taking the lower left corner of the pixel matrix as the origin, the direction along the length of the pixel matrix from the origin is the x-axis direction, and the direction along the width of the pixel matrix from the origin is the y-axis direction to construct an xy coordinate system, and the scale of two adjacent pixel points on the coordinate axes is 1; S23. Use the pixel information of each pixel point to supplement the information of each point in the pixel matrix; Those skilled in the art can understand that by scanning the image to be processed, obtaining the information of each pixel point in the image, and setting the scale of two adjacent pixel points on the coordinate axes to 1, a unified measurement standard is provided for the image, reducing the subsequent processing steps. Each pixel point contains certain pixel information. Using this information to supplement the pixel matrix can ensure the integrity and accuracy of the pixel matrix. The complete pixel matrix provides more information for subsequent image processing, which helps to improve the processing effect.
[0020] As Figure 3 shown, the steps of processing the pixel matrix according to the preprocessing algorithm of AprilTag and obtaining a reconstructed pixel matrix are as follows: S31. Perform grayscale processing on the image to be processed; S32. Calculate the gradient magnitude and direction of each pixel; S33. Construct a first threshold according to the pixel value, and screen the gradient magnitude according to the first threshold; S34. Track adjacent edge points along the gradient direction to form continuous edge segments; S35. Obtain the pixel values of each point after multi-step processing, replace the pixel matrix, and obtain a reconstructed pixel matrix; Those skilled in the art can understand that a color image usually contains information in three channels: red, green, and blue. Grayscale processing converts the color image into a grayscale image with only one channel, which can reduce the data volume and the computational complexity of subsequent processing. At the same time, through grayscale processing, the color information is removed, enabling focus on the brightness information of the image, which is more conducive to highlighting the structure and features of the image. Calculating the gradient magnitude and direction of each pixel can effectively detect the edge positions in the image. Pixel points with a larger gradient magnitude often lie on the edges, and the gradient direction indicates the orientation of the edges. After the first threshold screening, there may be some breakpoints in the edges. Discontinuous edges are not conducive to subsequent connected component analysis and target recognition. By tracking adjacent edge points, the complete edges of the target objects in the image can be accurately extracted. After multiple steps of processing such as grayscale processing, gradient calculation, threshold screening, and edge tracking, the pixel information in the image changes. The pixel values of each point after multiple steps of processing are used to replace the original pixel matrix, and the processed results can be reflected in the new pixel matrix.
[0021] As Figure 4 shown, the steps for obtaining the connected components based on the reconstructed pixel matrix are as follows: S41. Extract the pixel values of each point in the reconstructed pixel matrix; S42. Construct a second threshold; S43. Compare the pixel value with the second threshold; S44. If the pixel value of this point is equal to the threshold, no connected component analysis is required, and its root node is assigned a value of 0; S45. If the pixel value of this point is not equal to the second threshold, connected component analysis is required; S46. Obtain the connected components based on the connected component analysis; Those skilled in the art can understand that by extracting the pixel values in the reconstructed pixel matrix and making independent judgments and processing for each pixel, the value of the second threshold is set to 127. If the pixel value is equal to 127, its root node is assigned a value of 0, which is equivalent to marking these pixels to indicate that they do not belong to any meaningful connected component and the output is gray. The root node represents the identifier of a connected component. By obtaining the root node, it is possible to quickly determine the connected component to which the current point belongs. Pixel points with pixel values not equal to the first threshold are considered likely to belong to the target area, and connected component analysis is required to determine their connectivity relationship. Connected component analysis is a process of combining connected pixel points into a whole. Through this analysis, the individual connected components in the image can be accurately obtained. These connected components correspond to different target objects in the image. By obtaining the connected components, the target can be separated from the background to achieve target extraction.
[0022] As Figure 5As shown, the steps for obtaining the connected region based on connected component analysis are as follows: S461. Compare the pixel value of this point with the pixel value on the left; S462. If the pixel value of this point is not equal to the pixel value on the left, then compare downward and construct a connected component; S463. If the pixel value of this point is equal to the pixel value on the left, then obtain the left root node of the left pixel point; S464. Obtain the left parent node of the left pixel point and compare it with the left root node; S465. If the left parent node is the same as the left root node, then continue reading with the left root node as the address; S466. If the left parent node is not the same as the left root node, then continue reading with the left parent node as the address; S467. Scan the connected region after the scanning loop stops; Those skilled in the art can understand that when performing connected component analysis, it is necessary to determine whether adjacent pixel points belong to the same connected region. Comparing the pixel value of the current point with the pixel value on the left is a simple and effective preliminary judgment method. If the two pixel values are the same, it indicates that they may belong to the same connected component; if they are different, they may belong to different connected components. When the pixel value of the current point is different from the pixel value on the left, it means that the current point and the pixel point on the left do not belong to the same connected component. At this time, it is necessary to compare downward to find other pixel points that are connected and have the same pixel value as the current point. When the pixel value of the current point is the same as the pixel value on the left, it means that they may belong to the same connected component. Obtaining the left root node of the left pixel point is to utilize the connected information that has been analyzed previously. In the union-find data structure, the root node represents the final identifier of a connected component, while the parent node is used to record the connection relationship between nodes. By obtaining the left parent node of the left pixel point and comparing it with the left root node, it can be verified whether the connection relationship of the current connected component is correct. In some complex images, there may be complex connection relationships between multiple pixel points. By comparing the parent node and the root node, these complex situations can be accurately processed to ensure the accurate division of the connected component. After a series of comparison, analysis, and update operations, when the scanning loop stops, all pixel points have been analyzed and divided into the corresponding connected components. At this time, the obtained connected region is the final result of the connected component division.
[0023] As Figure 6 shown, the steps for comparing downward and constructing a connected component when the pixel value of this point is not equal to the pixel value on the left are as follows: S4621. Extract the pixel value below this point and compare it with the pixel value of this point; S4622. If the pixel value of this point is not equal to the pixel value below, mark it as an independent region and output directly; S4623. If the pixel value of this point is equal to the pixel value below, obtain the lower root node of the pixel point below; S4624. Obtain the lower parent node of the pixel point below and compare it with the lower root node; S4625. If the lower parent node is the same as the lower root node, use the lower root node as the address and perform looped connected component analysis until the loop stops; S4626. If the lower parent node is not the same as the lower root node, use the lower parent node as the address and continue to read left, looping through steps S464 - S467; Those skilled in the art can understand that by extracting the pixel value below the current point and comparing it with the pixel value of this point, it is possible to determine whether these two pixel points belong to the same connected component in the vertical direction. This comparison result will determine whether the current point and the pixel point below are grouped into the same connected component for further analysis, or whether the current point is marked as an independent region, providing an important basis for judgment for subsequent connected component construction operations. When the pixel value of the current point is different from the pixel value below, it means that the current point is not connected to the pixel point below. At this time, the current point is marked as an independent region, which can separate the non - connected parts in the image and accurately segment different target regions, facilitating subsequent separate analysis and processing of each independent region. When the pixel values of the current point and the pixel point below are the same, it indicates that they may belong to the same connected component. Obtaining the root node of the pixel point below is to utilize the connected information obtained from previous analysis. Using the lower root node as the address to continue the connected component analysis can incorporate the current point and related connected pixel points completely into this connected component. Through loop operations, the scope of the connected component is continuously expanded until all relevant pixel points have been analyzed, ensuring the integrity of the connected component. When the lower parent node is different from the lower root node, it indicates that the connection relationship of the current connected component may need to be updated. Using the lower parent node as the address and continuing to read left and looping through steps S464 - S467 is to further search for the true root node of this connected component and update the connection relationship between nodes. Through continuous backtracking and updating, it can ensure that the division of the connected component accurately reflects the actual connection situation of pixel points in the image. According to the idea of downward search, when the data of each row is merged, the data of the row above it can be output. Therefore, theoretically, 2 - row buffer areas are required. To prevent read - write conflicts, 4 - row buffer areas are set and written into the memory area in a loop. The write pointer's loop change is achieved by using a row pointer to perform a modulo operation on the 4 - row buffer areas.
[0024] As Figure 7 shown, the steps for obtaining the processed image based on the connected region include the following: S51. Extract the root node of the connected region; S52. Obtain the number of connected domains within the connected region; S53. Obtain the stored data based on the number of connected domains; S54. Re - replace the pixel values of the connected region according to the stored data; S55. Generate an output image based on the replaced pixel values; Among them, the calculation formula for the stored data is:
[0025] In the formula, is the stored data, is the number of connected domains within the connected region; Those skilled in the art can understand that the root node, as the representative of the connected domain, can be directly used to quickly access all pixel points in the region, avoiding traversing the entire region, improving the processing efficiency and the overall operation efficiency of the system. The number of connected domains reflects the number of independent targets or features in the image. Compressing the connected domain information into a single value facilitates subsequent storage and quick search, reducing memory occupancy. By using the stored data to assign different pixel values to each connected domain, different regions can be clearly distinguished in the output image. Since the connected domains are connected together through the root node during the search, the same connected domain is assigned one color and different connected domains are assigned different colors, thus generating the image after connected domain analysis and processing.
[0026] As Figure 8 shown, a hardware resource allocation optimization system based on AprilTag tags is proposed to implement the above - mentioned hardware resource allocation optimization method based on AprilTag tags, including: Control module: The control module is used for data transmission within the system; Image acquisition module: The image acquisition module is used to acquire the image to be processed; AprilTag module: The AprilTag module is used for pre - processing the image; Data storage module: The data storage module is used to store the data within the system; Data conversion module: The data conversion module is used to extract the data in the storage module and convert it into pixel values; Image generation module: The image generation module generates corresponding pictures according to the system data.
[0027] In summary, the advantages of the present invention are: by adopting a downward search strategy, when the pixel value of the point is equal to the pixel value below, not only the conventional connected domain analysis is performed, but also the parent node of the corresponding pixel in the previous row is pointed to the current pixel in the next row, which is more efficient in processing the connectivity relationship of cross-row pixels and avoids the process of multiple backtracking and comparison required by traditional methods. When processing the current row of pixels, if it is found that there is a connectivity relationship with the pixels in the previous row, the parent node of the pixels in the previous row is updated to the corresponding pixel in the current row. In subsequent processing, this parent node transmission relationship can be directly used to quickly determine the connectivity of cross-row pixels without the need to repeatedly compare and judge the pixels in each row, which effectively solves the shortcomings of traditional methods in cross-row processing. When recursively searching for the root node, a path compression strategy is adopted to directly point the parent node of the intermediate node to the root node. When the root nodes of these nodes are searched again in the future, the root node can be directly found, which reduces the recursive depth and search time, improves the search efficiency, and forms an effective connectivity strategy based on this method to reduce the usage of hardware from the algorithm.
[0028] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A hardware resource allocation optimization method based on AprilTag, characterized in that: include: S10, obtaining an image to be processed; S20, scanning the image to be processed and constructing a pixel matrix; S30, processing the pixel matrix according to the pre-algorithm of AprilTag to obtain a reconstructed pixel matrix; S40, obtaining a connected area according to the reconstructed pixel matrix; S50: Obtain a processed image based on the connected area.
2. The hardware resource allocation optimization method based on AprilTag according to claim 1 is characterized in that: Scanning the image to be processed and constructing a pixel matrix comprises the following steps: S21, scanning each pixel in the image to be processed to construct a pixel matrix; S22, constructing an xy coordinate system with the lower left corner of the pixel matrix as the origin, the length direction of the pixel matrix as the x-axis direction, and the width direction of the pixel matrix as the y-axis direction, and two pixels close to each other have a scale of 1 on the coordinate axis; S23, using the pixel information of each pixel point to supplement the information of each point in the pixel matrix.
3. The hardware resource allocation optimization method based on AprilTag according to claim 1 is characterized in that: The processing of the pixel matrix according to the pre-algorithm of AprilTag to obtain the reconstructed pixel matrix includes the following steps: S31, performing grayscale processing on the image to be processed; S32, calculating the gradient magnitude and direction of each pixel; S33, constructing a first threshold value according to the pixel value, and screening the gradient amplitude according to the first threshold value; S34, tracking adjacent edge points along the gradient direction to form a continuous edge segment; S35, obtaining the pixel value of each point after multi-step processing, replacing the pixel matrix, and obtaining a reconstructed pixel matrix.
4. The hardware resource allocation optimization method based on AprilTag according to claim 1 is characterized in that: The method of obtaining a connected domain according to the reconstructed pixel matrix comprises the following steps: S41, extracting the pixel value of each point of the reconstructed pixel matrix; S42, constructing a second threshold; S43, comparing the pixel value with a second threshold; S44, if the pixel value of the point is equal to the second threshold, there is no need to perform connected domain analysis, and the root node is assigned a value of 0; S45, if the pixel value of the point is not equal to the second threshold, a connected domain analysis is required; S46. Obtain a connected domain based on connected domain analysis.
5. The hardware resource allocation optimization method based on AprilTag according to claim 4 is characterized in that: The method of obtaining the connected area according to the connected domain analysis includes the following steps: S461, comparing the pixel value of the point with the pixel value on the left; S462, if the pixel value of the point is not equal to the pixel value on the left, compare downwards to construct a connected domain; S463, if the pixel value of the point is equal to the left pixel value, obtain the left root node of the left pixel point; S464, obtaining the left parent node of the left pixel point, and comparing it with the left root node; S465, if the left parent node is the same as the left root node, continue reading using the left root node as the address; S466, if the left parent node is not the same as the left root node, continue reading using the left parent node as the address; S467, scanning the connected area after the cycle stops.
6. The hardware resource allocation optimization method based on AprilTag according to claim 5 is characterized in that: If the pixel value of the point is not equal to the pixel value on the left, then the comparison is performed downwards, and the construction of the connected domain includes the following steps: S4621, extracting the pixel value below the point and comparing it with the pixel value of the point; S4622, if the pixel value of the point is not equal to the pixel value below, mark it as an independent area and output it directly; S4623. If the pixel value of the point is equal to the pixel value below, obtain the root node below the pixel point below. S4624, obtaining the lower parent node of the lower pixel point, and comparing it with the lower root node; S4625, if the lower parent node is the same as the lower root node, then use the lower root node as the address and loop the connected domain analysis until the loop stops; S4626. If the lower parent node is not the same as the lower root node, continue reading to the left using the lower parent node as the address, and loop steps S464-S467.
7. The hardware resource allocation optimization method based on AprilTag according to claim 1 is characterized in that: The method of obtaining the processed image according to the connected area comprises the following steps: S51, extracting the root node of the connected region; S52, obtaining the number of connected domains within the connected area; S53, acquiring storage data according to the number of connected domains; S54, re-replacing the pixel values of the connected area according to the stored data; S55, generating an output image according to the replaced pixel values; The calculation formula for storing data is: ; In the formula, To store data, is the number of connected domains in the connected region.
8. A hardware resource allocation optimization system based on AprilTag, used to implement the hardware resource allocation optimization method based on AprilTag as described in claims 1-7, characterized in that: include: Control module: The control module is used for data transmission within the system; Image acquisition module: The image acquisition module is used to acquire images to be processed; AprilTag module: The AprilTag module is used to pre-process the image; Data storage module: The data storage module is used to store data in the system; Data conversion module: The data conversion module is used to extract the data in the storage module and convert it into pixel values; Image generation module: The image generation module generates corresponding pictures according to system data.