Image processing method and image processing terminal

By independently processing the row and column directions of the images, and using stroke coding and structural element matrix for morphological processing, the problem of insufficient image processing accuracy, efficiency and applicability in the prior art is solved, and a more flexible and efficient image processing effect is achieved.

CN120047320APending Publication Date: 2025-05-27GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Application Number
CN202510119764.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-25
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Existing image processing technologies have shortcomings in terms of processing accuracy, efficiency and applicability, especially when processing images containing tiny objects or complex structures, the overall processing method is difficult to accurately capture details, resulting in loss of information, and faces bottlenecks in data storage and transmission during large-scale image data processing.

Method used

By independently processing the image in row and column directions, morphological processing is performed using stroke encoding and structural element matrix, including corrosion and expansion operations, to achieve more flexible and efficient image processing.

Benefits of technology

It improves the flexibility, accuracy and efficiency of image processing, enables more flexibility in extracting and enhancing specific shapes and structures, significantly reduces the overhead of data storage and transmission, is suitable for large-scale image data processing, and improves processing speed and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047320A_ABST
    Figure CN120047320A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and provides an image processing method and an image processing terminal, and the method comprises the following steps: obtaining an original binary image from an image source, and carrying out the preprocessing of the original binary image; performing run-length coding on the preprocessed binary image to obtain an image data result after run-length coding; performing morphological processing on the image in the row direction by using the structural element matrix; re-integrating each row of data processed in the row direction into a complete image representation, and performing morphological processing in the column direction; taking a processing result in the column direction as a binary morphological calculation result of the original binary image; according to the method, the image is independently processed in the row direction and the column direction, specific shapes and structures can be more flexibly extracted and enhanced, proper structural elements are adopted according to specific application requirements, and the processing effect can be optimized; by using the run-length coding to represent the image, the overhead of data storage and transmission can be significantly reduced, and the processing speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and specifically relates to an image processing method and an image processing terminal. Background Art

[0002] In the field of modern image processing, the processing of binary images is the basis for many computer vision and image analysis tasks. Currently, commonly used methods mainly include traditional morphological operations such as erosion, dilation, and composite methods combined with other technologies. However, existing image processing technologies still have significant deficiencies in terms of processing accuracy, efficiency, and applicability;

[0003] Many existing image processing methods often rely on global processing, which means that images are usually treated as a whole for operations. This method lacks in-depth attention to local features in the image, resulting in insufficient flexibility in extracting specific shapes and structures. For example, when processing images containing small objects or complex structures, global processing may not accurately capture these details, leading to the loss of important information. This lack of targeted processing often affects the accuracy of image analysis and subsequent decision-making in practical applications; Existing technologies usually face bottlenecks in data storage and transmission when dealing with large-scale image data. Most image processing methods require high storage space and high computing power for operating on image data, especially when processing high-resolution and long-time series data. Traditional image representation methods such as bitmaps have high requirements for storage and computing resources, resulting in severely limited processing speeds in practical applications such as medical imaging and satellite image analysis, making it difficult to meet the requirements of real-time processing. Existing image morphological algorithms usually can only perform a single type of operation, and the processing process lacks flexibility. The erosion and dilation operations of pixels are usually linear and can only be performed separately, without being able to combine multiple operations. For example, when using advanced image noise removal techniques and enhancement operations, users need to manually adjust multiple parameters and perform multiple processes, and the final result depends on the user's experience and understanding of image features, with a complex operation process and difficulty in optimization.

[0004] Therefore, those skilled in the art have proposed an image processing method and an image processing terminal, aiming to provide a more flexible and efficient solution through independent processing in the row direction and column direction, effectively improving the flexibility, accuracy, and efficiency of processing. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides an image processing method and an image processing terminal to solve the problems raised in the background art.

[0006] According to a first aspect of the present disclosure, there is provided an image processing method, including the following steps:

[0007] S1. Obtain the original binary image from the image source, and preprocess the binary image so that the image is stored in binary form, that is, each pixel is 0 or 1;

[0008] S2. Perform run-length encoding on the preprocessed binary image to obtain the run-length encoded image data result;

[0009] S3. Based on the run-length encoded image data result, use the structuring element matrix to perform morphological processing on the image in the row direction to obtain the processing result in the row direction;

[0010] S4. Based on the processing result in the row direction, reorganize each row of data after row direction processing into a complete image representation, perform morphological processing in the column direction, and obtain the processing result in the column direction;

