Line center extraction method and system suitable for FPGA (Field Programmable Gate Array) parallel operation and medium
By analyzing image data in parallel on the FPGA, combined with several row storage areas and specific analysis methods, the real-time and accuracy problems of online center extraction on the FPGA are solved, and efficient and accurate line center extraction is achieved.
Patent Information
- Application Number
- CN202410760090.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-03
AI Technical Summary
The existing technology is difficult to achieve real-time line center extraction on FPGA, and the accuracy is insufficient, which affects the subsequent processing effect.
Using a line center extraction method suitable for FPGA parallel operations, through parallel analysis of pixel values in each column direction of image data, calculation of column maximum values and adjacent pixel values, combined with several row storage areas for data analysis and storage, threshold analysis, flat area Analysis, M-shaped area analysis and overexposure analysis to accurately determine the line center point.
It achieves efficient and real-time line center extraction on FPGA, reduces resource consumption, improves extraction accuracy, is suitable for parallel processing of image data, and is suitable for line center extraction applications in multiple fields.
Smart Images

Figure CN118587272A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of line center extraction, and in particular relates to a line center extraction method, system and medium suitable for FPGA parallel computing. Background Art
[0002] Line center extraction technology is a commonly used method in the field of image processing and machine vision. It is mainly used to extract the center line of lines from images. This technology is widely used in many fields such as three-dimensional measurement, robot navigation, industrial inspection, etc. At present, there are a series of methods for line center extraction, such as grayscale centroid method, Steger algorithm based on Hessian matrix, Gaussian fitting method, extreme value method, refinement method, directional template method, etc. However, many methods are difficult to implement with FPGA, resulting in the inability to extract the line center of the image in real time, and the accuracy of line center extraction will directly affect the effect of subsequent processing. Therefore, it is very important to develop an efficient and accurate line center extraction algorithm.
[0003] Based on this, the present invention provides a line center extraction method, system and medium suitable for FPGA parallel computing. Summary of the invention
[0004] The purpose of the present invention is to overcome the above problems existing in the prior art and to provide a line center extraction method, system and medium suitable for FPGA parallel computing.
[0005] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions: A line center extraction method suitable for FPGA parallel computing, comprising: Collecting original image data containing lines, wherein the lines are distributed along the row direction of the original image data; Reading the original image data row by row in order to form data to be processed; Analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column; A number of adjacent pixel values and indexes in the column direction corresponding to the column maximum value are obtained, and the center point of the line is calculated, wherein the index is used to confirm the position information in the corresponding column direction.
[0006] Furthermore, the parallel analysis specifically includes: Set up several row storage areas for storing analysis results of the data to be processed; Determine the increasing phase and decreasing phase in each column direction of the data to be processed to obtain the maximum value of the column.
[0007] Furthermore, the plurality of row storage areas include: The first storage area is used to store the analysis results of the increasing phase and the decreasing phase in each column direction of the data to be processed; The second storage area is used to store the maximum values of columns in each column direction of the data to be processed; The third storage area is used to count the number of consecutive decreases starting from the maximum value of the column in each column direction of the data to be processed; The fourth storage area is used to store the positions of the center points of the lines in each column direction of the data to be processed.
[0008] Furthermore, the parallel analysis also includes a threshold analysis: determining whether the pixel values in each column direction of the data to be processed are less than or equal to an initial threshold, so as to confirm the data corresponding to the background area.
[0009] Furthermore, the parallel analysis also includes a flat region analysis: determining whether the statistical result corresponding to the third storage region is greater than zero, so as to confirm the stage of the flat region.
[0010] Furthermore, the parallel analysis also includes M-type region analysis: determining whether there is an increase in pixel value in the decreasing phase to confirm the center point of the line.
[0011] Furthermore, the parallel analysis also includes a first decrement analysis: determining whether the storage result of the first storage area is equal to zero to confirm whether it is the first decrement.
[0012] Furthermore, the parallel analysis also includes overexposure analysis: determining the starting point of the overexposure region as the descending stage, and canceling the statistics of the continuous overexposure regions in the third storage region.
[0013] The present invention also provides a line center extraction system suitable for FPGA parallel computing, comprising: An image acquisition module, used for acquiring original image data containing lines, wherein the lines are distributed along the row direction of the original image data; A data reading module is used to read the original image data row by row to form data to be processed; A parallel analysis module is used to analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column; The line center extraction module is used to obtain several adjacent pixel values and indexes in the column direction corresponding to the column maximum value, and calculate the line center point.
[0014] The present invention also provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above extraction method when executed by a processor.
[0015] The beneficial effects of the present invention are: (1) The present invention can not only efficiently find the column maximum value in each column direction through parallel analysis of the data to be processed, but also adapt to the parallel processing mechanism of FPGA and is suitable for real-time processing of image data. Without caching the complete image, the center of the line can be obtained efficiently and accurately through the adjacent pixel values and indexes of the column maximum value; (2) By setting up several row storage areas, the present invention can effectively combine the parallel processing mechanism of FPGA to perform parallel processing on the data of each column in the several row storage areas, and can efficiently and independently find the maximum value of each column; (3) The present invention can not only independently store the analysis results of each column and use them as the basis for subsequent real-time analysis through the setting of the first storage area, the second storage area, the third storage area, and the fourth storage area, but also realize storage reuse and reduce FPGA resource usage; (4) The present invention can effectively remove the useless information influence brought by the background area through threshold analysis, without performing corresponding calculations, thus reducing unnecessary resource consumption; (5) The present invention can accurately confirm the stage of the flat area through flat area analysis, and ensure the stability of the line center calculation process based on the processing methods of the increasing stage and the decreasing stage; (6) The present invention can deal with the special situation where the line increases before reaching the right boundary through M-type area analysis, thereby accurately calculating the line center point; (7) The present invention can deal with the continuous decreasing area of the window through the first decreasing analysis, avoiding the waste of unnecessary computing resources, and can also provide an efficient computing basis for the case of multiple center points in a column, thereby reducing the time complexity; (8) The present invention can effectively deal with the situation of continuous overexposure through overexposure analysis. By canceling the statistics of the continuous overexposure area in the third storage area, it can avoid missing the use of effective pixel values, so as to accurately obtain the final line center point. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 It is a flow chart of the extraction method in the present invention; Figure 2 It is a schematic diagram of the algorithm flow in the present invention; Figure 3 It is a schematic diagram of the sliding window in the present invention; Figure 4 It is a structural block diagram of the extraction system in the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] like Figure 1 As shown, this embodiment first provides a line center extraction method suitable for FPGA parallel computing, which specifically includes the following steps: Step 1: Collect original image data containing lines, wherein the lines are distributed along the row direction of the original image data.
[0019] In image data, rows and columns are basic concepts used to describe the two-dimensional structure of an image. Rows usually correspond to the horizontal direction of an image, while columns correspond to the vertical direction of an image. In most image processing software and programming libraries, image data is stored in the form of a two-dimensional array, where each row represents a horizontal scan line of the image, and each column represents a vertical scan line of the image. In the present invention, the distribution of lines along the row direction of the original image data indicates that at most one line section is passed through in the column direction, thereby ensuring the accuracy of line center extraction of the lines.
[0020] Step 2: Read the original image data row by row to form data to be processed.
[0021] Taking FPGA as an example, reading by row first requires dividing the input data by row and creating corresponding buffers on the FPGA to store the divided row data. These buffers are usually implemented with dual-port RAM (DPRAM) to support both read and write operations. After the original image data is divided by row, it is stored in the buffer row by row. When processing each row of data, the data is read from the corresponding buffer.
[0022] Step 3: Analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column.
[0023] Usually, the maximum value of each column of the data to be processed is located near the center point of the line. Therefore, in order to extract the center point of the line, the maximum value of each column needs to be calculated. At this time, FPGA can process different data packets simultaneously through multiple computing units. These computing units can operate at a unified pace. Each computing unit processes different data but performs the same operation. Therefore, multiple computing units perform the same operation on each column of the data to be processed to find the maximum value of each column.
[0024] Step 4: Obtain several adjacent pixel values and indexes in the column direction corresponding to the column maximum value, and calculate the center point of the line, wherein the index is used to confirm the position information in the corresponding column direction.
[0025] In order to calculate the center point of the line, the weighted average position of the pixel values in each column direction of the processed data can be calculated. At this time, in order to save computing resources, it is only necessary to select several adjacent pixel values and indexes in the column direction corresponding to the column maximum value to participate in the calculation, where the index represents the vertical coordinate position corresponding to the current column, and calculate the sum of the products of all indexes and pixel values involved in the statistics, as well as the sum of all pixel values involved in the statistics. The corresponding line center point position can be obtained by dividing the two.
[0026] In summary, by analyzing the pixel values in each column direction of the data to be processed in parallel, the line image of the collected original image data can be processed in real time. There is no need to cache the complete image. The line center can be obtained efficiently and accurately through the adjacent pixel values of the column maximum value and the index. It is suitable for the parallel processing mode of FPGA and can be applied to any field that requires line center extraction, such as the laser line in the line laser 3D camera and the spectral line in the line spectrum confocal camera. The line center extraction determines the accuracy of the subsequent three-dimensional reconstruction and can perform real-time three-dimensional reconstruction.
[0027] like Figure 2 As shown, the algorithm flow of the extraction method of the present invention is generally described in combination with FPGA: first, the image sensor outputs the image and collects the original image data, and then the FPGA reads the image sensor data row by row, processes each pixel in parallel, until all the data of a frame is processed, and outputs the line center data.
[0028] In order to adapt to the parallel processing mode of FPGA, as a preferred embodiment of the present invention, the parallel analysis specifically includes the following steps: Set up several row storage areas for storing analysis results of the data to be processed; Determine the increasing phase and decreasing phase in each column direction of the data to be processed to obtain the maximum value of the column.
[0029] Usually, the grayscale value distribution statistics along the cross-sectional direction of the line is similar to the normal distribution form. By judging the increasing and decreasing stages in the columns of the data to be processed, the column maximum value can be obtained at the inflection point. However, since the image of the grayscale value distribution statistics along the cross-sectional direction of the line is discrete, directly taking the position corresponding to the column maximum value as the line center point can only achieve pixel-level accuracy. Therefore, in order to obtain sub-pixel-level line center extraction accuracy, it is necessary to combine step 4 for subsequent calculations.
[0030] In order to more reasonably set the plurality of row storage areas of the FPGA, the plurality of row storage areas may specifically include: The first storage area is used to store the analysis results of the increasing phase and the decreasing phase in each column direction of the data to be processed; The second storage area is used to store the maximum values of columns in each column direction of the data to be processed; The third storage area is used to count the number of consecutive decreases starting from the maximum value of the column in each column direction of the data to be processed; The fourth storage area is used to store the positions of the center points of the lines in each column direction of the data to be processed.
[0031] The following describes several row storage areas of FPGA in conjunction with specific implementation methods: First, a sliding window is introduced for image processing. A fixed-size window is set in advance to process the pixel values within the sliding window to gradually approach the center of the line. The maximum value of the column is found by continuously sliding the window.
[0032] Assuming the sliding window size is 2n+1, the FPGA sets n+4 rows of storage areas, where the n+1 row of the first storage area is used to store the analysis results of the increment and decrement stages, recorded as row_cache; the 1 row of the second storage area is used to store the column maximum value, recorded as max_value; the 1 row of the third storage area is used to store the number of consecutive decrements starting from the column maximum value, recorded as win_size; the 1 row of the fourth storage area is used to store the center point of the line, recorded as center. For the convenience of description, the following takes n=3 as an example. At this time, 7 rows need to be stored and the sliding window size is also 7.
[0033] Since FPGA can process each pixel in a row in parallel, we only need to consider the line center extraction algorithm of a column of pixels. For each column of pixels, Figure 3 As shown: Keep sliding the window and find the maximum value of the column in a window of size 7, which corresponds to I i .
[0034] Initially, the cache values of all storage areas are 0. Let the current pixel value be p. The last element of row_cache stores the last pixel value scanned. The other three elements are used to store pixel values in the increasing phase and to store dynamic thresholds (Tc), pixel value sums (pixel_sum), and sums of indexes and pixel value products (weight_sum) in the decreasing phase, thereby achieving storage reuse. After finding the maximum value of the column in the sliding window, if three more elements are found, it is said that the right edge of the window has been reached.
[0035] Taking 3D cameras as an example, generally more than 90% of an industrial 3D camera laser line image is a background area with pixel values less than the initial threshold Tb. It can be considered that it does not contain useful information. In theory, no calculation is required for these areas. Therefore, parallel analysis can also include threshold analysis: determine whether the pixel values in each column direction of the data to be processed are less than or equal to the initial threshold Tb to confirm the data corresponding to the background area. The specific algorithm is as follows: if p > Tb or row_cache[1]!=0: continue processing; Then: p = 0 if p <= Tb else p; Among them, row_cache[1] represents the second element value in row_cache. Taking the first storage area of 4 rows in the present invention as an example, from left to right, they are row_cache[0], row_cache[1], row_cache[2], and row_cache[3], which correspond to the first element value, the second element value, the third element value, and the fourth element value in row_cache, respectively. That is, the first element value in row_cache is row_cache[0]. As another way of expressing the algorithm, from left to right, they can also be row_cache[-4], row_cache[-3], row_cache[-2], and row_cache[-1], which correspond to the fourth to last element value, the third to last element value, the second to last element value, and the first to last element value in row_cache, respectively. That is, the first to last element value in row_cache corresponds to row_cache[-1]. The two expressions do not conflict with each other. In order to facilitate logical understanding, different expressions will be selected as needed for explanation below. At the same time, in order to facilitate the understanding of the logic of the present invention, the operators in the algorithm of the present invention are explained as follows: "!=" is used to determine whether two values are not equal and return a Boolean value (True or False), "<=" is used to determine whether the value on the left is less than or equal to the value on the right, ">=" is used to determine whether the value on the left is greater than or equal to the value on the right, "==" is used to determine whether two values are equal, "+=" is used to add the value on the right to the variable on the left and reassign the result to the variable on the left, the "and" operator requires that all connected conditions must be true at the same time to make the entire expression true, and the "or" operator requires that at least one of the connected conditions is true for the entire expression to be true.
[0036] row_cache[1]!=0 is used to handle situations like 10,10,12,15,13,10,10. Assume that Tb is 10 and the current descending stage p=10. Although p <= Tb is satisfied at this time, it has not reached the right boundary of the sliding window. At this time, the loop should continue. At this time, row_cache[1] stores pixel_sum, whose value is not 0. Therefore, it can be used to determine whether the pixel less than or equal to Tb continues to participate in the loop (although it does not participate in the calculation).
[0037] In order to find the column maximum value, the sliding window needs to go through the increasing phase and the decreasing phase. In the increasing area, the pixel value currently being processed is greater than or equal to the last element value in row_cache, that is: p >= row_cache[-1]; in the decreasing area, the pixel value currently being processed is less than or equal to the last element value in row_cache, that is: p <= row_cache[-1].
[0038] Therefore, flat areas may exist in both increasing and decreasing areas, that is, p = row_cache[-1]. For example, in spectral confocal, we often encounter situations like the following (assuming Tb is 10): 11, 15, 15, 20, 25, 21, 15, 15, 11. However, considering that win_size is 0 in the increasing stage and only starts to accumulate in the decreasing stage, a flat area analysis can be performed at this time: determine whether the statistical result corresponding to the third storage area win_size is greater than zero to confirm the stage of the flat area.
[0039] The specific judgment algorithm is as follows: if win_size > 0 and p == row_cache[-1]: indicates a flat area in the decreasing phase; Otherwise, it indicates that it is still in the increasing stage: at this time, the elements in row_cache are shifted left, and then p is stored in the last bit of row_cache, that is, row_cache[-1]=p.
[0040] For the decreasing stage, it is necessary to calculate the sum of pixel values (pixel_sum), the sum of the product of index and pixel value (weight_sum), and win_size+1, that is: row_cache[1]+=(p-row_cache[0]); row_cache[2]+=r*(p-row_cache[0]); win_size+=1; As can be seen from the above, row_cache[0], row_cache[1], and row_cache[2] correspond to the first element value, the second element value, and the third element value in row_cache, respectively. In the decreasing stage, they are used to store the dynamic threshold (Tc), the sum of pixel values (pixel_sum), and the sum of the product of the index and the pixel value (weight_sum), respectively. Among them, r represents the index corresponding to the current pixel value, that is, the vertical coordinate position corresponding to the current column. When calculating pixel_sum and weight_sum, the pixel values involved in the calculation are subtracted from the threshold, that is, p-row_cache[0]. Pixel_sum is obtained by row_cache[1]+=(p-row_cache[0]) and assigned to row_cache[1]. Weight_sum is obtained by row_cache[2]+=r*(p-row_cache[0]) and assigned to row_cache[2]. However, it is necessary to determine whether p is larger than row_cache[0]. If it is smaller than row_cache[0], it will not be processed.
[0041] Finally, p is saved in the last bit of row_cache: row_cache[-1] = p. At the same time, each time a pixel is calculated, it is determined whether the current element reaches the right edge of the window. If it reaches the right edge, the center point is calculated and row_cache is cleared to 0. However, the last element of row_cache is not cleared, that is, row_cache[0], row_cache[1], and row_cache[2] are cleared to 0. The last element row_cache[-1] always saves the last element scanned.
[0042] In addition, in the decreasing phase, the value may increase in advance before reaching the right edge of the sliding window. Therefore, an M-type area analysis is required to determine whether there is an increase in pixel value in the decreasing phase to confirm the center point of the line. The specific judgment algorithm is as follows: if p > row_cache[-1]: indicates early increment; Description: Find a peak and calculate a center point center = row_cache[2] / row_cache[1]; At the same time, row_cache[-2] = row_cache[-1], that is, the value of the last element in row_cache is shifted to the left, the rest of row_cache is cleared to 0, and win_size is cleared to 0.
[0043] From the above, we can see that at the first decrease, p < row_cache[-1] and win_size=0 must exist. However, this property also exists in the continuously decreasing area outside the right boundary of the sliding window. Therefore, when p < row_cache[-1] and win_size==0, we need to determine whether it is the first decrease or the continuously decreasing area outside the sliding window. That is, we can do the first decrease analysis: determine whether the storage result of the first storage area is equal to zero to confirm whether it is the first decrease. The specific instructions are as follows: Since row_cache and win_size are cleared to 0 immediately after each calculation of the center point (condition: reaching the right boundary of the sliding window or increasing if not reaching the right boundary), we can judge whether the second to last bit of row_cache is 0. If the second to last bit of row_cache is not 0, it indicates the first decrease. Otherwise, it is a continuously decreasing area outside the right boundary of the sliding window. At this time, simply save p in the last bit of row_cache and continue, that is: if row_cache[-2]==0: row_cache[-1] = p continue; In actual calculation, the maximum value is selected by default to calculate the center point. However, since interference may have many rising and falling areas, that is, a column may have multiple center points. If the center point is calculated for each area, the time complexity will be very high. Therefore, the effective point threshold Tv can be set as follows: if row_cache[-1] <= Tv or row_cache[-1] <= max_value: Then you can clear row_cache to 0, save p in the last bit of row_cache, and continue.
[0044] Otherwise, it means that the current position is indeed the first decrease above the valid point threshold Tv, then start calculating pixel_sum and weight_sum. Ideally, the first element of row_cache is taken as the dynamic threshold Tc, but sometimes the following situations may occur: row_cache: 45,45,45,45, p: 34. If the first element of row_cache is used as the dynamic threshold Tc, 0 and negative values will appear. Therefore, it is necessary to determine whether the first and last elements of row_cache are equal: if row_cache[-1] == row_cache[0]: then set row_cache[0]=1, that is, change the dynamic threshold Tc. You can also assign row_cache[0] to other values to change the dynamic threshold Tc according to the actual situation.
[0045] Then take the elements in row_cache in turn and compare them with row_cache[0] to calculate pixel_sum and weight_sum. After the calculation is completed, these two values are assigned to row_cache[1] and row_cache[2] respectively. At the same time, p also participates in the calculation. It is the first element of the right window. After the calculation, win_size+1.
[0046] In addition to the above situations, the original image data may also have continuous overexposed areas. For example, for an 8-bit image, the maximum pixel value is 255, and no threshold reduction operation is performed (after subtracting the threshold, overexposure is no longer overexposure). For continuous overexposed areas, such as 90, 145, 220, 255, 255, 255, 255 ,255,255,255, 220 ,145,90.
[0047] It is hoped that the calculated center point is the 255 position in the middle, but this cannot be achieved according to the above logic, because the first descending point is the 220 position on the right. Since the window set in advance is very small, the elements in row_cache are 255,255,255,255, and the 90,145,220 pixels on the left side of the window are not used at all. Therefore, overexposure analysis can be performed: determine the starting point of the overexposed area as the descending stage, and cancel the statistics of the continuous overexposed areas in the third storage area to determine whether it is the first time to encounter an overexposed point. Once an overexposed point is encountered, start calculating pixel_sum and weight_sum, that is, for the rising area, the following constraints must be added: if p >= row_cache[-1] and p!=255: Once it hits 255, it goes to the first drop, and we don’t know how many overexposed points there are. Therefore, we need to add the following constraints to the judgment of the first drop: if (p < row_cache[-1] or p == 255) and win_size == 0 and row_cache[-1] != 255: row_cache[-1] != 255 indicates that except for the first overexposure point, all other overexposure points (and decreasing points) are transferred to the decreasing area for processing. Therefore, the following judgment constraints are added to the decreasing area: if (p <= row_cache[-1] and win_size> 0) or row_cache[-1] == 255; As can be seen above, for non-overexposed areas, win_size is accumulated each time pixel_sum and weight_sum are calculated based on p, and finally it is determined whether the value of win_size is equal to the pre-set n, that is, whether it reaches the right edge of the sliding window. If it is equal to n, the center point is calculated and the cache is cleared. However, for continuous overexposed areas, we do not know the length of the overexposed area, so we need to keep calculating. Therefore, when p=255, win_size is not accumulated, that is, the following judgment is made before accumulating win_size: if p < 255: win_size += 1; Continuous overexposed areas can be processed.
[0048] like Figure 4 As shown, the second aspect of the present invention further provides a line center extraction system suitable for FPGA parallel computing, comprising: An image acquisition module, used for acquiring original image data containing lines, wherein the lines are distributed along the row direction of the original image data; A data reading module is used to read the original image data row by row to form data to be processed; A parallel analysis module is used to analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column; The line center extraction module is used to obtain several adjacent pixel values and indexes in the column direction corresponding to the column maximum value, and calculate the line center point.
[0049] In specific implementation, the original image data containing lines is collected by the image acquisition module and sent to the data reading module for row-by-row analysis. Then, the parallel analysis module analyzes the pixel values in each column direction of the data to be processed in parallel. The line image of the collected original image data can be processed in real time. After finding the column maximum value, the line center point is confirmed by the line center extraction module.
[0050] The third aspect of the present invention further provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above-mentioned extraction method when executed by a processor.
[0051] In practical applications, the computer-readable storage medium may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
[0052] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0053] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0054] Computer program code for performing the operation of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Verilog, Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0055] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0056] 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, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. A line center extraction method suitable for FPGA parallel computing, It is characterized in that include: Collecting original image data containing lines, wherein the lines are distributed along the row direction of the original image data; Reading the original image data row by row in order to form data to be processed; Analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column; A number of adjacent pixel values and indexes in the column direction corresponding to the column maximum value are obtained, and the center point of the line is calculated, wherein the index is used to confirm the position information in the corresponding column direction.
2. A line center extraction method suitable for FPGA parallel computing according to claim 1, It is characterized in that Parallel analysis specifically includes: Set up several row storage areas for storing analysis results of the data to be processed; Determine the increasing phase and decreasing phase in each column direction of the data to be processed to obtain the maximum value of the column.
3. A line center extraction method suitable for FPGA parallel computing according to claim 2, It is characterized in that Several row storage areas include: The first storage area is used to store the analysis results of the increasing phase and the decreasing phase in each column direction of the data to be processed; The second storage area is used to store the maximum values of columns in each column direction of the data to be processed; The third storage area is used to count the number of consecutive decreases starting from the maximum value of the column in each column direction of the data to be processed; The fourth storage area is used to store the positions of the center points of the lines in each column direction of the data to be processed.
4. The line center extraction method suitable for FPGA parallel computing according to claim 3, It is characterized in that The parallel analysis also includes threshold analysis: determining whether the pixel values in each column direction of the data to be processed are less than or equal to the initial threshold value to confirm the data corresponding to the background area.
5. The line center extraction method suitable for FPGA parallel computing according to claim 3, It is characterized in that The parallel analysis also includes a flat region analysis: determining whether the statistical result corresponding to the third storage region is greater than zero, so as to confirm the stage of the flat region.
6. The line center extraction method suitable for FPGA parallel computing according to claim 3, It is characterized in that The parallel analysis also includes M-type area analysis: judging whether there is an increase in pixel value in the decreasing phase to confirm the center point of the line.
7. The line center extraction method suitable for FPGA parallel computing according to claim 3, It is characterized in that The parallel analysis also includes first decrement analysis: judging whether the result stored in the first storage area is equal to zero, so as to confirm whether it is the first decrement.
8. A line center extraction method suitable for FPGA parallel computing according to any one of claims 4 to 7, It is characterized in that The parallel analysis also includes overexposure analysis: determining the starting point of the overexposure area as the descending stage, and canceling the statistics of the continuous overexposure area in the third storage area.
9. A line center extraction system suitable for FPGA parallel computing, It is characterized in that include: An image acquisition module, used for acquiring original image data containing lines, wherein the lines are distributed along the row direction of the original image data; A data reading module is used to read the original image data row by row to form data to be processed; A parallel analysis module is used to analyze the pixel values in each column direction of the data to be processed in parallel and calculate the maximum value of the column; The line center extraction module is used to obtain several adjacent pixel values and indexes in the column direction corresponding to the column maximum value, and calculate the line center point.
10. A computer-readable storage medium comprising a computer program, It is characterized in that When the computer program is executed by a processor, the extraction method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and device for extracting center line of laser stripe column,equipment and storage medium
CN112927277A
Lane line extraction method and device, equipment, storage medium and program product
CN115294543A
Grid graph detection method and device, additive manufacturing equipment and storage medium
CN117408986A
Image gray histogram statistics and target search method and system based on FPGA (Field Programmable Gate Array)
CN117689732A
Cited By
Image data extraction method and system and medium
CN119991779A
Light stripe center extraction method and system and medium
CN120495388A
Peak value calculation method and system
CN122265420A
A peak calculation method and system
CN122265420B
Peak value identification method and system for double-peak superposition curve
CN122473552A
