Gray image enhancement method, enhancement system and storage medium

By calculating the difference matrix and identity matrix of the depth image and combining them with the grayscale image for feature fusion and amplification, the problem of missing features in grayscale images is solved, thereby improving detection accuracy and recognition rate.

CN116363004BActive Publication Date: 2026-06-05SIASUN CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SIASUN CO LTD
Filing Date
2023-03-24
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Due to hardware limitations, grayscale images generated by existing 3D cameras sometimes suffer from spectral absorption and feature loss in the detected objects, affecting detection accuracy and recognition rate.

Method used

By calculating the difference matrix and identity matrix of the depth image, feature fusion and amplification are performed in combination with the grayscale image, and the grayscale image is enhanced using the normalization matrix and gradient weight coefficient matrix.

Benefits of technology

It increases the feature information of the detected target object, thereby improving the detection accuracy and recognition rate of subsequent visual processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116363004B_ABST
    Figure CN116363004B_ABST
Patent Text Reader

Abstract

The application provides a grayscale image enhancement method, an enhancement system and a storage medium. The grayscale image enhancement method comprises the following steps: taking a picture of a target object by using an industrial camera to obtain a grayscale matrix of a grayscale image and a depth matrix of a depth image; calculating a row direction difference matrix, a column direction difference matrix and a unit matrix in a depth direction of the depth matrix according to the size and pixel value of the depth image; calculating a normalization matrix according to the row direction difference matrix, the column direction difference matrix and the unit matrix in the depth direction of the depth matrix; calculating a gradient fusion matrix of the grayscale matrix; performing normalization processing on the gradient fusion matrix to obtain a gradient weight coefficient matrix; and performing feature fusion and amplification processing on the grayscale matrix by using the normalization matrix and the gradient weight coefficient matrix to obtain an enhanced grayscale image. The application can enhance the grayscale image, increase the feature information of the required detection target object and improve the detection accuracy and recognition rate of the subsequent visual process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing, specifically relating to a grayscale image enhancement method, enhancement system, and storage medium. Background Technology

[0002] Image enhancement is an important branch of image processing, aiming to improve the visual quality of images. For a given image and its intended application, it purposefully emphasizes the overall or local characteristics of the image, making an originally blurry image clearer or highlighting certain features of interest, amplifying the differences between features of different objects in the image, and suppressing features of little interest. This improves image quality, enriches information, enhances image interpretation and recognition, and meets the needs of certain specialized analyses.

[0003] In industrial applications, 3D cameras are commonly used to scan and photograph objects to visually enhance contrast and highlight target areas. Mainstream 3D cameras generate 2D images including grayscale and depth images. Compared to color images, grayscale images have fewer features. Furthermore, due to hardware limitations, some objects in a 3D camera absorb certain spectra, resulting in slight gaps in the grayscale image. Therefore, there is a pressing need for a method to enhance grayscale images, increasing the feature information of the detected object and improving the accuracy and recognition rate of subsequent visual processing. Summary of the Invention

[0004] To at least partially overcome the problems existing in related technologies, this application provides a grayscale image enhancement method, enhancement system, and storage medium.

[0005] According to a first aspect of the embodiments of this application, this application provides a grayscale image enhancement method, which includes the following steps:

[0006] Set up the industrial camera, adjust its position, and then fix its relative pose.

[0007] An industrial camera is used to photograph the target object, resulting in a grayscale image and a depth image; the grayscale image is represented by a grayscale matrix, and the depth image is represented by a depth matrix.

[0008] Based on the dimensions and pixel values ​​of the depth image, calculate the row difference matrix, column difference matrix, and identity matrix in the depth direction of the depth matrix;

[0009] The normalized matrix is ​​calculated based on the row direction difference matrix, column direction difference matrix and identity matrix in the depth direction of the depth matrix;

[0010] Calculate the gradient fusion matrix of the grayscale matrix;

[0011] Normalize the gradient fusion matrix to obtain the gradient weight coefficient matrix;

[0012] The grayscale matrix is ​​fused and amplified using a normalized matrix and a gradient weight coefficient matrix to obtain an enhanced grayscale image.

[0013] In the above grayscale image enhancement method, the row-direction difference matrix, column-direction difference matrix, and depth-direction identity matrix of the depth matrix are respectively:

[0014]

[0015]

[0016]

[0017] In the formula, dx represents the row direction difference matrix of the depth matrix, dy represents the column direction difference matrix of the depth matrix, dz represents the identity matrix of the depth matrix in the depth direction, h represents the number of rows of the depth matrix D, and w represents the number of columns of the depth matrix D.

[0018] Furthermore, the specific process of calculating the normalized matrix based on the row direction difference matrix, column direction difference matrix, and identity matrix in the depth direction of the depth matrix is ​​as follows:

[0019] Calculate the component matrix dx1 of the row direction difference matrix dx in the x direction, the component matrix dy1 of the column direction difference matrix dy in the y direction, and the component matrix dz1 of the depth direction identity matrix dz in the z direction.

[0020]

[0021] In the formula, dl represents the distance from the origin to the current coordinate point in three-dimensional space.

[0022]

[0023] Based on the index points of the corresponding positions in the component matrices dx1, dy1, and dz1, the values ​​at positions (m,n) in the component matrices dx1, dy1, and dz1 are extracted respectively, and a spatial coordinate point is formed by the extracted values; this spatial coordinate point and the origin in three-dimensional space form a spatial vector, and the angle between this spatial vector and the spatial vector formed by the origin and the coordinate point (0,0,1) in three-dimensional space is calculated to obtain the angle value;

[0024] Normalize all obtained angle values, and then multiply the normalized values ​​by 255 and round them down.

[0025] The rounded values ​​are used to construct a normalized matrix M based on the index points of the corresponding positions in the component matrices dx1, dy1, and dz1. norm .

[0026] Furthermore, the specific process for calculating the gradient fusion matrix of the grayscale matrix is ​​as follows:

[0027] The Sober operator is used to perform difference calculations in the width and height directions of the grayscale matrix to obtain the gradient matrix in the width direction and the gradient matrix in the height direction.

[0028] A gradient fusion matrix is ​​generated by weighted averaging of the gradient matrices in the width and height directions.

[0029] Furthermore, the gradient weight coefficient matrix is ​​as follows:

[0030] M s =M k / 255,

[0031] In the formula, M k M represents the gradient fusion matrix. s This represents the gradient weight coefficient matrix.

[0032] Furthermore, the process of using the normalization matrix and gradient weight coefficient matrix to perform feature fusion and amplification of the grayscale matrix to obtain the enhanced grayscale image is as follows:

[0033] The grayscale matrix is ​​fused using the normalization matrix and the gradient weight coefficient matrix to obtain a fused grayscale image. The fused grayscale image is represented by matrix R. s Represented as:

[0034] R s =M*M s +M norm *(1-M s ),

[0035] In the formula, M represents the gray-level matrix;

[0036] The merged grayscale image is then magnified to obtain an enhanced grayscale image. The enhanced grayscale image is represented by matrix R′. s Represented as:

[0037] R′ s =R s *255.

[0038] According to a second aspect of the embodiments of this application, this application also provides a grayscale image enhancement system, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the grayscale image enhancement method described in any of the above claims when processing the computer program.

[0039] According to a third aspect of the embodiments of this application, this application also provides a storage medium having an executable program stored thereon, which, when invoked, performs the steps in any of the grayscale image enhancement methods described above.

[0040] As can be seen from the above specific embodiments of this application, it has at least the following beneficial effects: The grayscale image enhancement method provided by this application uses the information of the depth image to perform data fusion on the grayscale image, thereby increasing the feature information of the target object to be detected and improving the detection accuracy and recognition rate of subsequent visual processes.

[0041] It should be understood that the above general description and the following specific embodiments are merely exemplary and illustrative, and do not limit the scope of the claims made in this application. Attached Figure Description

[0042] The accompanying drawings, which are part of the specification of this application, illustrate embodiments of the present application and are used together with the description of the specification to illustrate the principles of the present application.

[0043] Figure 1 A flowchart of a grayscale image enhancement method provided in an embodiment of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the spirit of the content disclosed in this application will be clearly explained below with reference to the accompanying drawings and detailed description. After understanding the embodiments of this application, any person skilled in the art can make changes and modifications based on the technology taught in this application without departing from the spirit and scope of this application.

[0045] The illustrative embodiments and descriptions provided in this application are for explaining the application, but are not intended to limit the application. Furthermore, elements / components using the same or similar reference numerals in the drawings and embodiments are used to represent the same or similar parts.

[0046] The terms “first,” “second,” etc., used in this document are not intended to specifically refer to order or sequence, nor are they used to limit this application; they are merely used to distinguish elements or operations described using the same technical terms.

[0047] The terms “include,” “including,” “have,” “contain,” etc., used in this article are all open-ended terms, meaning that they include but are not limited to.

[0048] The term "and / or" as used herein includes any or all of the things mentioned.

[0049] The term "multiple" in this article includes "two" and "more than two"; the term "multiple groups" in this article includes "two groups" and "more than two groups".

[0050] Certain terms used to describe this application will be discussed below or elsewhere in this specification to provide additional guidance to those skilled in the art in describing the application.

[0051] like Figure 1 As shown, the grayscale image enhancement method provided in this application includes the following steps:

[0052] S1. Set up the industrial camera, adjust its position, and then fix its relative pose.

[0053] S2. Use an industrial camera to take pictures of the target object to obtain grayscale and depth images.