[0011] S5. Take the processing result in the column direction as the binary morphological calculation result of the original binary image.

[0012] Preferably, in step S1, the image source includes a camera, a scanner or a storage device. Preprocessing the original binary image includes grayscale conversion and binarization processing;

[0013] The grayscale conversion is to convert the color image in the obtained original binary image into a grayscale image, which is expressed as:

[0014] I gray (x,y) = 0.2989·I R (x,y) + 0.5870·I G (x,y) + 0.1140·I B (x,y)

[0015] where, I R (x,y), I G (x,y), I B (x,y) are the pixel values of the red, green, and blue channels at the position (x,y) respectively;

[0016] The binarization processing is to convert the grayscale image into a binary image by setting a threshold T, which is expressed as:

[0017]

[0018] After binarization, each pixel value is 0 or 1, forming a binary matrix to represent the binary image.

[0019] Preferably, in step S2, when performing run-length encoding on the preprocessed binary image, the obtained binary image is divided into blocks according to the height of the image and the number of processor cores. The number of processor cores is P, and the image is divided into P blocks. The block division operation is expressed as:

[0020]

[0021] Among them, h represents the height of each block, and H represents the height of the binary image;

[0022] For the index i of each block, that is, from 0 to P-1, the corresponding image block B i is calculated as:

[0023] B i = [i·h:min((i + 1)·h, H), :]

[0024] The heights of each generated block are equal or unequal;

[0025] Assign each image block B i to the processor core T i , and perform run-length encoding on each image block in parallel; given B as a binary image block, the resulting encoded result R is expressed as:

[0026] R = {(v 1 , n 1 ), (v 2 , n 2 ),..., (v k , n k )}

[0027] Among them, v i is 0 or 1, and n i is the number of consecutive occurrences of this value;

[0028] After completing the run-length encoding of all image blocks, integrate the results output by each processor core into an overall run-length encoding representation R total , then the integration process is represented by splicing as:

[0029]

[0030] Among them, represents the merging of the encoded results in sequence.

[0031] Preferably, in step S3, by defining the structuring element matrix SE as a one-dimensional or two-dimensional binary matrix, reconstruct the row sequence of the binary image according to the run-length encoding result R obtained in step S2, and perform morphological processing on the image in the row direction, including erosion and dilation processing in the row direction;

[0032] For each row i, check each pixel position j and decide whether to keep this point, then the erosion operation in the row direction is expressed as:

[0033]

[0034] Where m is the position offset of the structural element SE;

[0035] For each row i, the dilation operation in the row direction is expressed as:

[0036]

[0037] Combining the erosion and dilation operations in the row direction to obtain the processed result.

[0038] Preferably, based on the processing result in the row direction of step S4, each row of data after row direction processing is re-integrated into a complete image representation. Through format conversion or structural adjustment, the row data is directly written back to a new two-dimensional matrix, and erosion and dilation operations in the column direction are performed;

[0039] Using the previously defined structural element matrix SE to perform the erosion operation in the column direction. For each column j, the erosion operation is expressed as:

[0040]

[0041] For each column j, the dilation operation is expressed as:

[0042]

[0043] When performing the operations in the column direction, combinations of only erosion, only dilation, or erosion followed by dilation are performed;

[0044] After performing the operations in the column direction, the intersection and union of the processing results in the row direction are used to ensure the correctness of the operations. The intersection operation is expressed as: I″ i,j = I′ i,j ∩I′ row,i,j , where I″ i,j represents the pixel value at the i-th row and j-th column in the final image obtained after column direction processing and then row direction processing. I′ i,j represents the pixel value at the i-th row and j-th column in the image after only column direction processing. I′ row,i,j represents the pixel value at the i-th row and j-th column in the image after row direction processing of the image. The intersection operation is used to indicate that only pixels that are 1 in both processing results remain 1;

[0045] The union operation is expressed as: I″ i,j = I′ i,j ∪I′ row,i,j , and the union operation is used to indicate that pixels that are 1 in any of the processing results remain 1.

[0046] Preferably, the image processing result after column - direction erosion and dilation processing in step S5 is output as the binary morphological calculation result of the original binary image. For erosion, the result is expressed as:

[0047]

[0048] where I(x, y) is the original image, SE is the structuring element, and ∧ represents taking the minimum value in the local region;

[0049] For dilation, the result is expressed as:

[0050]

