Image processing method of locator
By using filters with inner and outer ring structures and Sobel operators for edge detection in the positioner, the problem of high computational complexity of infrared image processing in the prior art is solved, and efficient edge detection and image processing effects are achieved.
Patent Information
- Application Number
- CN202411726963.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
AI Technical Summary
In the existing locator image processing technology, when using the Sobel operator to directly perform edge detection on infrared images, the calculation complexity is high and requires a large amount of computing resources to be consumed, resulting in poor edge image effect.
The infrared image is collected by filters with an inner and outer ring structure, and the image is grayed out. Use the Sobel operator to perform horizontal and vertical gradient calculations on the grayscale image, calculate the gradient amplitude and gradient direction, determine the edge pixel points through the set threshold, and finally output the edge image.
The internal and external ring filters effectively reduce noise and miscellaneous points, reduce calculation complexity, improve image clarity and edge detection accuracy, simplify the calculation process, and save computing resources.
Smart Images

Figure CN119672284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of locator image processing, and in particular to an image processing method for a locator. Background Art
[0002] As an important part of modern precision measurement and navigation, infrared positioning technology is based on accurately and efficiently capturing and processing infrared radiation information released by target objects. However, in practical applications, infrared positioning instruments not only need to face effective infrared signals from the target, but are also often interfered by multiple factors such as background noise, radiation of other wavelengths, and different environmental conditions, all of which may have an adverse effect on positioning accuracy.
[0003] The main function of the infrared filter is to filter out those unnecessary wavelengths and only allow infrared radiation of a specific band to pass through, thereby effectively improving positioning accuracy and reducing external interference. The working principle of the infrared filter is based on its selective permeability to radiation of different wavelengths. It can accurately allow infrared radiation of a specific wavelength of the target object to penetrate, while effectively blocking radiation of other wavelengths, such as visible light, ultraviolet light, etc. This selective permeability allows the locator to focus more on the infrared characteristics of the target, significantly improving the accuracy and reliability of positioning.
[0004] In the existing locator image processing technology, infrared images often contain rich thermal radiation information due to their special imaging principle, but they are also accompanied by high noise and complex background interference. When edge detection is performed directly on such infrared images, the computational complexity is high and a large amount of computing resources are consumed. As a result, the effect of edge images is not good in the processing results. Summary of the invention
[0005] The main purpose of the present invention is to provide an image processing method for a locator, aiming to solve the problem that in the existing locator image processing technology, when the Sobel operator is directly applied to the infrared image for edge detection, the calculation complexity is high and a large amount of computing resources are consumed, resulting in poor effect of the edge image in the processing result.
[0006] In order to achieve the above-mentioned object of the invention, the present invention provides an image processing method of a locator, comprising:
[0007] The infrared image is collected through a filter with an inner and outer ring structure, wherein the inner ring is a lens filter and the outer ring is an infrared light filter;
[0008] Performing grayscale processing on the infrared image to obtain a grayscale picture;
[0009] Using the Sobel operator, horizontal and vertical gradients of the grayscale image are calculated to obtain horizontal and vertical gradients;
[0010] According to the obtained horizontal gradient and vertical gradient, the gradient amplitude and gradient direction are calculated;
[0011] Determine edge pixel points of the object image in the grayscale image by comparing the calculated gradient amplitude with a set threshold;
[0012] Based on the determination result, an edge image is output.
[0013] Furthermore, the step of using the Sobel operator to calculate the horizontal and vertical gradients of the grayscale image to obtain the horizontal gradient and the vertical gradient comprises: using the Sobel convolution kernel in the horizontal direction and the vertical direction to perform convolution operations on the image respectively, and calculating the horizontal gradient and the vertical gradient of each pixel; wherein,
[0014] Horizontal convolution kernel
[0015] Vertical convolution kernel
[0016] Furthermore, the gradient amplitude and gradient direction are calculated according to the obtained horizontal gradient and vertical gradient, and the calculation formula is:
[0017] Gradient Amplitude
[0018] Gradient direction
[0019] Furthermore, the step of determining edge pixel points of the object image in the grayscale image by comparing the calculated gradient amplitude with a set threshold value includes:
[0020] Determine whether the gradient amplitude of each pixel is greater than a threshold;
[0021] If so, the pixel is determined to be an edge point, otherwise it is a non-edge point.
[0022] Furthermore, the step of graying the infrared image includes:
[0023] a. Select the weighted method to convert the color image into a grayscale image, and use the formula GRAY = 0.3*R + 0.59*G + 0.11*B to calculate the grayscale value. R, G, and B in the formula represent the components of the pixel in the red, green, and blue color domains respectively;
[0024] b. Read the image data, traverse each pixel in the image, and obtain the RGB color value corresponding to each pixel;
[0025] c. Apply the color value conversion method, call the formula in step a to convert the RGB color value of each pixel obtained in step b to obtain the corresponding grayscale value;
[0026] d. Apply the converted grayscale value to each pixel to generate a grayscale image.
[0027] Furthermore, the method further includes extracting features from the edge image, specifically including:
[0028] In the feature extraction process of edge images, a deformable multi-branch gradient path module is applied in the neural network to enhance the model's feature extraction ability for small targets at a long distance. A hybrid attention mechanism is introduced to make the model more focused on small targets or specific areas in edge images by calculating the importance weights of different areas, and this mechanism is embedded in the neural network for edge image processing.
[0029] The deformable multi-branch gradient path module includes multiple parallel gradient flow branches, including a main gradient flow branch and a sub-gradient flow branch, wherein the main gradient flow branch adopts a deformable residual component to adaptively adjust the convolution kernel structure.
[0030] Furthermore, the deformable multi-branch gradient path module concatenates the outputs of the main gradient flow branch and the secondary gradient flow branch, and adjusts the number of channels through a convolutional layer to fuse the features of multiple branches.
[0031] Furthermore, the hybrid attention mechanism includes a channel attention module and a spatial attention module. The channel attention module obtains the attention weight of each channel through maximum pooling and average pooling operations, so that the network can adaptively adjust the attention to each dimensional information.
[0032] Furthermore, the spatial attention module obtains the attention weight of each position information through pooling and convolution operations in the spatial dimension, so that the network pays more attention to the position characteristics of distant targets in the image.
[0033] Furthermore, in the hybrid attention mechanism introduced in the neural network, the channel attention module and the spatial attention module are multiplied with the input feature map in an element-by-element multiplication manner to achieve attention to and extraction of key features.
[0034] Furthermore, the optical filter with inner and outer ring structures comprises an inner ring glass and an outer ring glass sleeved outside the inner ring glass;
[0035] The inner glass is coated with one or more filter films to form a 910±30nm bandpass filter;
[0036] One or more filter films are coated on the outer ring glass to form a 780-910nm linear gradient filter, and further, it can be an 850-910nm linear gradient filter.
[0037] Furthermore, the thickness of the multilayer film structure of the one or more layers of filter film is 1 / 4 of the design wavelength, and the infrared image is collected through a filter having a matching structure of the inner ring glass and the outer ring glass, wherein the inner ring glass is a lens filter, the outer ring glass is an infrared lamp filter, the circular glass and the outer ring glass are integrally formed, and the surface of the marking ball inside the locator at the corresponding position of the filter is coated with a reflective material layer, which can reflect the infrared light emitted by the infrared lamp ring and display a highlight on the lens imaging picture, so the marking point can be accurately identified.
[0038] Furthermore, a mounting frame is installed at the edge of the outer ring glass, and a plurality of blocks are provided on the mounting frame for engaging with the positioning instrument, and a sealing ring is provided on the side of the mounting frame, and an adjusting column is self-rotating on the block, and the adjusting column is frictionally engaged with the sealing ring and the mounting frame at the same time;
[0039] The optical filters of different wavelength bands can be quickly installed and removed from the locator through the clamping block and the sealing ring, and the optical filters can be rotated and adjusted through the adjusting column.
[0040] Furthermore, the blocking ring is an elastic blocking ring, the clamping block is provided with a movable groove that is rotatably matched with the blocking ring, and the clamping block is provided with a rotating groove that is rotatably matched with the installation frame.
[0041] Furthermore, the adjustment column includes a rotating plate distributed in two gaps of the rotating block, the edge of the rotating plate penetrates into the rotating groove and frictionally and rollingly cooperates with the mounting frame, and an anti-skid plate is provided on the top of the rotating plate.
[0042] Furthermore, the vertical cross-section of the rotating plate is in the shape of an I-shaped character, and a convex ring adapted to the shape of the rotating plate is fixedly connected inside the clamping block to ensure smooth rotation.
[0043] Furthermore, a connecting rod is fixedly connected between the two rotating plates, and the top edge of the rotating plate located at the bottom is frictionally matched with the blocking ring.
[0044] Furthermore, the side of the clamping block is an inclined surface, which is convenient for quick clamping, and the vertical cross-section of the sealing ring is an arc-shaped structure to ensure close contact.
[0045] Furthermore, an elastic extrusion column is fixedly connected to the inclined surface of the clamping block to enhance the clamping effect.
[0046] Beneficial effects:
[0047] In response to the different filtering requirements of the lens and the infrared light ring, two types of filters are assembled using an inner and outer ring structure. The inner and outer ring filters are designed to have different spectral transmittance characteristics in the inner and outer rings, which can more accurately control the transmitted spectral range and improve spectral selectivity. Through the design of the inner and outer rings, unwanted wavelengths can be more effectively suppressed and the interference of stray light can be reduced, which is very important for improving imaging quality and signal detection accuracy. Compared with a single filter, inner and outer ring filters can provide a wider cut-off band, which means that they can block the transmission of light over a wider wavelength range. In strong light environments, inner and outer ring filters can better suppress the interference of ambient light and maintain signal clarity and accuracy. Using inner and outer ring filters can improve the overall performance of the system, such as improving the signal-to-noise ratio and enhancing image contrast and clarity.
[0048] In the edge detection process, since the inner and outer ring filters effectively reduce noise and spots, the image preprocessing (such as denoising) step before the Sobel operator can be omitted, reducing the need for complex filtering algorithms (such as median filtering or Gaussian filtering), thereby saving computing resources. When the input image is already clear, the Sobel operator does not need to perform too much edge enhancement or secondary detection. When calculating the gradient, the call to multiple thresholds or enhancement algorithms is reduced, thereby reducing the computational complexity. Due to the improved clarity of the input image, the Sobel operator does not need to perform additional edge intensity adjustments when calculating the gradient amplitude. The calculation process is simplified and the need for additional operations, such as edge smoothing or intensity normalization, is reduced.
[0049] In the process of edge image feature extraction, the processing speed and efficiency of the image processing algorithm are improved through the optimized design of the deformable multi-branch gradient path module and the application of the hybrid attention mechanism, so that the locator can complete the target detection and positioning tasks more quickly and improve the real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a step diagram of an image processing method of a locator according to an embodiment of the present invention;
[0051] Figure 2 It is a step diagram of grayscale processing of an infrared image according to an embodiment of the present invention.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0054] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0055] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0056] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0057] Reference Figure 1 An embodiment of the present invention provides an image processing method for a locator, wherein the infrared image acquisition method is:
[0058] A special filter with an inner and outer ring structure is used to collect infrared images. In the design of this filter, the inner ring is used as a lens filter to filter out light in non-infrared bands to ensure that only infrared light enters the lens; the outer ring is an infrared light filter to enhance the transmittance of the infrared light source and improve the brightness and clarity of the infrared image. This filter design can obtain high-quality infrared images.
[0059] The collected infrared image is further converted into a grayscale image by taking a weighted average of the red, green, and blue channel values of each pixel to obtain a single grayscale value, thereby generating a grayscale image.
[0060] Since the inner and outer ring filters effectively reduce noise and spots, the image preprocessing (such as denoising) step before the Sobel operator can be omitted, reducing the need for complex filtering algorithms (such as median filtering or Gaussian filtering), thereby saving computing resources. The following describes in detail the process of converting a grayscale image into an edge image using the Sobel operator.
[0061] Sobel operator gradient calculation:
[0062] When the input image is already clear, the Sobel operator does not need to perform too much edge enhancement or secondary detection. When calculating the gradient, the call to multiple thresholds or enhancement algorithms is reduced, thereby reducing the computational complexity. The Sobel operator is used to calculate the horizontal and vertical gradients of the grayscale image. Specifically, the following two 3x3 convolution kernels are used:
[0063] Horizontal convolution kernel
[0064] Vertical convolution kernel
[0065] The grayscale image is convolved using these two convolution kernels to calculate the horizontal and vertical gradients of each pixel.
[0066] Gradient magnitude and direction calculation:
[0067] Due to the improved clarity of the input image, the Sobel operator does not need to make additional edge intensity adjustments when calculating the gradient amplitude. This simplifies the calculation process and reduces the need for additional operations, such as edge smoothing or intensity normalization. Based on the calculated horizontal and vertical gradients, the gradient amplitude G and gradient direction θ are calculated using the following formula:
[0068] Gradient Amplitude
[0069] Gradient direction
[0070] Among them, the gradient amplitude reflects the strength of the edge at the pixel point in the image, while the gradient direction indicates the direction of the edge.
[0071] Edge pixel determination:
[0072] Set a threshold T and compare the calculated gradient amplitude G with the threshold T. If the gradient amplitude G of a pixel is greater than the threshold T, the pixel is judged to be an edge point, otherwise it is a non-edge point. Through this step, significant edge pixels in the image can be screened out.
[0073] Edge image output:
[0074] Based on the edge pixels determined above, an edge image is generated and outputted. In the edge image, edge pixels are marked as white (or other highlight colors), and non-edge pixels are marked as black (or other low-brightness colors), so as to clearly show the edge contour of the object.
[0075] Reference Figure 2 In one embodiment, the present invention performs grayscale processing on the infrared image, and the step of obtaining a grayscale image includes:
[0076] a. Use weighted method to convert color image into grayscale image. Weighted method is a commonly used color image grayscale technology. It assigns different weights to each color component according to the different sensitivity of human eyes to the three primary colors of red, green and blue. In this embodiment, the grayscale value is calculated using the formula GRAY=0.3×R+0.59×G+0.11×B, where R, G, and B represent the components of the pixel in the red, green, and blue color domains, respectively.
[0077] b. Read the raw data of the infrared image through the image reading function or library. Traverse each pixel in the image and obtain the RGB color value corresponding to each pixel. This usually involves accessing the storage structure of the image data, such as a two-dimensional array or image object, to extract the color information of each pixel.
[0078] c. For each pixel's RGB color value obtained in step b, call the formula in step a to convert it. Substitute the RGB color value into the formula and calculate the corresponding grayscale value. This calculation process is performed independently for each pixel to ensure that the entire image can be grayscaled correctly.
[0079] d. Apply the grayscale value calculated in step c to each pixel, replacing the original RGB color value. In this way, the original infrared image is converted into a grayscale image. The generated grayscale image can be saved as a new file or directly used for subsequent image edge detection.
[0080] After grayscale processing, the pixel value of the image only contains brightness information, removing the interference of color information, making the edges and textures of the image clearer, which is conducive to the accurate implementation of algorithms such as edge detection.
[0081] In one embodiment, the image processing method of the locator also includes a feature extraction part of the edge-to-edge image. By extracting the features of the edge image, the key features of the target object in the image can be obtained, such as shape, contour, etc. These features provide an important basis for subsequent infrared filter image positioning, so that the locator can more accurately identify and distinguish different target objects.
[0082] In the feature extraction process of edge images, a deformable multi-branch gradient path module is first constructed. This module contains multiple parallel gradient flow branches, where the main gradient flow branch is responsible for extracting the main features, while the sub-gradient flow branch is used to capture auxiliary features. The main gradient flow branch uses a deformable residual component, which can adaptively adjust the structure of the convolution kernel according to the input features, so as to more effectively capture the deformation and detail information in the image. The sub-gradient flow branch extracts complementary features to the main gradient flow branch through different convolution operations or pooling operations.
[0083] The outputs of the main gradient flow branch and the secondary gradient flow branch are concatenated to form a feature map containing rich features. In order to fuse the features of these multiple branches and adjust the number of channels to adapt to subsequent processing, the concatenated feature map is processed through a convolutional layer to obtain a fused feature representation.
[0084] In order to further enhance the model's attention to small objects or specific areas in edge images, a hybrid attention mechanism is introduced, which consists of a channel attention module and a spatial attention module.
[0085] The channel attention module obtains the maximum response and average response of the feature map in the channel dimension through maximum pooling and average pooling operations. Then, these two responses are processed through the fully connected layer and activation function to obtain the attention weights of each channel. These weights are used to adjust the network's attention to information in each dimension, so that the network can adaptively focus on important feature channels.
[0086] The spatial attention module focuses on the spatial dimension of the feature map. It first performs a pooling operation on the feature map in the spatial dimension to obtain the response value at each position. Then, these response values are processed through the convolution layer and activation function to generate a spatial attention weight map. This weight map is used to adjust the network's attention to different positions in the image, so that the network pays more attention to the position characteristics of distant targets.
[0087] In the hybrid attention mechanism, the weight map generated by the channel attention module and the spatial attention module is multiplied with the input feature map in an element-by-element multiplication manner. In this way, each element in the input feature map is adjusted according to its corresponding weight, thereby achieving attention and extraction of key features.
[0088] Finally, the feature map integrated with the hybrid attention mechanism is used as input for subsequent processing, such as target recognition tasks.
[0089] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An image processing method for a locator, characterized in that: include: The infrared image is collected through a filter with an inner and outer ring structure, wherein the inner ring is a lens filter and the outer ring is an infrared light filter; Performing grayscale processing on the infrared image to obtain a grayscale picture; Perform edge detection on the grayscale image to obtain an edge image.
2. The image processing method of the locator according to claim 1, characterized in that: The step of performing edge detection on the grayscale image to obtain an edge image includes: Using the Sobel operator, horizontal and vertical gradients of the grayscale image are calculated to obtain horizontal and vertical gradients; According to the obtained horizontal gradient and vertical gradient, the gradient amplitude and gradient direction are calculated; Determine edge pixel points of the object image in the grayscale image by comparing the calculated gradient amplitude with a set threshold; Based on the determination result, an edge image is output.
3. The image processing method of the locator according to claim 2, characterized in that: The step of using the Sobel operator to calculate the horizontal and vertical gradients of the grayscale image to obtain the horizontal gradient and the vertical gradient includes: using the Sobel convolution kernel in the horizontal direction and the vertical direction to perform convolution operations on the image respectively, and calculating the horizontal gradient and the vertical gradient of each pixel.
4. The image processing method of the locator according to claim 3, characterized in that: The values of the horizontal convolution kernel and the vertical convolution kernel are: Horizontal convolution kernel Vertical convolution kernel 5. The image processing method of the locator according to claim 2, characterized in that: The gradient amplitude and gradient direction are calculated according to the obtained horizontal gradient and vertical gradient, and the calculation formula is: Gradient Amplitude Gradient direction 6. The image processing method of the locator according to claim 2, characterized in that: The step of determining edge pixel points of the object image in the grayscale image by comparing the calculated gradient amplitude with a set threshold value comprises: Determine whether the gradient amplitude of each pixel is greater than a threshold; If so, the pixel is determined to be an edge point, otherwise it is a non-edge point.
7. The image processing method of a locator according to claim 1, characterized in that: The step of graying the infrared image to obtain a grayed image comprises: a. Select the weighted method to convert the color image into a grayscale image, and use the grayscale pixel calculation formula to calculate the grayscale value; b. Read the image data, traverse each pixel in the image, and obtain the RGB color value corresponding to each pixel; c. Apply the color value conversion method, call the formula in step a to convert the RGB color value of each pixel obtained in step b to obtain the corresponding grayscale value; d. Apply the converted grayscale value to each pixel to generate a grayscale image.
8. The image processing method of the locator according to claim 7, characterized in that: The grayscale pixel calculation formula is: GRAY=0.3*R+0.59*G+0.11*B, where R, G, and B respectively represent the components of the pixel in the red, green, and blue color domains.
9. The image processing method of a locator according to claim 1, characterized in that: The method further includes extracting features from the edge image, specifically comprising: In the feature extraction process of edge images, a deformable multi-branch gradient path module is applied in the neural network to enhance the model's feature extraction ability for small targets at a long distance. A hybrid attention mechanism is introduced to make the model more focused on small targets or specific areas in edge images by calculating the importance weights of different areas, and this mechanism is embedded in the neural network for edge image processing. The deformable multi-branch gradient path module includes multiple gradient flow branches in parallel, including a main gradient flow branch and a sub-gradient flow branch, wherein the main gradient flow branch adopts a deformable residual component to adaptively adjust the convolution kernel structure; The deformable multi-branch gradient path module splices the outputs of the main gradient flow branch and the secondary gradient flow branch, and adjusts the number of channels through the convolution layer to fuse the features of multiple branches; The hybrid attention mechanism includes a channel attention module and a spatial attention module. The channel attention module obtains the attention weight of each channel through maximum pooling and average pooling operations, so that the network can adaptively adjust the attention to each dimension of information. The spatial attention module obtains the attention weight of each position information through pooling and convolution operations in the spatial dimension, so that the network pays more attention to the position characteristics of distant targets in the image.
10. The image processing method of a locator according to claim 9, characterized in that: In the hybrid attention mechanism introduced in the neural network, the channel attention module and the spatial attention module are multiplied with the input feature map in an element-by-element multiplication manner to achieve attention to and extraction of key features.