[0054] A grayscale image can be represented by a grayscale matrix M, where the columns of the grayscale matrix M are the pixels along the width direction and the rows of the grayscale matrix M are the pixels along the height direction. The grayscale matrix M can be represented as:

[0055]

[0056] In equation (1), a 11 a 1n a 1m a mn All represent elements in the grayscale matrix M.

[0057] A depth image can be represented by a depth matrix D, where the columns of the depth matrix D are the pixels along the width direction and the rows of the depth matrix D are the pixels along the height direction.

[0058] S3. Based on the dimensions and pixel values ​​of the depth image, calculate the row direction difference matrix dx, the column direction difference matrix dy, and the identity matrix dz in the depth direction of the depth matrix D.

[0059] Wherein, the row direction difference matrix dx, the column direction difference matrix dy, and the depth direction identity matrix dz of the depth matrix D are respectively:

[0060]

[0061]

[0062]

[0063] In equations (2) to (4), h represents the number of rows in the depth matrix D, w represents the number of columns in the depth matrix D, and the subscripts of the elements in each matrix conform to the subscript notation method of each element in the depth matrix D. For example, a (h-2)(w-1)This represents the element in row h-2 and column w-1 of the matrix.

[0064] S4. Calculate the normalized matrix M based on the row direction difference matrix dx, the column direction difference matrix dy, and the identity matrix dz in the depth direction of the depth matrix D. norm The specific process is as follows:

[0065] S41. Calculate the component matrix dx1 of the row direction difference matrix dx in the x direction, the component matrix dy1 of the column direction difference matrix dy in the y direction, and the component matrix dz1 of the depth direction identity matrix dz in the z direction.

[0066]

[0067] In equation (5), dl represents the distance from the origin to the current coordinate point in three-dimensional space.

[0068]

[0069] S42. Based on the index points of the corresponding positions of the component matrices dx1, dy1, and dz1, extract the values ​​at the (m,n) positions in the component matrices dx1, dy1, and dz1 respectively, and construct a spatial coordinate point from the extracted values; this spatial coordinate point and the origin in the three-dimensional space form a spatial vector, calculate the angle between this spatial vector and the spatial vector formed by the origin and the coordinate point (0,0,1) in the three-dimensional space, and obtain the angle value.

[0070] S43. Normalize all obtained angle values, and then multiply the normalized values ​​by 255 and round them down.

[0071] S44. The rounded values ​​are used to construct a normalized matrix M based on the index points of the corresponding positions in the component matrices dx1, dy1, and dz1. norm .

[0072] S5. Calculate the gradient fusion matrix of the grayscale matrix M. The specific process is as follows:

[0073] The Sober operator is used to perform difference calculations in the width and height directions of the gray matrix M to obtain the gradient matrix in the width direction and the gradient matrix in the height direction.

[0074] The gradient matrix M is generated by weighted averaging the gradient matrices in the width and height directions. k .

[0075] S6. Apply gradient fusion matrix M k After normalization, the gradient weight coefficient matrix M is obtained. s This makes the gradient weight coefficient matrix M sThe values ​​of each element in the equation are between 0 and 1, that is...

[0076] M s =M k / 255 (6)

[0077] S7. Using the normalized matrix M norm and gradient weight coefficient matrix M s The grayscale matrix M is subjected to feature fusion and amplification processing to obtain an enhanced grayscale image. The specific process is as follows:

[0078] S71. Using the normalization matrix and gradient weight coefficient matrix, feature fusion is performed on the grayscale matrix M to obtain the fused grayscale image. The fused grayscale image can be represented by matrix R. s express:

[0079] R s =M*M s +M norm *(1-M s (7)

[0080] S72. The merged grayscale image is then magnified to obtain an enhanced grayscale image. The enhanced grayscale image can be represented by matrix R′. s express:

[0081] R′ s =R s *255 (8)

[0082] By magnifying the fused grayscale image, the difference between the values ​​of each pixel in the enhanced grayscale image is increased, and the edge contours in the image are clearer.

[0083] The grayscale image enhancement method provided in this application integrates information from a depth image into the original grayscale image, thereby increasing the feature information of the object to be detected and improving the detection accuracy and recognition rate for subsequent visual processes.

[0084] In an exemplary embodiment, based on the grayscale image enhancement method provided in the embodiments of this application, the embodiments of this application also provide a grayscale image enhancement system, which includes a memory and a processor coupled to the memory. The processor is configured to execute the grayscale image enhancement method in any embodiment of this application based on instructions stored in the memory.

[0085] The memory can be system memory or fixed non-volatile storage media, etc. The system memory can store operating system, application programs, bootloader, database and other programs.

[0086] It should be noted that the grayscale image enhancement system and the grayscale image enhancement method provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0087] In an exemplary embodiment, this application also provides a computer storage medium, which is a computer-readable storage medium, such as a memory including a computer program, which can be executed by a processor to perform the grayscale image enhancement method in any embodiment of this application.