[0051] where ∨ represents taking the maximum value in the local region; Combining the erosion and dilation operations, the result of binary morphological calculation is finally calculated.

[0052] According to the second aspect of the present disclosure, an image processing terminal is proposed, which is applied to the image processing method of the first aspect. It includes an image acquisition device for acquiring an image and performing pre - processing to obtain an original binary image;

[0053] A memory for storing the binary image pre - processed by the image acquisition device, as well as program data, including erosion and dilation algorithms, and a structuring element matrix;

[0054] A processor for executing the program data in the memory, performing run - length encoding on the binary image in the memory; performing morphological processing on the image in the row direction using the structuring element matrix; re - integrating each row of data processed in the row direction into a complete image representation and performing morphological processing in the column direction; taking the processing result in the column direction as the binary morphological calculation result of the original binary image.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] 1. By independently processing the image in the row direction and column direction, the present invention can more flexibly extract and enhance specific shapes and structures, and adopt appropriate structuring elements according to specific application requirements, which can optimize the processing effect; By using run - length encoding to represent the image, the overhead of data storage and transmission can be significantly reduced, the processing speed can be improved, and it is suitable for large - scale image data processing. Splitting the processing into the row direction and column direction makes each step clearer and is convenient for debugging and optimization.

[0057] 2. The present invention can select morphological operations such as erosion, dilation, erosion followed by dilation, or other types according to actual needs to achieve more complex image analysis and processing tasks. Using the erosion operation can effectively remove noise elements in the image, making subsequent processing cleaner and more accurate. The dilation operation can effectively fill small holes or connect disconnected parts, making the appearance of the object more coherent and complete.

[0058] 3. Through interactive processing in the row direction and column direction, the present invention can better extract target information, improve the reliability of subsequent analysis and decision-making, has strong flexibility and application potential, and can also effectively improve the quality and speed of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 is a flowchart of the image processing method of the present invention;

[0060] Figure 2 is a schematic diagram of the image processing terminal of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0061] The following further describes in detail the embodiments of the present invention in conjunction with the drawings and embodiments. The following embodiments are used to illustrate the present invention, but cannot be used to limit the scope of the present invention.

[0062] As shown in the Figure 1 accompanying drawings:

[0063] Embodiment 1: The present invention provides an image processing method, including the following steps:

[0064] S1. Obtain the original binary image from the image source, and preprocess the binary image so that the image is stored in binary form, that is, each pixel point is 0 or 1; the image source includes a camera, a scanner or a storage device. Read the image data through an image acquisition device (such as a camera, a scanner) or from an existing digital image file (such as JPEG, PNG, etc.). Preprocess the original binary image, including grayscale conversion and binarization processing;

[0065] The grayscale conversion is to convert the color image in the obtained original binary image into a grayscale image, expressed as:

[0066] I gray (x, y) = 0.2989 · I R (x, y) + 0.5870 · I G (x, y) + 0.1140 · I B (x, y)

[0067] where, I R (x, y), I G (x, y), I B(x, y) are the pixel values of the red, green, and blue channels at the position (x, y);

[0068] The binarization process is to convert a grayscale image into a binary image by setting a threshold T, which is expressed as:

[0069]

[0070] After binarization, each pixel value becomes 0 or 1, forming a binary matrix to represent the binary image. The final binary image is stored in matrix form, where each element is only 0 or 1, facilitating subsequent processing and calculation.

[0071] S2. Perform run-length encoding on the preprocessed binary image to obtain the run-length encoded image data result; perform run-length encoding on the preprocessed binary image. The obtained binary image is divided into blocks according to the height of the image and the number of processor cores. The number of processor cores is P, and the image is divided into P blocks. The block division operation is expressed as:

[0072]

[0073] where h represents the height of each block, and H represents the height of the binary image;

[0074] For the index i of each block, that is, from 0 to P - 1, the corresponding image block B i is calculated as:

[0075] B i = [i·h:min((i + 1)·h, H), :]

[0076] The heights of the generated blocks are either equal or not equal;

[0077] Each image block B i is assigned to the processor core T i , and run-length encoding is performed on each image block in parallel; given B as a binary image block, the encoded result R is expressed as:

[0078] R = {(v 1 , n 1 ), (v 2 , n 2 ),...,(v k , n k )}

[0079] where v i is 0 or 1, and n i is the number of consecutive occurrences of this value;

[0080] After completing run-length encoding for all image blocks, the results output by each processor core are integrated into an overall run-length encoding representation Rtotal , the integration process is represented by concatenation as:

