Image corrosion method based on run-length coding and image processing device
Through the image corrosion method based on stroke encoding, the calculation efficiency problems under high-resolution binary images and large structural elements are solved, and efficient corrosion operations are achieved to meet the real-time requirements of industrial industries.
Patent Information
- Application Number
- CN202510906350.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
When existing morphological corrosion algorithms process high-resolution binary images or use larger structural elements, they consume high computing resources and low processing efficiency, making it difficult to meet industrial real-time requirements.
Using a picture corrosion method based on stroke encoding, by converting binary images and structural elements into target areas and structural elements, it is directly verified whether all stroke segments of structural elements are fully included in the corresponding strokes of the target areas, which determines the retention of anchor strokes, and avoids intensive calculations of traditional pixel-level convolutions.
It improves corrosion computing efficiency in high-resolution images or large structural elements scenarios, meeting the strict real-time requirements of industrial applications for processing speed.
Smart Images

Figure CN120410871A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of image processing, and particularly relates to an image erosion method and an image processing device based on run-length encoding. Background Art
[0002] Morphological erosion is a common preprocessing algorithm in connected component analysis and is widely used. For example, removing small particle noise makes the target clearer, removing burrs or irregular protrusions on the target edge makes the target smoother, removing unnecessary details to refine the shape to make it more concise, separating small connections between targets, etc., so as to facilitate subsequent connected component analysis. In traditional binary images, the erosion of the target is usually achieved by performing a convolution operation on the binary image using a structuring element.
[0003] In a binary image, adjacent pixels with a value of 255 form a connected component target. The connected components are marked through the binary image, and multiple connected targets are marked. Usually, when performing an erosion operation on a connected target, the connected target is converted into a binary image, and then a convolution operation is performed row by row and column by column on the binary image using a structuring element. However, the computational complexity of the convolution operation is usually high. Especially when dealing with high-resolution images or using large structuring elements, there are efficiency deficiencies and it is difficult to meet the high-efficiency requirements in industry. Summary of the Invention
[0004] [[ID=!6]]The main purpose of this application is to provide an image erosion method and an image processing device based on run-length encoding, aiming to solve the technical problems that the existing morphological erosion algorithm consumes a large amount of computing resources and has low processing efficiency when processing high-resolution binary images or using larger structuring elements, and it is difficult to meet the industrial real-time requirements.
[0005] To achieve the above purpose, this application proposes an image erosion method based on run-length encoding, including the following steps: Obtain a binary image and a preset structuring element, and perform run-length encoding on the binary image and the structuring element respectively to obtain a target region and a structuring element region; Find the start and end rows of the runs in the target region and the structuring element region respectively to determine the row interval where the runs in the eroded target region are located; Within the row interval where the runs in the eroded target region are located, when it is checked that there is a run on the target row, perform column interval contraction on the runs corresponding to each run in the structuring element region on the row corresponding to the target region to obtain a plurality of column interval contraction sets; When there is no empty set among the plurality of column interval contraction sets, iteratively find the intersection of the column intervals in all column interval contraction sets to obtain all eroded result column intervals on the target row, and form runs with the row number of the target row and the result column intervals corresponding to the target row to obtain the erosion results for each row.
[0006] In one embodiment, the specific steps of obtaining a binary image and a preset structuring element, and performing run-length encoding on the binary image and the structuring element respectively to obtain a target region and a structuring element region include: Obtain a binary image, perform run-length encoding on the binary image, and define it as the target region; Input a preset structuring element, perform run-length encoding on the structuring element to obtain a run set of the structuring element, and define it as a preliminary structuring element region, and calculate the anchor point of the preliminary structuring element region. Use the anchor point as the mirror point to perform mirror transposition on all runs in the preliminary structuring element region to obtain the structuring element region.
[0007] In one embodiment, the specific steps of respectively finding the start and end rows of runs in the target region and the structuring element region to determine the row interval where the runs in the target region are located after erosion include: Based on the transposition of the structuring element region, find the start and end rows of the runs in the structuring element region, including the minimum row and the maximum row of the structuring element region; Find the start and end rows of the runs in the target region, including the minimum row and the maximum row of the target region; According to the minimum row and the maximum row of the target region and the minimum row and the maximum row of the structuring element region, determine the minimum row, the maximum row and the row interval where the runs in the target region are located after erosion.
[0008] In one embodiment, define the row interval where the runs in the target region are located after erosion as the calculation interval. In the calculation interval, the row corresponding to the row where the anchor point of the structuring element region is located is the target row of the calculation interval.
[0009] In one embodiment, the specific steps of, within the row interval where the runs in the target region are located after erosion, when it is detected that there are runs on the target row, performing column interval contraction on the runs on the rows corresponding to each run in the structuring element region in the target region to obtain a plurality of column interval contraction sets include: Detect whether there are runs on the target row in the calculation interval; When it is detected that there are runs on the target row, perform column interval contraction on the runs on the rows corresponding to each run in the structuring element region in the target region to obtain a plurality of column interval contraction sets; When it is detected that there are no runs on the target row, detect whether there are runs on the next target row in the calculation interval.
[0010] In one embodiment, the specific steps of detecting whether there are runs on the target row in the calculation interval include: Detect whether there is at least one run on the target row in the calculation interval; When at least one run is detected in the target row, traverse each run in the structuring element area and obtain the corresponding structuring element target row where it is located, and detect whether there is a run in the row corresponding to the structuring element target row in the target area; When it is detected that all rows corresponding to the structuring element target row in the target area have runs, it is determined that a run exists on the target row; When it is detected that there is no run in the target row / there is no run in any row corresponding to the target row in the target area, detect whether there is at least one run in the next target row in the calculation interval.
[0011] In one embodiment, the specific steps of performing column interval contraction on the runs on the rows corresponding to each run in the structuring element area in the target area when it is detected that there is a run in the target row to obtain a plurality of column interval contraction sets include: When it is detected that there is a run in the target row, traverse each run in the structuring element area and obtain the corresponding structuring element target row where it is located, and read all the runs in the row corresponding to the structuring element target row in the target area; Perform column interval contraction on all the runs in the row corresponding to the structuring element target row in the target area to obtain a plurality of column interval contraction sets.
[0012] In one embodiment, when there is no case where a set is empty in the plurality of column interval contraction sets, the specific steps of iteratively finding the intersection of the column intervals in all the column interval contraction sets to obtain all the eroded result column intervals on the target row, and forming runs with the row number of the target row and the result column intervals corresponding to the target row to obtain the erosion result of each row include: Judge whether there is a case where a set is empty in the plurality of column interval contraction sets; When there is no case where a set is empty in the plurality of column interval contraction sets, iteratively find the intersection of the column intervals in all the column interval contraction sets to obtain all the eroded result column intervals on the target row, and form runs with the row number of the target row and the result column intervals corresponding to the target row to obtain the erosion result on the target row, and detect whether there is a run in the next target row in the calculation interval; When there is a case where a set is empty in the plurality of column interval contraction sets, detect whether there is a run in the next target row in the calculation interval.
[0013] In one embodiment, the following steps are further included: Obtain the erosion results of all target rows in the calculation interval and generate an eroded binary image.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes an image processing device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the above-mentioned image corrosion method based on run-length encoding.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application's run-length encoding-based erosion method efficiently erodes the target region by converting a binary image and a specified structuring element into a target region and a structuring element region. By directly verifying whether all structuring element run segments are fully contained by the corresponding run of the target region, the method determines the anchor point run to be retained. This method, based on run-length encoding, effectively circumvents the computationally intensive nature of traditional pixel-level convolution, improving the efficiency of erosion calculations for high-resolution images or scenarios using large structuring elements, thereby meeting the stringent real-time processing speed requirements of industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A flowchart of the first embodiment of the image erosion method based on run length encoding provided in this application; Figure 2 A flow chart of the second embodiment of the image erosion method based on run length encoding provided in this application; Figure 3 A schematic diagram of run length encoding of a binary image according to an embodiment of the image erosion method based on run length encoding of the present application; Figure 4 A schematic diagram of a region converted from a structural element of an embodiment of an image erosion method based on run length encoding of the present application; The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0020] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0021] The main solutions of the embodiments of this application are: This application proposes an image erosion method based on run length encoding, such as Figure 1 As shown, the following steps are included: S100: Acquire a binary image and a preset structure element, and perform run-length encoding on the binary image and the structure element to obtain a target region and a structure element region; S200: searching for the start and end rows of the travel in the target area and the structural element area respectively, so as to determine the row interval where the travel in the target area after corrosion is located; S300: within the row interval where the trip in the eroded target region is located, when it is detected that a trip exists on the target row, performing column interval contraction on the trip on the row corresponding to each trip in the structural element region in the target region to obtain multiple column interval contraction sets; S400: When there is no empty set in the multiple column interval contraction sets, the column intervals in all column interval contraction sets are iteratively calculated to obtain the intersection of all eroded result column intervals on the target row, and the row number of the target row and the result column interval corresponding to the target row form a trip to obtain the erosion result on each row.
[0022] Image processing is a multi-stage process that begins with acquiring the original image, undergoes preprocessing to improve image quality or structure, then performs segmentation to isolate objects, extracts their features, and finally achieves recognition or understanding of the image content. Morphological operations are extremely important tools in the preprocessing stage. They are specifically used to analyze and manipulate the shape and structure of objects in an image, providing a clean and well-structured representation of the object for subsequent connected domain analysis, feature extraction, and recognition. They address the morphology of the object itself and serve as the foundation for subsequent advanced analysis.
[0023] More specifically, morphological erosion is a fundamental and widely used preprocessing algorithm in connected domain analysis. Its core value lies in its ability to effectively improve the morphological characteristics of the target, laying a good foundation for subsequent connected domain identification and labeling. Specifically, the erosion operation can remove tiny, isolated pixels in the image that are considered noise, making the main outline of the target clearer; it can smooth out burrs or irregular tiny bumps on the edge of the target, thereby making the target boundary smoother; at the same time, it can also eliminate unnecessary details inside or on the boundary of the target, achieving shape simplification and refinement; more importantly, when multiple target objects should be separated due to tiny pixel adhesion, erosion can cut these thin connecting bridges and successfully separate the targets. These effects improve the accuracy and robustness of subsequent connected domain analysis.
[0024] In the traditional binary image processing pipeline, the erosion operation is typically implemented by convolving the image with a predefined structuring element. This process involves the structuring element sliding row by row and column by column across the image, and at each position, checking whether all the pixels within the covered area of the structuring element are target pixels to determine whether the corresponding position in the output image retains the target or is eroded to the background. However, this implementation method based on point-by-point convolution has significant limitations in terms of efficiency, especially when dealing with high-resolution images commonly found in industrial applications or scenarios that require large structuring elements for operation. The main cause of the problem lies in the computational complexity of the convolution operation. Each movement of the structuring element requires a complete check and logical operation ("AND" operation) on all the pixels within its covered area. For large-sized structuring elements or high-resolution images, this per-pixel traversal and repeated calculation amount will increase sharply, resulting in a significant decrease in processing speed. This efficiency bottleneck makes the traditional convolution erosion method often unable to cope when faced with the high throughput and real-time processing requirements of industrial scenarios, and it is difficult to meet the strict speed requirements of practical applications.
[0025] To break through this efficiency dilemma, this application proposes an image erosion method based on run-length encoding. The solution idea is to use run-length encoding (RLE) to efficiently represent the target connected components and design a dedicated erosion algorithm on this basis. The core idea of run-length encoding is to represent the continuous horizontal pixel segments (i.e., "runs") with the same pixel value in the image by their starting positions and lengths, rather than storing or processing each individual pixel. This representation method is particularly efficient in binary images because it naturally compresses the information of continuous regions with the same pixel value.
[0026] The erosion method based on run-length encoding makes use of this efficient structured representation. Its key advantage is that the algorithm can directly operate on the run data representing continuous target pixel segments, avoiding independent and repetitive checks and convolution calculations for each pixel in the image. Through the algorithm logic, it can efficiently determine whether the structuring element will "hit" the target at the current position at the run data level and simulate the erosion effect, thus greatly reducing the unnecessary calculation amount. This method is particularly suitable for processing high-resolution images containing large connected targets or requiring large structuring elements, and can significantly improve the efficiency of the erosion operation, providing a better solution to address the challenges of real-time processing in industrial applications.
[0027] This application includes the following steps: In step S100, a binary image and a preset structuring element are obtained, and run-length encoding is performed on the binary image and the structuring element respectively to obtain a target region and a structuring element region. This step first clarifies the input objects: one is the original binary image to be processed, in which the pixels only contain two distinct values, namely the target and the background; the other is the preset structuring element, which is a core template defining the shape and size of the neighborhood for morphological operations, and is itself a numerical matrix. To improve the efficiency of subsequent morphological operations, especially for images that may contain large areas of continuous regions with the same value, this step applies the run-length encoding, an optimized representation technique, to both of these input objects.
[0028] Specifically, the system independently performs run-length encoding on the input binary image, converting its original pixel matrix into a more concise run-length encoding set, which effectively captures and describes the position and length information of all horizontally continuous target pixel segments and background pixel segments in the image, thus forming a run-length encoding region representation of the target image. At the same time, the system also independently performs the exact same run-length encoding operation on the preset structuring element. Although the structuring element itself is small in size, it also contains specific pixel value patterns, usually a combination of foreground targets and the background. By encoding it, the structuring element is also converted into an equivalent run-length encoding set, clearly depicting the distribution characteristics of the continuous foreground or background regions inside it, forming a run-length encoding region representation of the structuring element. So far, step S100 has completed the efficient conversion of the image and the structuring element represented in the original pixel space into the run-length encoding region form based on continuous segment descriptions, laying a necessary foundation for directly performing efficient morphological operations on these compressed and structured encoding regions subsequently.
[0029] In step S200, the start and end rows of the runs in the target region and the structuring element region are found respectively to determine the row interval where the runs in the target region are located after erosion. This step is based on a key insight: in the resulting image of the erosion operation, the occurrence of any valid run is necessarily strictly constrained by the spatial distributions of both the original target image and the structuring element. The specific execution process is as follows: the system first independently analyzes the two run-length encoding regions generated by step S100, namely the target region and the structuring element region. For the target region, the system traverses all the run segments recorded in it, identifies the topmost row number and the bottommost row number where these run segments appear, so as to determine the actual distribution boundaries of the target image content in the vertical direction.
[0030] Similarly, the system also performs a similar operation on the structuring element region, finding the minimum row number and the maximum row number occupied by all run segments of the structuring element itself, which defines the spatial span of the structuring element template in the vertical direction. Next, it is necessary to determine all the row positions where the anchor point of the structuring element may be placed and produce an effective erosion result when the structuring element slides above the target image. This is calculated by considering the height of the structuring element, i.e., its own row span, and the vertical extension range of the structuring element relative to its center point. For example, how many rows are above the center point and how many rows are below it, and combining with the valid row range of the target image.
[0031] Finally, this step calculates the row intervals in the erosion result image where all possible valid runs may be contained. The determination of this row interval is crucial because it narrows the range of target rows that need to be processed in detail in the subsequent steps S300 and S400, avoiding unnecessary calculations on rows where no results are likely to appear, thus laying the foundation for the efficiency of the entire optimization algorithm. Essentially, what step S200 accomplishes is the preliminary spatial pruning and range focusing of the erosion operation in the vertical dimension.
[0032] In step S300, within the row interval where the runs in the target region after erosion are located, when it is checked that there is a run on the target row, the column intervals of the runs corresponding to each run in the structuring element region on the row in the target region are shrunk to obtain multiple sets of shrunk column intervals. This step delves into each specific target row within the row interval where the erosion result may occur as determined in step S200. Its execution logic is as follows: First, for the current target row being processed, the system queries the run-length encoding region of the target image to check if there are any actual valid runs representing foreground targets on this row. If this row in the target image belongs entirely to the background, i.e., there are no target runs, then it is obvious that no foreground pixels of the erosion result can be produced on this row, and the system will skip further processing of this row. However, if there is one or more target run segments on the target row, it means that there is a possibility of producing an erosion result on this row, and it is necessary to enter the core processing section. At this time, the system will traverse each independent run segment in the run-length encoding region of the structuring element, and these runs represent consecutive pixel units in the structuring element template. For each such run segment in the structuring element region, the system needs to evaluate the spatial constraint conditions it imposes on the current target row of the target image.
[0033] It can be understood that the system "projects" or "maps" it onto the current target row of the target image according to the row position where the structural element run segment itself is located. This projection process is essentially calculating a displacement: the row offset of the structural element run segment relative to its center point determines the precise column coordinate range where foreground pixels must exist on the corresponding row in the target image, that is, the current target row plus or minus this row offset. Then, the system queries the run-length encoding area of the target image to obtain all the run segments and their column interval information actually existing on the corresponding row required by the structural element run segment in the target image. Next, the system performs an overlap judgment and an intersection operation on the column interval required by the structural element run segment on the current target row and the column intervals of all the run segments actually existing on the corresponding row in the target image.
[0034] The result of this intersection operation is a possibly empty set of new column intervals, which represents the area segment actually existing on the corresponding row in the target image that can satisfy the column-direction space constraints imposed by the current specific structural element run segment. Since the structural element area usually contains multiple run segments, after performing the above projection mapping, querying the runs of the corresponding row, and intersection operation for each run segment in the structural element area, step S300 will finally generate a "set of contracted column intervals" for the current target row. Each element in this set of contracted column intervals corresponds to a structural element run segment and contains the column interval segments that meet the conditions found on the corresponding row in the target image after being "contracted" by the constraints of the structural element run segment. These sets of contracted column intervals provide the basis for the next step S400 to comprehensively determine whether the entire structural element can be completely "fitted" at specific column positions on the current target row.
[0035] In step S400, when there is no case where the set is empty in multiple sets of contracted column intervals, the column intervals in all sets of contracted column intervals are iteratively intersected to obtain all the eroded result column intervals on the target row, and a run is formed by the row number of the target row and the result column intervals corresponding to the target row to obtain the erosion result for each row. The execution logic of this step is based on a strict check of the state of the set of contracted column intervals. First, the system verifies whether all the sets of contracted column intervals generated by step S300 for the current target row are non-empty sets. Each set of contracted column intervals represents the column interval segment of the target image that satisfies the space constraints of a specific run segment in the structural element. If it is found that any one of the sets of contracted column intervals is an empty set, it means that the requirements of at least one structural element run segment cannot be met on the current row. The entire structural element cannot be completely "covered" at any column position on this row. Therefore, in this case, the system will directly determine that there is no valid erosion result on the current target row and no subsequent calculation is required.
[0036] Step S400 will enter the substantial result calculation stage only when all the contracted sets of column intervals are non-empty, that is, when at least one column interval that meets the conditions is found for each constraint corresponding to the structural element run segment on the target image. At this time, the system needs to find one or more specific column coordinate positions, which must simultaneously satisfy the combined spatial constraints imposed by all the run segments in the structural element. This is equivalent to requiring that there must be a column position point on the current row of the target image such that when the center of the structural element is placed at this point, each constituent pixel of the structural element template can find a foreground pixel in the corresponding exact position on the target image to match it.
[0037] To find such a position point, step S400 adopts the method of iterative intersection. The system will traverse all non-empty contracted sets of column intervals and perform a global intersection operation on all column interval segments in these contracted sets of column intervals. This operation needs to efficiently find the overlapping parts among all interval segments. These finally obtained intersection interval segments represent the exact column coordinate ranges on the current target row where the requirements of all structural element run segments are simultaneously met. In other words, each column position point within these interval segments is a position where the center of the structural element can be placed, and when the structural element is placed at this position, its entire shape can completely "fall" into the foreground area of the target image.
[0038] Finally, step S400 outputs the result column intervals obtained from these intersection operations and the run composed of the row number of the target row as the effective result of the erosion operation on the current target row. These interval segments are recorded in the form of run-length encoding, representing the continuous pixel segments belonging to the foreground after erosion on this row. By sequentially processing each row within the row interval determined in step S200 and executing steps S300 and S400, the complete target image area after erosion processing can be constructed row by row, also represented in an efficient run-length encoding format.
[0039] The erosion method based on run-length encoding in this application converts a binary image and a specified structural element into a target region and a structural element region, and determines the retention of the anchor point run by directly verifying whether all run segments of the structural element are completely included in the corresponding run of the target region, thereby completing the efficient erosion of the target region. The run-length encoding in this application effectively avoids the intensive calculation of traditional pixel-level convolution, improves the erosion calculation efficiency in the case of high-resolution images or using large structural elements, so as to meet the stringent real-time requirements of industrial applications for processing speed.
[0040] [[ID=X]]In one embodiment, the specific steps of obtaining the binary image and the preset structural element and performing run-length encoding on the binary image and the structural element respectively to obtain the target region and the structural element region include: S110: Obtain a binary image, perform run-length encoding on the binary image, and define it as the target region; S120: Input a preset structuring element, perform run-length encoding on the structuring element to obtain a set of runs of the structuring element, define it as a preliminary structuring element region, calculate the anchor point of the preliminary structuring element region, and perform mirror transposition on all runs in the preliminary structuring element region with the anchor point as the mirror point to obtain the structuring element region.
[0041] In step S110, first, an image is acquired, and the acquired image is binarized to obtain a binary image. If the gray value of a pixel is higher than the threshold, the pixel is classified as the foreground with a value of 255; conversely, if the gray value of a pixel is lower than the threshold, the pixel is classified as the background with a value of 0. Represent the adjacent consecutive pixels with a value of 255 in the binary image in the form of run-length encoding to obtain a run-length encoding set, and the run-length encoding set is defined as a region.
[0042] A run is defined as A region is defined as , where row is the row coordinate of the consecutive pixels with a value of 255 in a certain row of the binary image, cb is the starting column coordinate of the adjacent consecutive pixels with a value of 255, ce is the ending column coordinate of the adjacent consecutive pixels with a value of 255. Therefore, the consecutive pixels with a value of 255 in a certain row of the binary image can be encoded into a run. Perform run-length encoding on the binary image row by row and column by column, and finally form a set of runs, that is, a region . As Figure 3 shown in the binary image, where the pixel value of the white square is 0 and the pixel value of the gray square is 255. Perform run-length encoding on it row by row and column by column in sequence to obtain 5 sets of runs runLength1={row = 0,cb = 1,ce = 3}, runLength2={row = 1,cb = 0,ce = 4} , runLength3={row = 2,cb = 1,ce = 1}, runLength4={row = 2,cb = 3,ce = 3}, runLength5={row = 4,cb = 0,ce = 3}.
[0043] In step S120, process the specified structuring element into a region form, perform run-length encoding on the structuring element to obtain the structuring element region , calculate the centroid of the region as the structuring element anchor point anchor=(anchorx, anchory), and the centroid of the region is defined as the centroid formed by all points in the region. Transpose the region according to the anchor point, that is, mirror it, to obtain the region representation of the final structuring element . Among them, the transposition of the region is the mirror image of each run in the region with respect to the anchor point , namely .
[0044] As Figure 4 shown, it describes the process of converting a 3x3 rectangular structuring element into a region. First, the structuring element is converted into a run-length set, i.e., the region runLength1 = {row = 0, cb = 0, ce = 2}, runLength2 = {row = 1, cb = 0, ce = 2}, runLength3 = {row = 2, cb = 0, ce = 2}. Then, the centroid of the region, i.e., the anchor point anchor = (1, 1), is calculated. Finally, all runs in the region are mirrored with the anchor point as the mirror point to complete the transposition of the region, obtaining runLength1 = {row = 1, cb = -1, ce = 1}, runLength2 = {row = 0, cb = -1, ce = 1}, runLength3 = {row = -1, cb = -1, ce = 1}.
[0045] In one embodiment, the specific steps of separately finding the start and end rows of the runs in the target region and the structuring element region to determine the row interval where the runs in the target region are located after erosion include: Based on the transposition of the structuring element region, find the start and end rows of the runs in the structuring element region, including the minimum row and the maximum row of the structuring element region; Find the start and end rows of the runs in the target region, including the minimum row and the maximum row of the target region; According to the minimum row and the maximum row of the target region and the minimum row and the maximum row of the structuring element region, determine the minimum row, the maximum row, and the row interval where the runs in the target region are located after erosion.
[0046] Specifically, the system first independently analyzes the two run-length encoded regions generated by step S100, the target region and the structuring element region. For the target region, the system traverses all the run segments recorded therein and identifies the topmost row number and the bottommost row number where these run segments appear, so as to determine the actual distribution boundary of the target image content in the vertical direction. Find the minimum row minRowRe and the maximum row maxRowRe of the runs in the target region. Similarly, the system also performs a similar operation on the structuring element region to find the minimum row minRowSt and the maximum row maxRowSt occupied by all the run segments of the structuring element itself.
[0047] Next, it is necessary to determine all the row positions where the anchor points of the structuring element may be placed and produce effective erosion results when the structuring element slides above the target image. This is calculated by considering the height of the structuring element, that is, its own row span and the vertical extension range of the structuring element relative to its center point. For example, how many rows are above the center point and how many rows are below it, and combining with the effective row range of the target image. The formula is as follows: ; . That is, the rows where the runs of the target area after erosion are located must be in the interval [minRow, maxRow]. This is equivalent to calculating the runs that may exist on each row in the interval [minRow, maxRow]. The steps of this embodiment narrow the range of target rows that need to be processed in detail later, avoiding unnecessary calculations on rows where results are impossible to appear, thus laying the foundation for the efficiency of the entire optimization algorithm.
[0048] In one embodiment, the row interval where the runs in the target area after erosion are located is defined as the calculation interval. Within the calculation interval, the row corresponding to the row where the anchor point of the structuring element area is located is the target row of the calculation interval.
[0049] Specifically, the above embodiment has defined the rows where the runs in the target area after erosion are located in the interval [minRow, maxRow] as the calculation interval. This interval represents all the positions where the erosion results may actually appear in the vertical direction. After determining this calculation interval, the system processes each row within this interval. At this time, the concept of "target row" becomes crucial. The "target row" specifically refers to the row currently being processed within the calculation interval. The key connection here is the "anchor point" of the structuring element. The anchor point of the structuring element usually represents its center point. In the erosion operation, when the anchor point of the structuring element is placed on a specific row of the target image, that row is defined as the "target row" corresponding to this placement operation. In other words, when the system considers aligning the anchor point of the structuring element to a certain row (i.e., the target row) within the calculation interval, it is essentially evaluating: if the center of the structuring element falls on this row, can the entire structuring element template be completely "fitted" within the foreground area of the current target image. Therefore, during the process of traversing the calculation interval, each row corresponding to the anchor point position of the structuring element will successively become the target row. The system will perform key steps such as subsequent run mapping, constraint contraction, and result synthesis for each such target row to finally determine which column positions on this row can produce effective erosion result foreground pixels.
[0050] In one embodiment, within the row interval where the runs in the target area after erosion are located, when it is checked that there are runs on the target row, the specific steps for column interval contraction of the runs corresponding to each run in the structuring element area on the row in the target area to obtain a plurality of column interval contraction sets include: S310: Detect whether there is a run in the target row within the calculation interval; S320: When it is detected that there is a run in the target row, perform column interval contraction on the runs corresponding to each run in the structural element region on the row corresponding to the target region to obtain multiple column interval contraction sets; S330: When it is detected that there is no run in the target row, detect whether there is a run in the next target row within the calculation interval.
[0051] In step S310, its function is for quick screening. It checks whether any valid run data is included in the target row within the target region that is currently being processed. If there is no run on the target row, it means that the row is completely composed of background pixels and is a blank row. In the morphological erosion operation, if the structural element region is projected onto such a blank row, its erosion result will necessarily also be blank. Therefore, the working principle of this step is to provide a key decision basis for subsequent steps by detecting the "blank" state of the target row: if it is empty, the cumbersome calculations for this row can be directly skipped. Specifically, for the run existing on the row row in the calculation interval [minRow, maxRow], first perform an existence detection on row to improve the erosion efficiency, that is, detect whether there is an eroded run on row. If so, further calculate the possible run on row; if not, proceed to the next row row + 1. Traverse each run in the structural element region st to obtain the row stRow where it is located i , and detect whether there is a run in the target row row + stRow i in the target region Region. If there is a run on the row corresponding to each stRowi of the structural element st i in the target region Region, then the possible run on row can be further calculated; if not, proceed to the next row row + 1.
[0052] In step S320, when it is confirmed that there is a foreground run in the target row, it means that this row may produce the output result after erosion. Its function is to perform precise constraint calculations on the run intervals on the target row that may be covered by the structuring element according to the geometric characteristics of the structuring element. Its working principle is as follows: Traverse each run within the structuring element area. For each run within the structuring element area, find all the runs on the corresponding rows related to the target row in the target area. Then, based on the column interval range of the current run of the structuring element, perform a "shrinking" operation on the column intervals of the runs on these corresponding rows in the target area. This "shrinking" essentially calculates the column-direction intersection constraint between the pixel area covered by the structuring element at the current projection position and the runs in the corresponding area of the target image. A structuring element run usually generates a set of shrunk column intervals, representing the effective contribution range of this part of the structuring element to the column interval of the final erosion result on the target row. After traversing all the structuring element runs, multiple such sets of column interval shrinks will be obtained.
[0053] For example, find the i-th run in the structuring element st The generated target row of the structuring element is row + stRow i All k runs on the corresponding rows in the target region Region . Use the column interval of the structuring element run stRunLength i to perform column interval shrinking on the column intervals of all runs in the set one by one to obtain all the sets of effective column intervals after shrinking , where , , and .
[0054] In step S330, when it is determined that the current target row is a blank row, all erosion calculations for this row are skipped efficiently. When the result of S310 indicates that there is no run in the target row, this step takes effect immediately, instructing the processing flow to directly move to the next row to be processed defined within the calculation interval and re-trigger S310 to detect this new row. This avoids any column interval shrinking calculations on known invalid rows, significantly improving the algorithm efficiency, especially when the image contains large blank areas.
[0055] In one embodiment, the specific steps for detecting whether there is a run in the target row in the detection calculation interval include: Detect whether there is at least one run in the target row of the detection calculation interval; When it is detected that there is at least one run in the target row, traverse each run in the structuring element area and obtain the target row of the structuring element where it is located, and detect whether there is a run in the row corresponding to the target row of the structuring element in the target area; When it is detected that there are runs in all rows corresponding to the structural element target row in the target area, it is determined that a run exists on the target row. When it is detected that there is no run on the target row / there is no run on any row corresponding to the target row in the target area, it is detected whether there is at least one run in the next target row in the calculation interval.
[0056] It can be understood that it is judged whether the current target row contains at least one foreground run. If there is no run in the target row itself, according to the principle of morphological erosion, the structural element cannot be completely contained in the area where the row is located, and there must be no valid output for this row. At this time, the process jump is immediately triggered to avoid invalid calculations. When the target row is itself valid, this step performs a deep verification of the corrosion feasibility. For each independent run in the structural element area, the row position structural element target row where it is located is obtained. The structural element target row is mapped to the corresponding row in the target area, and it is checked whether there is at least one run in these mapped rows. This step ensures that each row of the input image covered by the structural element in the vertical direction has foreground pixel support. When and only when there are runs in all structural element mapped rows, it is determined that the target row passes the corrosion feasibility verification. This does not mean that there is a run in the target row itself, but it is confirmed that the vertical condition that the structural element completely covers the foreground is satisfied, and the column direction contraction calculation can be continued.
[0057] If it is detected in the first layer that there is no run in the target row, or there is no run in any mapped row in the second layer detection, it is determined that there is no corrosion result for the current target row. The working principle is to immediately terminate the subsequent processing of this row and jump to the next target row in the calculation interval to re-trigger the first layer detection. This design significantly reduces the amount of invalid calculations through a two-level fast failure mechanism.
[0058] In one embodiment, the specific steps of performing column interval contraction on the runs on the corresponding rows in the target area for each run in the structural element area when it is detected that there is a run on the target row to obtain a plurality of column interval contraction sets include: When it is detected that there is a run on the target row, traverse each run in the structural element area and obtain the structural element target row where it is located, and read all the runs on the row corresponding to the structural element target row in the target area; Perform column interval contraction on all the runs on the row corresponding to the structural element target row in the target area to obtain a plurality of column interval contraction sets.
[0059] Specifically, when it is detected that there is a run on the target row, the system processes each independent run in the structural element area one by one. For each structural element target row, the algorithm maps it to the corresponding row coordinate position in the target area. Search for the i-th run in the structural element st The generated structural element target row row + stRow iAll k run sets on the corresponding rows in the target region Region . Subsequently, the column interval data of all runs on the mapped row is completely read, and the column interval pair set of the structural element run stRunLength i is used to perform column interval contraction on the column intervals of all runs in one by one, obtaining all the effective column interval sets after contraction , where , , and . Through this process, each structural element run is associated with the set of all runs on the corresponding row in the target image.
[0060] In one embodiment, when there is no empty set in the multiple column interval contraction sets, the column intervals in all column interval contraction sets are iteratively intersected to obtain all the eroded result column intervals on the target row, and the runs are formed by the row number of the target row and the corresponding result column intervals to obtain the specific steps of the erosion result on each row, including: S410: Determine whether there is an empty set in the multiple column interval contraction sets; S420: When there is no empty set in the multiple column interval contraction sets, the column intervals in all column interval contraction sets are iteratively intersected to obtain all the eroded result column intervals on the target row to obtain the erosion result of the target row, and detect whether there is a run in the next target row in the calculation interval; S430: When there is an empty set in the multiple column interval contraction sets, detect whether there is a run in the next target row in the calculation interval.
[0061] In step S410, the column interval contraction step processing is performed on each run in the structural element st, obtaining the column interval set after contraction of the column intervals of all runs on the corresponding row of each run in st in region . Determine whether there is a set that is empty. If so, go to the next row row+1. If not, continue to the next step.
[0062] In step S420, for all sets in, the column intervals are iteratively intersected. If there is such a result intersection, it is retained. Otherwise, go to the next row row+1. Specifically, take out and the column interval sets and intersect their column intervals. The intersection result column interval set describes that the coverage range, that is, the column intervals belonging to also belong to Column intervals. If there is such a set of column intervals, it is used as the result set of column intervals, and then the result set of column intervals is intersected with continuously, and this iteration continues until the intersection with is completed. If the result set of column intervals is not empty, a run set is formed by combining the row number of the target row and the column intervals therein, and the retained result is the result on row row after the structuring element st and the region Region are eroded. Then, continue to the (row + 1)-th row; if it is empty, also go to the (row + 1)-th row.
[0063] The intersection calculation of two column intervals is as follows , , if then the two column intervals have an intersection, and the intersection is , otherwise the two column intervals have no intersection.
[0064] In step S430, when the set of any column interval contraction detected by S410 is empty, all subsequent operations of the current row are immediately terminated, and the control flow directly jumps to the next adjacent row row + 1 within the calculation interval, and the above steps S300~S400 are repeated until the maxRow-th row, thereby completing the erosion of the region Region by the structuring element st.
[0065] In one embodiment, the following steps are further included: Obtain the erosion results of all target rows in the calculation interval to generate an eroded binary image. The system collects the erosion output results of all target rows within the calculation interval, which are organized in run-length encoding form. Each valid run contains accurate row coordinates, starting column coordinates, and ending column coordinates information. By traversing the set of rows in the entire calculation interval, all discrete erosion runs are integrated into a unified run dataset in row number order. This dataset completely describes the geometric distribution characteristics of all continuous foreground regions in the eroded image. Based on the obtained erosion run dataset, the system performs an image reconstruction operation, initializes a blank binary matrix with the same size as the original image, and all pixels are default set to the background value. Subsequently, each erosion run record is traversed, and according to its row coordinates and column coordinate ranges, the corresponding continuous pixel segment in the image matrix is set to the foreground value. This process is achieved through efficient block filling operations, avoiding the overhead of per-pixel processing. The finally generated binary image intuitively presents the topological effect of morphological erosion. Each foreground pixel region in the image precisely corresponds to the position in the original target region where the structuring element is completely covered. The background region clearly shows the part removed by erosion, forming a spatial filtering result that conforms to the morphological principle. This output image retains the spatial resolution and geometric characteristics of the original image and can be directly used for subsequent image analysis tasks.
[0066] Combining all the above embodiments, as Figure 2 shown, the specific steps of an image erosion method based on run-length encoding include: First, collect an image and binarize the collected image to obtain a binary image. If the gray value of a pixel is higher than the threshold, the pixel is classified as the foreground with a value of 255; conversely, if the gray value of a pixel is lower than the threshold, the pixel is classified as the background with a value of 0. Represent the adjacent continuous pixels with a value of 255 in the binary image in the form of run-length encoding to obtain a run-length encoding set, and the run-length encoding set is defined as a region.
[0067] The run is defined as The region is defined as , where row is the row coordinate of the continuous pixels with a value of 255 in a certain row of the binary image, cb is the starting column coordinate of the adjacent continuous pixels with a value of 255, ce is the ending column coordinate of the adjacent continuous pixels with a value of 255. Therefore, the continuous pixels with a value of 255 in a certain row of the binary image can be encoded into a run. Perform run-length encoding on the binary image row by row and column by column, and finally form a run set, that is, a region . For example, Figure 3 for the binary image shown, where the pixel value of the white square is 0 and the pixel value of the gray square is 255. Perform run-length encoding on it row by row and column by column in sequence to obtain 5 run sets: runLength1={row = 0,cb = 1,ce = 3}, runLength2={row = 1,cb = 0,ce = 4} , runLength3={row = 2,cb = 1,ce = 1}, runLength4={row = 2,cb = 3,ce = 3}, runLength5={row = 4,cb = 0,ce = 3}.
[0068] Process the specified structuring element into a region form, perform run-length encoding on the structuring element to obtain the structuring element region , calculate the centroid of the region as the structuring element anchor point anchor=(anchorx, anchory). The centroid of the region is defined as the centroid formed by all points in the region. Transpose the region according to the anchor point, that is, mirror it to obtain the region representation of the final structuring element . Among them, the transpose of the region is the mirror image of each run in the region with respect to the anchor point , that is .
[0069] For example, Figure 4As shown, the process of converting a 3x3 rectangular structuring element into a region is described. First, the structuring element is converted into a run-length set, i.e., the region runLength1 = {row = 0, cb = 0, ce = 2}, runLength2 = {row = 1, cb = 0, ce = 2}, runLength3 = {row = 2, cb = 0, ce = 2}. Then, the centroid of the region, i.e., the anchor point anchor = (1, 1), is calculated. Finally, all runs in the region are mirrored with the anchor point as the mirror point to complete the transposition of the region, obtaining runLength1 = {row = 1, cb = -1, ce = 1}, runLength2 = {row = 0, cb = -1, ce = 1}, runLength3 = {row = -1, cb = -1, ce = 1}.
[0070] Find the minimum row minRowRe and the maximum row maxRowRe of the runs in the target region. Similarly, the system performs a similar operation on the structuring element region to find the minimum row minRowSt and the maximum row maxRowSt occupied by all run segments of the structuring element itself.
[0071] Next, it is necessary to determine all the row positions where the anchor point of the structuring element may be placed and produce an effective erosion result when the structuring element slides above the target image. This is calculated by considering the height of the structuring element, i.e., its own row span and the upper and lower extension ranges of the structuring element relative to its center point. For example, how many rows are above the center point and how many rows are below it, and combining with the effective row range of the target image. The formula is as follows: ; . That is, the rows where the runs of the target region are located after erosion must be in the interval [minRow, maxRow]. This is equivalent to calculating the possible runs on each row in the interval [minRow, maxRow].
[0072] First, perform an existence check on row to improve the erosion efficiency, i.e., check whether there is a run after erosion on the row row. If so, further calculate the possible runs on the row row; if not, go to the next row row + 1. Traverse each run in the structuring element region st to obtain its corresponding row stRow i , check whether there is a run in the target row row + stRow i in the target region Region. If for all stRow i of the structuring element st iIf there are runs on all the corresponding rows in the target region Region, the runs that may exist in the row row can be further calculated; otherwise, go to the next row row+1.
[0073] Find the i-th run in the structuring element st The target row of the generated structuring element row+stRow i All k run sets on the corresponding rows in the target region Region . Subsequently, completely read the column interval data of all runs on this mapped row, and use the column interval pair set of the structuring element run stRunLength i to contract the column intervals of all runs in one by one to obtain the set of all effective column intervals after contraction , where , , and . Through this process, each structuring element run is associated with the set of all runs on the corresponding row in the target image.
[0074] Perform the column interval contraction step processing on each run in the structuring element st to obtain the set of column intervals after contraction of the column intervals of all runs on the corresponding row of each run in st in region . Judge whether there is a set in that is empty. If so, go to the next row row+1; if not, continue with the next step.
[0075] For all sets in , iteratively find the intersection of the column intervals. If there is such an intersection result, keep it; otherwise, go to the next row row+1. Specifically, take out and the column interval sets and find the intersection of their column intervals. The intersection result column interval set describes the coverage range, that is, the column intervals belonging to also belong to the column intervals. If there is such a column interval set, use it as the result column interval set, and then continue to find the intersection of the result column interval set with , and so on until the intersection with is completed. If the result column interval set is not empty, combine the row number of the target row with the column intervals in it to form a run set, which is the result of the erosion of the structuring element st and the region Region on the row row, and then continue to enter the row row+1; if it is empty, also enter the row row+1.
[0076] The calculation of the intersection of two column intervals is as follows , , if Then the two column intervals have an intersection, and the intersection is , otherwise the two column intervals have no intersection.
[0077] Repeat the above steps until the maxRow-th row, thereby completing the erosion of the region Region by the structuring element st.
[0078] In addition, to achieve the above object, the present application also proposes an image processing apparatus, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the above-described run-length encoding-based image erosion method. The image processing apparatus provided by the present application adopts the run-length encoding-based image erosion method in the above embodiment, and can solve the technical problems that the existing morphological erosion algorithm consumes a large amount of computing resources and has low processing efficiency when processing high-resolution binary images or using a large structuring element, and it is difficult to meet the industrial real-time requirements. Compared with the prior art, the beneficial effects of the image processing apparatus provided by the present application are the same as those of the run-length encoding-based image erosion method provided by the above embodiment, and other technical features in the image processing apparatus are the same as those disclosed in the method of the previous embodiment, and will not be described in detail here.
[0079] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0080] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0081] The above is only a partial embodiment of the present application, and thus does not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or directly / indirectly applied to other related technical fields, is included in the patent protection scope of the present application.
Claims
1. An image erosion method based on run-length encoding, characterized in that, Including the following steps: Obtain a binary image and a preset structuring element, and perform run-length encoding on the binary image and the structuring element respectively to obtain a target region and a structuring element region; Find the start and end rows of the runs in the target region and the structuring element region respectively to determine the row interval where the runs in the target region are located after erosion; Within the row interval where the runs in the target region are located after erosion, when it is detected that there is a run on the target row, perform column interval contraction on the runs corresponding to each run in the structuring element region on the row corresponding to the target region in the target region to obtain a plurality of column interval contraction sets; When there is no empty set among the plurality of column interval contraction sets, iteratively find the intersection of the column intervals in all column interval contraction sets to obtain all the eroded result column intervals on the target row, and form a run with the row number of the target row and the result column interval corresponding to the target row to obtain the erosion result for each row; 2. The image erosion method based on run length encoding according to claim 1, wherein: The specific steps of obtaining the binary image and the preset structuring element, and performing run-length encoding on the binary image and the structuring element respectively to obtain the target region and the structuring element region include: Obtain a binary image, perform run-length encoding on the binary image, and define it as the target region; Input the preset structuring element, perform run-length encoding on the structuring element to obtain the run set of the structuring element, define it as the preliminary structuring element region, calculate the anchor point of the preliminary structuring element region, and perform mirror transposition on all runs in the preliminary structuring element region with the anchor point as the mirror point to obtain the structuring element region; 3. The method for image erosion based on run-length encoding according to claim 2, wherein, The specific steps of finding the start and end rows of the runs in the target region and the structuring element region respectively to determine the row interval where the runs in the target region are located after erosion include: Based on the transposition of the structuring element region, find the start and end rows of the runs in the structuring element region, including the minimum row and the maximum row of the structuring element region; Find the start and end rows of the runs in the target region, including the minimum row and the maximum row of the target region; According to the minimum row and the maximum row of the target region and the minimum row and the maximum row of the structuring element region, determine the minimum row, the maximum row and the row interval where the runs in the target region are located after erosion; 4. The method for image erosion based on run-length encoding according to claim 3, wherein, Define the row interval where the runs in the target region are located after erosion as the calculation interval. Within the calculation interval, the row corresponding to the row where the anchor point of the structuring element region is located is the target row of the calculation interval; 5. The image erosion method based on run-length encoding according to claim 4, characterized in that, The specific steps of performing column interval contraction on the runs corresponding to each run in the structuring element region on the row corresponding to the target region in the target region within the row interval where the runs in the target region are located after erosion to obtain a plurality of column interval contraction sets include: Detect whether there is a run on the target row in the calculation interval; When it is detected that there is a run on the target row, perform column interval contraction on the runs corresponding to each run in the structuring element region on the row corresponding to the target region in the target region to obtain a plurality of column interval contraction sets; When it is detected that there is no run on the target row, detect whether there is a run on the next target row in the calculation interval; 6. The image erosion method based on run-length encoding according to claim 5, wherein The specific steps of detecting whether there is a run on the target row in the calculation interval include: Detect whether there is at least one run on the target row in the calculation interval; When at least one run is detected in the target row, traverse each run in the structuring element region and obtain the corresponding structuring element target row where it is located, and detect whether there is a run in the row corresponding to the structuring element target row in the target region; When it is detected that there are runs in all rows corresponding to the structuring element target row in the target region, it is determined that a run is detected on the target row; When it is detected that there is no run on the target row / there is no run on any row corresponding to the target row in the target region, detect whether there is at least one run in the next target row in the calculation interval.
7. The method for image erosion based on run-length encoding according to claim 5, wherein The specific steps of performing column interval contraction on the runs corresponding to each run in the structuring element region on the corresponding rows in the target region to obtain a plurality of column interval contraction sets when it is detected that there is a run on the target row include: When it is detected that there is a run on the target row, traverse each run in the structuring element region and obtain the corresponding structuring element target row where it is located, and read all the runs in the row corresponding to the structuring element target row in the target region; Perform column interval contraction on all the runs in the row corresponding to the structuring element target row in the target region to obtain a plurality of column interval contraction sets.
8. The method for image erosion based on run-length encoding according to claim 4, wherein When there is no case where a set is empty among the plurality of column interval contraction sets, the specific steps of iteratively finding the intersection of the column intervals in all the column interval contraction sets to obtain all the eroded result column intervals on the target row, and forming runs from the row number of the target row and the corresponding result column intervals to obtain the erosion results on each row include: Judge whether there is a case where a set is empty among the plurality of column interval contraction sets; When there is no case where a set is empty among the plurality of column interval contraction sets, iteratively find the intersection of the column intervals in all the column interval contraction sets to obtain all the eroded result column intervals on the target row, form runs from the row number of the target row and the corresponding result column intervals to obtain the erosion result on the target row, and detect whether there is a run in the next target row in the calculation interval; When there is a case where a set is empty among the plurality of column interval contraction sets, detect whether there is a run in the next target row in the calculation interval.
9. The method for image erosion based on run-length encoding according to claim 8, wherein, It further includes the following steps: Obtain the erosion results of all target rows in the calculation interval and generate an eroded binary image.
10. An image processing device, characterized in that: It includes: A memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program is configured to implement the steps of the run-length encoding-based image erosion method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Rapid area erosion algorithm and device based on random structural element of run-length encoding
CN106600655A
Rapid region expansion algorithm and device of any structure element based on stroke coding
CN106709892A
Image processing method, terminal equipment and computer storage medium
CN116579957A
Image processing method and image processing terminal
CN120047320A
Thinning method, thinning apparatus, and computer-readable program
EP4478278A1