[0088] The embodiments of this application described above can be implemented in various hardware, software codes, or combinations thereof. For example, embodiments of this application may also represent program code executing the above methods in a data signal processor. This application may also relate to various functions performed by a computer processor, digital signal processor, microprocessor, or field-programmable gate array. The processor described above can be configured to perform specific tasks according to this application, which are accomplished by executing machine-readable software code or firmware code defining the specific methods disclosed in this application. The software code or firmware code can be developed to represent different programming languages ​​and different formats or forms. It can also represent software code compiled for different target platforms. However, the different code styles, types, and languages ​​of the software code performing tasks according to this application and other types of configuration code do not depart from the spirit and scope of this application.

[0089] The above description is merely an illustrative embodiment of this application. Any equivalent changes and modifications made by those skilled in the art without departing from the concept and principles of this application shall fall within the scope of protection of this application.

Claims

1. A grayscale image enhancement method, characterized in that, Includes the following steps: Set up the industrial camera, adjust its position, and then fix its relative pose. An industrial camera is used to photograph the target object, obtaining grayscale and depth images; among them, Grayscale images are represented by grayscale matrices, and depth images are represented by depth matrices. Based on the dimensions and pixel values ​​of the depth image, calculate the row difference matrix, column difference matrix, and identity matrix in the depth direction of the depth matrix; The normalized matrix is ​​calculated based on the row-direction difference matrix, column-direction difference matrix, and identity matrix in the depth direction of the depth matrix. The specific process is as follows: Calculate the row direction difference matrix of the depth matrix D dx The component matrix dx1 in the x-direction, the component matrix dy in the column direction difference matrix dy in the y-direction, and the identity matrix dz in the depth direction in the z-direction. Component matrix dz1; , In the formula, This represents the distance from the origin to the current coordinate point in three-dimensional space. ; According to the component matrix dx 1. dy 1. dz 1. Extract the component matrix from the index points at the corresponding positions. dx 1. dy 1. dz 1 The numerical value of the location is used to construct a spatial coordinate point; this space... The coordinate point and the origin in 3D space form a spatial vector. Calculate the spatial vector and its relationship to the origin and coordinate point in 3D space. The angle between the spatial vectors formed is used to obtain the angle value; Normalize all obtained angle values, and then multiply the normalized values ​​by 255 and round them down. The rounded values ​​are used to construct a normalized matrix based on the index points of the corresponding positions in the component matrices dx1, dy1, and dz1. ; Calculate the gradient fusion matrix of the grayscale matrix; Normalize the gradient fusion matrix to obtain the gradient weight coefficient matrix; The grayscale matrix is ​​fused and amplified using the normalization matrix and gradient weight coefficient matrix to obtain the enhanced grayscale image.

2. The grayscale image enhancement method according to claim 1, characterized in that, The row difference matrix, column difference matrix, and identity matrix in the depth direction of the depth matrix are as follows: , , ; In the formula, dx represents the row direction difference matrix of the depth matrix, dy represents the column direction difference matrix of the depth matrix, dz represents the identity matrix of the depth matrix in the depth direction, and h represents the number of rows of the depth matrix D. w represents the number of columns in the depth matrix D.

3. The grayscale image enhancement method according to claim 1, characterized in that, The specific process for calculating the gradient fusion matrix of the grayscale matrix is ​​as follows: The Sober operator is used to perform difference calculations in the width and height directions of the grayscale matrix to obtain the gradient matrix in the width direction and the gradient matrix in the height direction. A gradient fusion matrix is ​​generated by weighted averaging of the gradient matrices in the width and height directions.

4. The grayscale image enhancement method according to claim 3, characterized in that, The gradient weight coefficient matrix is ​​as follows: , In the formula, Represents the gradient fusion matrix. This represents the gradient weight coefficient matrix.

5. The grayscale image enhancement method according to claim 4, characterized in that, The process of using the normalized matrix and gradient weight coefficient matrix to perform feature fusion and amplification on the grayscale matrix to obtain the enhanced grayscale image is as follows: The grayscale matrix is ​​fused using a normalization matrix and a gradient weight coefficient matrix to obtain a fused grayscale image. The fused grayscale image is then represented by a matrix. Represented as: , In the formula, M represents the gray-level matrix; The merged grayscale image is then magnified to obtain an enhanced grayscale image. The enhanced grayscale image is then processed using a matrix... Represented as: 。 6. A grayscale image enhancement system, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when processing the computer program, implements the grayscale image enhancement method as described in any one of claims 1 to 5.

7. A storage medium, characterized in that, It stores an executable program, which, when invoked, performs the steps of the grayscale image enhancement method as described in any one of claims 1-5.