[0081]

[0082] where, represents the merging of sequences of the encoding results. Through the run-length encoding process, a compressed run-length encoding representation is obtained, which can effectively reduce the data volume and improve the efficiency of subsequent processing.

[0083] According to the height of the original binary image and the number of processor cores, the image is divided into multiple blocks, and the segmented images are assigned to the corresponding processor cores for run-length encoding. The encoding results of each processor core are integrated to form a compressed run-length encoding representation. Run-length encoding can efficiently represent continuous identical pixel regions in the image, thus providing a simplified data structure for subsequent processing steps.

[0084] S3. Based on the image data results after run-length encoding, use the structuring element matrix to perform morphological processing on the image in the row direction to obtain the processing results in the row direction; by defining the structuring element matrix SE as a one-dimensional or two-dimensional binary matrix, reconstruct the row sequence of the binary image according to the run-length encoding result R obtained in step S2, and use the structuring element matrix to perform morphological processing on the image in the row direction, including erosion and dilation processing in the row direction;

[0085] For each row i, check each pixel position j and decide whether to keep the point. Then the erosion operation in the row direction is represented as:

[0086]

[0087] where m is the position offset of the structuring element SE;

[0088] For each row i, the dilation operation in the row direction is represented as:

[0089]

[0090] Combining the erosion and dilation operations in the row direction, the processed results are obtained. By defining the structuring element matrix and using the decoded run-length encoding data, the erosion and dilation operations are respectively performed on the image in the row direction to obtain the processed results, effectively performing row processing on the binary image and enhancing or weakening specific features.

[0091] After completing run-length encoding, use the encoded data for erosion and / or dilation processing in the row direction. Through the defined structural element matrix, process the run-length encoding row by row to perform erosion or dilation operations. This process helps to eliminate small and meaningless objects or fill holes in objects, thereby optimizing the image content. The use of run-length encoding allows for efficient access and processing of all pixel regions, significantly improving the processing efficiency.

[0092] S4. Based on the processing results in the row direction, re-integrate the data of each row after row-direction processing into a complete image representation, and perform morphological processing in the column direction to obtain the processing results in the column direction; Based on the processing results in the row direction of step S3, re-integrate the data of each row after row-direction processing into a complete image representation. Through format conversion or structural adjustment, directly write the row data back to a new two-dimensional matrix, and perform column-direction erosion and dilation operations;

[0093] Use the previously defined structural element matrix SE to perform erosion operations in the column direction. For each column j, the erosion operation is expressed as:

[0094]

[0095] For each column j, the dilation operation is expressed as:

[0096]

[0097] When performing operations in the column direction, perform only erosion, only dilation, or a combination of erosion followed by dilation;

[0098] After performing operations in the column direction, use the intersection and union of the row-direction processing results to ensure the correctness of the operations. The intersection operation is expressed as: I″ i,j =I′ i,j ∩I′ row,i,j where I″ i,j represents the pixel value at the i-th row and j-th column in the final image obtained by performing row-direction processing after column-direction processing, I′ i,j represents the pixel value at the i-th row and j-th column in the image after only column-direction processing, and I′ row,i,j represents the pixel value at the i-th row and j-th column in the image after performing row-direction processing on the image. The intersection operation is used to indicate that only pixels that are 1 in both processing results remain 1;

[0099] The union operation is expressed as: I″ i,j =I′ i,j ∪I′ row,i,jThe union operation is used to indicate that pixels that are 1 in any processing result remain 1. By integrating the data processed in the row direction and then performing erosion and / or dilation operations in the column direction, a complete image processing process is formed. Combining erosion and dilation operations can effectively adjust image features, and the intersection and union operations ensure the accuracy of the final result. This process greatly improves the processing efficiency and texture of the image, making subsequent analysis and applications more reliable.

[0100] Based on the processing in the row direction, erosion and / or dilation processing in the column direction is carried out. Using the processing result in the row direction as the basis, further erosion or dilation operations are performed for each column. Through the intersection and union of the processing results in the row direction, the accuracy of the final result of erosion or dilation in the column direction is ensured. This process helps to refine the morphological features of the image and further improve the usability of the image.

[0101] S5. Use the processing result in the column direction as the binary morphological calculation result of the original binary image; Output the processing result of the image after erosion and dilation in the column direction as the binary morphological calculation result of the original binary image. In binary morphology, for erosion, the result is expressed as:

[0102]

[0103] where I(x, y) is the original image, SE is the structuring element, and ∧ represents selecting the minimum value in the local area;

[0104] In binary morphology, for dilation, the result is expressed as:

[0105]

[0106] where ∨ represents selecting the maximum value in the local area; Combining erosion and dilation operations, the result of binary morphological calculation is finally calculated. Through erosion or dilation processing in the row direction and column direction, the final binary morphological calculation result is generated. This result can be regarded as the reflection of the original binary image after morphological operation with the structuring element and has important significance for image feature extraction. The finally output result can be used for subsequent image analysis and processing tasks.

[0107] Through the above steps, the proposed image processing method realizes the efficient processing of binary images. From the acquisition of the original image to run-length encoding, and then to morphological processing in the row and column directions, accurate output results are finally generated, ensuring the efficiency and accuracy of the results.

[0108] Embodiment 2: The present invention also provides an image processing terminal, which is applied to the image processing method in Embodiment 1 and includes an image acquisition device for acquiring an image and performing preprocessing to obtain an original binary image;

[0109] A memory for storing the binary image preprocessed by the image acquisition device and program data, including erosion and dilation algorithms, and structure element matrices;

[0110] A processor for executing the program data in the memory, performing run-length encoding on the binary image in the memory; performing morphological processing on the image in the row direction using the structure element matrix; reorganizing each row of data processed in the row direction into a complete image representation and performing morphological processing in the column direction; and taking the processing result in the column direction as the binary morphological calculation result of the original binary image.

[0111] Importantly, it should be noted that the construction and arrangement of the present application shown in multiple different exemplary embodiments are merely illustrative. Although only a few embodiments are described in detail in this disclosure, those who refer to this disclosure should easily understand that many modifications are possible without substantially departing from the novel teachings and advantages of the subject matter described in this application. Other substitutions, modifications, changes, and omissions may be made in the design, operating conditions, and arrangement of the exemplary embodiments without departing from the scope of the present invention. Therefore, the present invention is not limited to specific embodiments, but extends to various modifications that still fall within the scope of the appended claims.

[0112] In addition, to provide a concise description of the exemplary embodiments, not all features of the actual embodiments may be described (i.e., those features that are not relevant to the currently considered best mode of implementing the present invention or those features that are not relevant to implementing the present invention).

[0113] It should be understood that in the development of any actual implementation, a large number of specific implementation decisions may be made in any engineering or design project. Such development efforts may be complex and time-consuming, but for those of ordinary skill in the art who benefit from this disclosure, without excessive experimentation, such development efforts will be a routine task of design, manufacturing, and production.

[0114] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention may be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. An image processing method, characterized in that: The following steps are involved: S1, obtaining the original binary image from the image source, preprocessing the binary image so that the image is stored in binary form, that is, each pixel is 0 or 1; S2, performing run length coding on the pre-processed binary image to obtain the image data result after run length coding; S3, based on the image data result after run length coding, using the structure element matrix to perform morphological processing on the image in the row direction to obtain the processing result in the row direction; S4, based on the processing result in the row direction, reintegrate each row of data after the processing in the row direction into a complete image representation, perform morphological processing in the column direction, and obtain the processing result in the column direction; S5. Using the processing result in the column direction as the binary morphological calculation result of the original binary image.

2. An image processing method as claimed in claim 1, characterized in that: In step S1, the image source includes a camera, a scanner or a storage device, and the original binary image is preprocessed, including grayscale conversion and binarization processing; The grayscale conversion is to convert the color image in the original binary image into a grayscale image, which is expressed as: I gray (x,y)=0.2989·I R (x,y)+0.5870·I G (x,y)+0.1140·I B (x,y) Among them, I R (x,y),I G (x,y),I B (x, y) are the pixel values ​​of the red, green, and blue channels at position (x, y) respectively; The binarization process converts the grayscale image into a binary image by setting a threshold T, which is expressed as: After the binarization is completed, each pixel value is set to 0 or 1, forming a binary matrix to represent the binary image.

3. An image processing method as claimed in claim 1, characterized in that: The step S2 performs run length encoding on the preprocessed binary image, and divides the acquired binary image into blocks according to the image height and the number of processor cores. The number of processor cores is P, and the image is divided into P blocks. The block operation is expressed as: Among them, h represents the height of each block, and H represents the height of the binary image; For each block index i, from 0 to P-1, the corresponding image block B i Calculated as: B i =[i·h:min((i+1)·h,H),:] The height of each block generated is equal or different; For each image block B i Assigned to processor core T i , run-length encoding is performed on each image block in parallel; given B is a binary image block, the encoding result R is expressed as: <h2 style=";text-align:left;direction:ltr">R = {(v1,n1),(v2,n2),...,(v<h2 style=";text-align:left;direction:ltr"> k <h2 style=";text-align:left;direction:ltr"> ,n<h2 style=";text-align:left;direction:ltr"> k <h2 style=";text-align:left;direction:ltr"> )} Among them, v i is a value of 0 or 1, n i is the number of consecutive occurrences of the value; After completing the run length encoding of all image blocks, the output results of each processor core are integrated into an overall run length encoding representation R total , then the integration process is expressed by splicing as: in, Indicates the merging of the encoding results into sequences.

4. An image processing method as claimed in claim 1, characterized in that: The step S3 defines the structure element matrix SE as a one-dimensional or two-dimensional binary matrix, reconstructs the row sequence of the binary image according to the run length encoding result R obtained in step S2, and uses the structure element matrix to perform morphological processing on the image in the row direction, including erosion and dilation processing in the row direction; For each row i, each pixel position j is checked and it is decided whether to keep the point. The row-wise erosion operation is expressed as: Where m is the position offset of the structural element SE; For each row i, the row-wise dilation operation is expressed as: The processed result is obtained by combining the row-wise erosion and dilation operations.

5. An image processing method as claimed in claim 1, characterized in that: The step S4, based on the processing result in the row direction of step S3, re-integrates each row of data processed in the row direction into a complete image representation, directly writes the row data back to the new two-dimensional matrix through format conversion or structure adjustment, and performs column-wise erosion and expansion operations; The previously defined structural element matrix SE is used to perform the column-wise erosion operation. For each column j, the erosion operation is expressed as: For each column j, the dilation operation is expressed as: When performing operations in the column direction, only erosion, only dilation, or a combination of erosion and dilation are performed; After performing the column-wise operation, the intersection and union of the row-wise processing results are used to ensure the correctness of the operation. The intersection operation is expressed as: I″ i,j =I′ i,j ∩I′ row,i,j , where I″ i,j I′ represents the pixel value at the i-th row and j-th column in the final image obtained by processing in the column direction and then in the row direction. i,j It represents the pixel value at the i-th row and j-th column in the image after only column-wise processing, I′ row,i,j It represents the pixel value at the i-th row and j-th column in the image after the image is processed in the row direction. The intersection operation is used to indicate that only pixels that are 1 in both processing results will remain 1; Its union operation is expressed as: I″ i,j =I′ i,j ∪I′ row,i,j , the union operation is used to indicate that pixels that are 1 in either processing result remain 1.

6. An image processing method as claimed in claim 1, characterized in that: The step S5 outputs the image processing result after the column-wise erosion and dilation processing as the binary morphological calculation result of the original binary image. For erosion, the result is expressed as: Among them, I(x,y) is the original image, SE is the structural element, and ∧ means selecting the minimum value in the local area; For dilation, the result is expressed as: Among them, ∨ represents the selection of the maximum value in the local area; combined with the erosion and expansion operations, the result of the binary morphological calculation is finally calculated.

7. An image processing terminal, applied to an image processing method as claimed in any one of claims 1 to 6, characterized in that: It includes an image acquisition device for acquiring images and performing preprocessing to obtain original binary images; A memory for storing binary images preprocessed by the image acquisition device, and program data, including erosion and dilation algorithms, and a structural element matrix; A processor, configured to execute program data in the memory and perform run-length encoding on the binary image in the memory; Use the structure element matrix to perform morphological processing on the image in the row direction; After processing in the row direction, each row of data is reintegrated into a complete image representation, and morphological processing is performed in the column direction; The processing result in the column direction is taken as the binary morphological calculation result of the original binary image.

Citation Information

Patent Citations

  • Run-length encoding-based quick region expansion algorithm and apparatus

    CN106846424A

  • Image processing method, terminal equipment and computer storage medium

    CN116579957A

Cited By

  • Image corrosion method based on run-length coding and image processing device

    CN120410871A

  • Method for extracting geometric attributes of circular holes and optimizing performance under texture interference

    CN120747234A

  • A method for extracting geometric properties of a circular hole under texture interference and performance optimization

    CN120747234B