An image enhancement method and system based on attention mechanism

By acquiring road segment images using a high-position camera, analyzing grayscale distribution, identifying features of targets of interest, and utilizing an attention mechanism for local enhancement, the problem of insufficient effect on target areas in existing technologies is solved, thereby improving the quality of local images.

CN117237216BActive Publication Date: 2025-11-14INTELLIGENT INTER CONNECTION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311118496.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2025-11-14
Estimated Expiration
2043-09-01

AI Technical Summary

Technical Problem

Existing image enhancement methods process the entire image, resulting in insufficient emphasis on the target area of ​​interest.

Method used

By acquiring road segment images using high-position cameras, analyzing grayscale distribution, identifying the texture and shape features of targets of interest, determining whether the target area belongs to a region with concentrated grayscale distribution, and constructing a grayscale enhancement model based on an attention mechanism to locally enhance the target area.

Benefits of technology

This method achieves effective local enhancement of the target of interest, improving the saliency and quality of the target region in the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237216B_ABST
    Figure CN117237216B_ABST
Patent Text Reader

Abstract

This invention discloses an image enhancement method and system based on an attention mechanism, belonging to the field of image processing. The method includes: acquiring image acquisition results of a preset road segment using a high-position camera; performing grayscale distribution analysis on the image acquisition results to obtain regions with concentrated grayscale distribution; receiving a target of interest from a user terminal and acquiring its texture and shape feature information; identifying the target feature region based on the feature information in the road segment image acquisition results; determining whether the target feature region belongs to a region with concentrated grayscale distribution; if it belongs to a region with concentrated grayscale distribution, constructing a grayscale enhancement model based on an attention mechanism to perform local enhancement processing on the road segment image acquisition results, thereby obtaining the enhanced road segment image. This application solves the technical problem that existing image enhancement methods result in insufficient target enhancement effects due to overall image enhancement, achieving the technical effect of effectively enhancing the target of interest locally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and more specifically to an image enhancement method and system based on an attention mechanism. Background Technology

[0002] Image enhancement technology is widely used in various fields, especially in the transportation sector. For traffic images, traditional image enhancement methods typically employ global equalization. While this method can improve the overall image quality to some extent, it processes all regions of the image, resulting in the target region of interest not being highlighted. Summary of the Invention

[0003] This application provides an image enhancement method and system based on an attention mechanism, aiming to solve the technical problem that existing image enhancement methods do not achieve sufficient target enhancement for the overall image.

[0004] In view of the above problems, this application provides an image enhancement method and system based on an attention mechanism.

[0005] The first aspect disclosed in this application provides an image enhancement method based on an attention mechanism. This method includes: acquiring images of a preset road segment using a high-position camera to obtain road segment image acquisition results; performing grayscale distribution analysis on the road segment image acquisition results to obtain a grayscale distribution histogram, wherein the grayscale distribution histogram includes regions of concentrated grayscale distribution; receiving a target of interest from a user terminal and acquiring texture and shape feature information of the target of interest; identifying regions in the road segment image acquisition results based on the texture and shape feature information to obtain target feature regions; determining whether the target feature region belongs to a region of concentrated grayscale distribution; if the target feature region belongs to a region of concentrated grayscale distribution, constructing a grayscale enhancement model based on an attention mechanism to perform local enhancement processing on the road segment image acquisition results to obtain road segment image enhancement results.

[0006] Another aspect of this application discloses an image enhancement system based on an attention mechanism. This system includes: a road segment image acquisition module for acquiring images of a preset road segment using a high-position camera, and obtaining the road segment image acquisition results; a grayscale distribution analysis module for performing grayscale distribution analysis on the road segment image acquisition results, and obtaining a grayscale distribution histogram, wherein the grayscale distribution histogram includes grayscale concentration regions; a user interest target module for receiving an interest target from a user terminal, and obtaining the texture and shape feature information of the interest target; an image region recognition module for identifying regions in the road segment image acquisition results based on the texture and shape feature information, and obtaining target feature regions; a target region judgment module for determining whether the target feature region belongs to a grayscale concentration region; and an image enhancement result module for constructing a grayscale enhancement model based on an attention mechanism if the target feature region belongs to a grayscale concentration region, performing local enhancement processing on the road segment image acquisition results, and obtaining the road segment image enhancement result.

[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0008] This approach utilizes high-position cameras to capture road segment images and analyze their grayscale distribution to identify regions with concentrated grayscale values. When a user's target of interest is received, the image is first labeled with the target's texture and shape features. Then, it is determined whether the target region is located within the aforementioned concentrated grayscale distribution region. If the target region belongs to the concentrated grayscale distribution region, an attention mechanism is used to construct a grayscale enhancement model to locally enhance the target region, achieving effective local enhancement of the image. This solution solves the technical problem of existing image enhancement methods where the overall image enhancement results in insufficient target enhancement, achieving effective local enhancement of the target of interest.

[0009] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0010] Figure 1 This application provides a possible flowchart of an image enhancement method based on an attention mechanism.

[0011] Figure 2 This application provides a schematic diagram illustrating a possible process for obtaining concentrated grayscale distribution regions in an image enhancement method based on an attention mechanism.

[0012] Figure 3This application provides a schematic diagram illustrating a possible process for obtaining concentrated grayscale distribution regions in an image enhancement method based on an attention mechanism.

[0013] Figure 4 This application provides a schematic diagram of a possible structure for an image enhancement system based on an attention mechanism.

[0014] Figure labeling: 11 Road segment image acquisition module, 12 Gray scale distribution analysis module, 13 User interest target module, 14 Image region recognition module, 15 Target region judgment module, 16 Image enhancement result module. Detailed Implementation

[0015] The overall concept of the technical solution provided in this application is as follows:

[0016] This application provides an image enhancement method and system based on an attention mechanism. First, grayscale distribution analysis is performed on the acquired road segment image to obtain its grayscale distribution histogram, identifying regions with concentrated grayscale values ​​and defining them as grayscale concentration regions. Then, when a target of interest to the user is received, the image is labeled with the target region based on its texture and shape features. Subsequently, it is determined whether the labeled target region belongs to the aforementioned grayscale concentration region. If it does, an attention mechanism is used to construct a grayscale enhancement model to locally enhance the target region, increasing its grayscale and contrast, thus achieving effective local image enhancement. If it does not belong to the target region, no enhancement processing is performed.

[0017] After introducing the basic principles of this application, various non-limiting embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0018] Example 1

[0019] like Figure 1 As shown, this application provides an image enhancement method based on an attention mechanism, the method comprising:

[0020] Step S1000: Acquire images of the preset road section using a high-position camera to obtain the road section image acquisition results;

[0021] Furthermore, step S1000 includes the following steps:

[0022] Step S1100: Obtain the light intensity information of the preset road section through a light intensity sensor;

[0023] Step S1200: When the light intensity information is less than the light intensity threshold, activate the CCD supplementary lighting camera to acquire images of the preset road segment and obtain the image acquisition results of the road segment;

[0024] Step S1300: When the light intensity information is greater than or equal to the light intensity threshold, activate the spherical camera to acquire images of the preset road segment and obtain the image acquisition results of the road segment.

[0025] In this embodiment, the high-position camera is a camera device installed at a high position with a large field of view and distance; the preset road segment is the target road section for which image acquisition is required; the light intensity sensor is a sensor used to detect ambient light intensity; the light intensity information is the current ambient light intensity parameter obtained by the light intensity sensor; the light intensity threshold is a preset light intensity reference value; the CCD supplementary lighting camera is a CCD image acquisition device with a supplementary light lamp, used for image acquisition in low-light environments. The spherical camera is a panoramic image acquisition device with 360° wide-angle acquisition capability; the road segment image acquisition result is a panoramic image of the road segment acquired by the image acquisition device.

[0026] Images of a preset road section are captured using a high-position camera. First, a light intensity sensor detects the current ambient light intensity and compares it to a pre-set light intensity threshold. If the detected light intensity is lower than the threshold, the ambient light is considered weak, and a CCD supplementary lighting camera is activated to capture images of the preset road section. If the detected light intensity is greater than or equal to the threshold, the ambient light is considered strong, and a spherical camera is activated to capture images of the preset road section.

[0027] By selecting different image acquisition devices for different lighting environments, clear road segment images can be obtained under various lighting conditions, providing high-quality raw image data for subsequent image processing and laying the foundation for such processing.

[0028] Step S2000: Perform grayscale distribution analysis on the image acquisition results of the road segment to obtain a grayscale distribution histogram, wherein the grayscale distribution histogram includes a grayscale distribution concentration area;

[0029] In this embodiment of the application, grayscale distribution analysis refers to the statistical analysis and distribution statistics of the grayscale information of an image; the grayscale distribution histogram is a statistical histogram of the image grayscale values ​​and their corresponding distribution frequencies obtained through grayscale distribution analysis; the grayscale distribution concentration region is the grayscale range with a high distribution frequency in the grayscale distribution histogram.

[0030] First, all pixels in the road segment image acquisition results are traversed to obtain the grayscale value of each pixel, forming grayscale feature information. Second, based on the preset grayscale measurement interval and grayscale deviation, the grayscale feature information is binned and clustered to obtain grayscale feature clustering results. Then, based on the grayscale feature clustering results, the number of pixels belonging to each bin is counted within a certain grayscale range to construct a grayscale distribution histogram. Next, the grayscale distribution histogram is analyzed to count the pixel distribution frequency of each grayscale interval. Then, the distribution frequency of each grayscale interval is determined, and continuous grayscale intervals with higher distribution frequencies are extracted to obtain the grayscale distribution concentration region. The grayscale distribution concentration region contains the main color and brightness information in the image, and extracting this region can obtain the main part of the image.

[0031] By analyzing the grayscale distribution of the acquired road segment images, and by statistically analyzing the grayscale information in the images, a grayscale distribution histogram is obtained. This clearly shows the grayscale range of the image and the frequency of distribution of each grayscale value, intuitively reflecting the brightness distribution characteristics of the image. This provides an important basis for subsequent image processing and analysis, and also lays the foundation for the accurate implementation of image enhancement.

[0032] Step S3000: Receive the target of interest from the user terminal, and obtain the texture feature information and shape feature information of the target of interest;

[0033] In the embodiments of this application, the target of interest is the image object that the user is interested in and wants to enhance; texture feature information is the feature parameters that describe the surface texture of the target of interest, such as thickness and direction; shape feature information is the feature parameters that describe the outline of the target of interest, such as perimeter, area, and thickness.

[0034] First, the system receives the user-selected target of interest from the user interface, performs edge detection on the target of interest, extracts its contour curve, and calculates shape feature information such as perimeter, area, and shape factor based on the curve feature parameters. Simultaneously, multiple small regions are selected within the target of interest region, and texture analysis is performed on each small region to obtain its texture feature parameters. The parameters of all small regions constitute the texture feature information of the target of interest. The combination of shape feature information and texture feature information yields the full feature information of the target of interest, providing a reference for subsequent image enhancement processing.

[0035] Step S4000: Based on the texture feature information and the shape feature information, perform region identification on the road segment image acquisition results to obtain the target feature region;

[0036] In this embodiment, the target feature region is the region corresponding to the target of interest in the road segment image acquisition results. First, multiple small regions are selected in the road segment image acquisition results, and the texture information of each small region is extracted and calculated to obtain its texture feature vector. Then, the similarity between the texture feature vector of each small region and the texture feature information of the target of interest is calculated, and a set of small regions with high similarity is selected. Subsequently, in the set of small regions with high similarity, regions with high contour fitting are found based on the shape feature information of the target of interest to determine the target feature region. The obtained target feature region corresponds to the specific region of the target of interest in the road segment image acquisition results, laying the foundation for subsequent image processing based on the target of interest.

[0037] Step S5000: Determine whether the target feature region belongs to the gray-scale distribution concentration region;

[0038] In this embodiment, it is determined whether the obtained target feature region belongs to the obtained gray-level distribution concentration region. The gray-level distribution concentration region contains the main color and brightness information in the image, corresponding to the main part of the image. If the target feature region belongs to the gray-level distribution concentration region, it means that the target of interest also belongs to the main part of the image, providing an important basis for subsequent image enhancement based on the target of interest.

[0039] First, based on the obtained concentrated grayscale distribution region, the grayscale range it encompasses is determined. Then, multiple smaller regions are selected within the target feature region, and the average grayscale value of each smaller region is calculated. Next, it is determined whether the average grayscale value of each smaller region belongs to the grayscale range of the concentrated grayscale distribution region. If the average grayscale value of a smaller region is greater than a preset proportion and belongs to the concentrated grayscale distribution region, then the target feature region is determined to belong to the concentrated grayscale distribution region. If the average grayscale value of a smaller region is less than a preset proportion and belongs to the concentrated grayscale distribution region, then the target feature region is determined not to belong to the concentrated grayscale distribution region. The final determination provides an important reference for subsequent image enhancement processing, enabling precise image enhancement based on the target of interest.

[0040] Step S6000: If the target feature region belongs to the gray-scale distribution concentration region, construct a gray-scale enhancement model based on the attention mechanism, perform local enhancement processing on the road segment image acquisition results, and obtain the road segment image enhancement results.

[0041] Furthermore, step S6000 includes the following steps:

[0042] Step S6100: Acquire a training image set, wherein the training image set includes regions of interest (ROIs);

[0043] Step S6200: Obtain the template of the region of interest;

[0044] Step S6300: Perform local grayscale transformation based on the region of interest to obtain a locally grayscale enhanced label image;

[0045] Step S6400: The grayscale enhancement model includes an attention layer and a grayscale enhancement layer;

[0046] Step S6500: Input the training image set and the region of interest template into the attention layer to obtain the feature region comparison pass signal;

[0047] Step S6600: When the feature region comparison pass signal is 1, activate the grayscale enhancement layer to perform local enhancement processing on the region of interest, and perform enhancement loss analysis based on the local grayscale enhanced image;

[0048] Step S6700: When the enhancement loss value is less than or equal to the preset loss amount for a preset number of consecutive times, the grayscale enhancement model is generated.

[0049] In a preferred embodiment, firstly, images containing the target of interest (ROI) are collected, and ROI regions are manually labeled to obtain a training image set and corresponding ROI regions. Secondly, features are extracted from the ROI regions to obtain ROI templates representing the features of the ROI regions. Thirdly, a nonlinear transformation of the image grayscale levels is performed within the ROI regions to enhance the contrast of the ROI regions, resulting in locally enhanced grayscale images. Then, a convolutional neural network model containing an attention layer and a grayscale enhancement layer is constructed. The attention layer determines whether the input image contains the ROI, and the grayscale enhancement layer enhances the ROI regions. Next, the training image set is input into the attention layer, which determines whether each training image contains the ROI based on the ROI templates, outputting a feature region comparison pass signal (1 for inclusion, 0 for exclusion). When the feature region comparison pass signal is 1, the grayscale enhancement layer is activated to enhance the ROI regions, and the difference between the locally enhanced grayscale images and the original ROI regions is calculated, i.e., the enhancement loss value. The above training process is repeated until the enhancement loss value reaches a preset number of times less than a preset threshold, at which point training ends, and the final grayscale enhancement model is obtained.

[0050] Subsequently, the road segment image acquisition results are input into the constructed grayscale enhancement model. Based on the output of the attention layer of the grayscale enhancement model, subsequent network layers only extract and enhance features in the target feature region, leaving other regions unchanged. Then, the grayscale enhancement model performs pixel-level image enhancement operations on the target feature region, such as contrast enhancement, color adjustment, and sharpening, and outputs the enhanced feature map. The original feature maps of other regions and the enhanced feature map of the target feature region are concatenated to form the feature map of the road segment image enhancement result. The feature map is then upsampled and reconstructed to output the road segment image enhancement result, achieving local enhancement of the target feature region and meeting user customization needs.

[0051] Furthermore, such as Figure 2 As shown, embodiments of this application also include:

[0052] Step S2100: Traverse and extract pixel features from the image acquisition results of the road segment to obtain grayscale feature information;

[0053] Step S2200: Based on the preset grayscale deviation, perform hierarchical clustering analysis on the grayscale feature information to obtain the grayscale feature clustering results;

[0054] Step S2300: Construct the gray-level distribution histogram based on the gray-level feature clustering results;

[0055] Step S2400: Perform a centralized analysis on the grayscale distribution histogram to obtain the concentrated grayscale distribution region.

[0056] Specifically, first, each pixel in the road segment image acquisition results is traversed, and the grayscale value of each pixel is extracted as grayscale feature information. Then, a grayscale deviation is set, which is a threshold for determining whether two grayscale values ​​belong to the same cluster. Pixels are then clustered based on this threshold and the grayscale feature information. For example, using the K-means clustering algorithm, K cluster centers are initialized, the grayscale difference between each pixel and the K cluster centers is calculated, each pixel is assigned to the cluster with the smallest grayscale difference, the cluster centers are updated, and this iteration is repeated until the cluster centers no longer change, finally obtaining the clustering result based on the grayscale features.

[0057] Next, the grayscale feature clustering results are iterated through, and the number of pixels in each cluster is counted. A grayscale distribution histogram is plotted with the grayscale value of the cluster on the x-axis and the number of pixels on the y-axis. Each bar in the histogram represents a cluster, the height of the bar represents the number of pixels in the cluster, and the position represents the grayscale value of the cluster. Subsequently, the mean of the grayscale distribution histogram is calculated. Using the mean as a range, it is determined whether the bars within this range constitute the majority. If so, this range is the concentrated area, thus obtaining the concentrated grayscale distribution region.

[0058] Furthermore, such as Figure 3As shown, embodiments of this application also include:

[0059] Step S2410: Perform sparsity analysis on the k-th histogram to obtain the sparse coefficient of the k-th histogram distribution;

[0060] Step S2420: When the distribution sparsity coefficient is less than or equal to the first sparsity coefficient threshold, obtain the sum of the distribution frequencies;

[0061] Step S2430: When the sum of the distribution frequencies is greater than or equal to the frequency sum threshold, obtain the grayscale distribution concentration area.

[0062] In a preferred embodiment, sparsity analysis is performed on the constructed k-th gray-level distribution histogram to obtain its distribution sparsity coefficient. The distribution sparsity coefficient reflects the degree of sparsity of the histogram along the horizontal axis; the higher the sparsity, the larger the distribution sparsity coefficient. Then, a first sparsity coefficient threshold is set based on expert experience. If the obtained distribution sparsity coefficient is less than or equal to the threshold, it indicates that the histogram distribution is not very sparse, and the sum of the frequencies of all bars in the histogram is calculated. The sum of frequencies reflects the total number of pixels in the histogram and is used to subsequently determine whether the pixels are relatively concentrated. Subsequently, a frequency sum threshold is set. If the obtained distribution frequency sum is greater than or equal to the threshold, it indicates that the number of pixels in the histogram is relatively large, and it is determined that the pixels are relatively concentrated. At this time, the gray-level range corresponding to the histogram is defined as the gray-level distribution concentrated region.

[0063] By determining whether the gray-level distribution histogram is sparse, and if the distribution is not too sparse, we then determine whether the pixels in the histogram are relatively concentrated. If the pixels are relatively concentrated, the gray-level range corresponding to the histogram is determined to be the concentrated gray-level distribution area of ​​the image, thereby accurately locating the concentrated gray-level distribution area.

[0064] Furthermore, embodiments of this application also include:

[0065] Step S2411: For the k-th histogram, calculate the boundary distance with the adjacent histograms to obtain the first gray-level distance and the second gray-level distance;

[0066] Step S2412: Calculate the mean of the sum of the first gray-level distance and the reciprocal of the second gray-level distance to obtain the distribution density of the k-th histogram;

[0067] Step S2413: Traverse the gray-level distribution histogram and obtain the mean histogram distribution density;

[0068] Step S2414: Calculate the ratio of the mean histogram distribution density to the distribution density of the k-th histogram, and set it as the ratio of the mean histogram distribution density to the distribution density of the k-th histogram. Figure 1 Level sparsity coefficient;

[0069] Step S2415: When the kth square Figure 1 When the first sparsity coefficient is greater than or equal to the second sparsity coefficient threshold, the boundary distance between the k-th histogram and the adjacent histograms is calculated to obtain the third gray-scale distance and the fourth gray-scale distance.

[0070] Step S2416: Based on the first gray-level distance, the second gray-level distance, the third gray-level distance, and the fourth gray-level distance, calculate the k-th histogram. Figure 2 Level sparsity coefficient;

[0071] Step S2417: Repeat the iteration until the q-th level sparsity coefficient of the k-th histogram is less than the second sparsity coefficient threshold, and set the q-th level sparsity coefficient of the k-th histogram as the distribution sparsity coefficient of the k-th histogram.

[0072] In one feasible embodiment, sparsity analysis is performed on the k-th gray-level distribution histogram to obtain its distribution sparsity coefficient. First, the boundary distances between the k-th gray-level distribution histogram and its adjacent preceding and following histograms are calculated, yielding a first gray-level distance and a second gray-level distance. The gray-level distance reflects the difference in gray-level range between two adjacent histograms; a larger gray-level distance indicates a greater variation in gray-level values ​​and a sparser distribution. Then, the mean of the sum of the reciprocals of the first and second gray-level distances is calculated to obtain the distribution density of the k-th gray-level distribution histogram. A higher distribution density indicates a denser distribution of the histogram. Following this method, all gray-level distribution histograms are traversed, and the distribution density of each histogram is calculated, subsequently yielding the mean of the distribution densities of all histograms.

[0073] Then, the ratio of the mean of the histogram distribution density to the distribution density of the k-th gray-level distribution histogram is calculated to obtain the first-level sparsity coefficient of the k-th gray-level distribution histogram. The larger the first-level sparsity coefficient, the sparser the distribution of the k-th gray-level distribution histogram is relative to other histograms. Subsequently, a second sparsity coefficient threshold is set. If the first-level sparsity coefficient of the k-th gray-level distribution histogram is greater than or equal to this threshold, it indicates that the distribution of this histogram is relatively sparse based on the two adjacent histograms. At this point, it is necessary to consider histograms further away and calculate the boundary distances between the k-th gray-level distribution histogram and the preceding and following histograms (inter-neighbor histograms) separated by one histogram, obtaining the third and fourth gray-level distances. Then, based on the obtained first and second gray-level distances, as well as the obtained third and fourth gray-level distances, the second-level sparsity coefficient of the k-th gray-level distribution histogram is calculated. The second-order sparsity coefficient can be calculated as follows: Second-order sparsity coefficient = (First gray-level distance + Second gray-level distance + Third gray-level distance + Fourth gray-level distance) / 4. A larger second-order sparsity coefficient indicates a wider range of consideration and a sparser distribution of the histogram. If the obtained second-order sparsity coefficient is still greater than the second-order sparsity coefficient threshold, it indicates that a wider range of histograms needs to be considered. Repeat similar steps to calculate the third-order, fourth-order, and so on sparsity coefficients for the k-th gray-level distribution histogram until a certain level of sparsity coefficient is less than the second-order sparsity coefficient threshold. At this point, the sparsity coefficient of that level is defined as the distribution sparsity coefficient of the k-th gray-level distribution histogram.

[0074] In summary, the image enhancement method based on an attention mechanism provided in this application has the following technical effects:

[0075] Images of a preset road segment are captured using a high-position camera to obtain the image acquisition results, providing a data foundation for grayscale distribution analysis. Grayscale distribution analysis is performed on the captured road segment images to obtain a grayscale distribution histogram. This histogram includes regions of concentrated grayscale distribution, providing a reference for subsequent determination of whether target areas require enhancement. The system receives the target of interest from the user, acquiring its texture and shape features to provide a basis for subsequent target area identification. Based on the texture and shape features, the captured road segment images are region-identified to obtain target feature regions. The target region in the image is determined based on the target information provided by the user. It is then determined whether the target feature region belongs to a region of concentrated grayscale distribution and whether the identified target region is located in a region of concentrated brightness within the image, to decide whether enhancement is needed. If the target feature region belongs to a region of concentrated grayscale distribution, a grayscale enhancement model is constructed based on an attention mechanism to perform local enhancement processing on the captured road segment images, obtaining the enhanced road segment image. This achieves the technical effect of effectively enhancing the target of interest locally.

[0076] Example 2

[0077] Based on the same inventive concept as the attention-based image enhancement method in the foregoing embodiments, such as Figure 4 As shown, this application provides an image enhancement system based on an attention mechanism, the system comprising:

[0078] The road segment image acquisition module 11 is used to acquire images of a preset road segment through a high-position camera and obtain the road segment image acquisition results;

[0079] The grayscale distribution analysis module 12 is used to perform grayscale distribution analysis on the road segment image acquisition results and obtain a grayscale distribution histogram, wherein the grayscale distribution histogram includes a grayscale distribution concentration area;

[0080] User interest target module 13 is used to receive interest targets from the user terminal and obtain the texture feature information and shape feature information of the interest targets;

[0081] The image region recognition module 14 is used to identify the target feature region by the road segment image acquisition results based on the texture feature information and the shape feature information;

[0082] The target region determination module 15 is used to determine whether the target feature region belongs to the gray-scale distribution concentration region;

[0083] The image enhancement result module 16 is used to construct a gray-level enhancement model based on an attention mechanism if the target feature region belongs to the gray-level distribution concentration region, and to perform local enhancement processing on the road segment image acquisition results to obtain the road segment image enhancement result.

[0084] Furthermore, the road segment image acquisition module 11 includes the following execution steps:

[0085] The light intensity information of the preset road section is obtained through a light intensity sensor;

[0086] When the light intensity information is less than the light intensity threshold, the CCD supplementary lighting camera is activated to acquire images of the preset road segment and obtain the image acquisition results of the road segment.

[0087] When the light intensity information is greater than or equal to the light intensity threshold, the spherical camera is activated to acquire images of the preset road segment and obtain the image acquisition results of the road segment.

[0088] Furthermore, the grayscale distribution analysis module 12 includes the following execution steps:

[0089] The pixel features of the image acquisition results of the road segment are extracted by traversing the image to obtain grayscale feature information;

[0090] Based on the preset grayscale deviation, hierarchical clustering analysis is performed on the grayscale feature information to obtain the grayscale feature clustering results;

[0091] Based on the clustering results of the gray-level features, the gray-level distribution histogram is constructed;

[0092] The gray-level distribution histogram is analyzed to obtain the concentrated gray-level distribution region.

[0093] Furthermore, the grayscale distribution analysis module 12 also includes the following execution steps:

[0094] Perform sparsity analysis on the k-th histogram to obtain the sparse coefficient of the k-th histogram distribution;

[0095] When the distribution sparsity coefficient is less than or equal to the first sparsity coefficient threshold, the sum of the distribution frequencies is obtained;

[0096] When the sum of the distribution frequencies is greater than or equal to the frequency sum threshold, the grayscale distribution concentration area is obtained.

[0097] Furthermore, the grayscale distribution analysis module 12 also includes the following execution steps:

[0098] For the k-th histogram, calculate the boundary distance with the adjacent histograms to obtain the first gray-level distance and the second gray-level distance;

[0099] Calculate the mean of the sum of the first gray-level distance and the reciprocal of the second gray-level distance to obtain the distribution density of the k-th histogram;

[0100] Traverse the grayscale distribution histogram to obtain the mean histogram distribution density;

[0101] Calculate the ratio of the mean of the histogram distribution density to the distribution density of the k-th histogram, and denote it as the ratio of the k-th histogram distribution density. Figure 1 Level sparsity coefficient;

[0102] When the kth square Figure 1 When the first sparsity coefficient is greater than or equal to the second sparsity coefficient threshold, the boundary distance between the k-th histogram and the adjacent histograms is calculated to obtain the third gray-scale distance and the fourth gray-scale distance.

[0103] Based on the first gray-level distance, the second gray-level distance, the third gray-level distance, and the fourth gray-level distance, calculate the k-th histogram. Figure 2 Level sparsity coefficient;

[0104] Repeat the iteration until the q-th level sparse coefficient of the k-th histogram is less than the second sparse coefficient threshold, then set the q-th level sparse coefficient of the k-th histogram as the sparse coefficient of the k-th histogram distribution.

[0105] Furthermore, the image enhancement result module 16 includes the following execution steps:

[0106] A training image set is acquired, wherein the training image set includes regions of interest (ROIs);

[0107] Get the template of the area of ​​interest;

[0108] Based on the region of interest, perform local grayscale transformation to obtain a locally grayscale enhanced image;

[0109] The grayscale enhancement model includes an attention layer and a grayscale enhancement layer;

[0110] The training image set and the region of interest template are input into the attention layer to obtain the feature region comparison pass signal;

[0111] When the feature region comparison pass signal is 1, the gray-level enhancement layer is activated to perform local enhancement processing on the region of interest, and enhancement loss analysis is performed based on the local gray-level enhanced image.

[0112] The grayscale enhancement model is generated when the enhancement loss value is less than or equal to the preset loss amount for a preset number of consecutive preset times.

[0113] In summary, any step of the method described above can be stored as a computer instruction or program in an unrestricted computer memory, and can be called and identified by an unrestricted computer processor to implement any method in the embodiments of this application, without any additional restrictions.

[0114] Furthermore, the "first" or "second" mentioned above may not only represent a sequential relationship, but may also represent a specific concept, and / or refer to the individual or collective selection of multiple elements. Clearly, those skilled in the art can make various modifications and variations to this application without departing from its scope. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application intends to include such modifications and variations.

Claims

1. An image enhancement method based on an attention mechanism, characterized in that, include: Images of the preset road section are captured using a high-position camera to obtain the image capture results. Gray-scale distribution analysis is performed on the image acquisition results of the road segment to obtain a gray-scale distribution histogram, wherein the gray-scale distribution histogram includes gray-scale concentration areas; Receive the target of interest from the user terminal, and obtain the texture feature information and shape feature information of the target of interest; Based on the texture feature information and the shape feature information, the road segment image acquisition results are region-identified to obtain the target feature region; Determine whether the target feature region belongs to the gray-scale distribution concentration region; If the target feature region belongs to the concentrated grayscale distribution region, a grayscale enhancement model is constructed based on an attention mechanism to perform local enhancement processing on the road segment image acquisition results, thereby obtaining the road segment image enhancement results. The obtained road segment image enhancement results include: A training image set is acquired, wherein the training image set includes regions of interest (ROIs); Get the template of the area of ​​interest; Based on the region of interest, perform local grayscale transformation to obtain a locally grayscale enhanced image; The grayscale enhancement model includes an attention layer and a grayscale enhancement layer; The training image set and the region of interest template are input into the attention layer to obtain the feature region comparison pass signal; When the feature region comparison pass signal is 1, the gray-level enhancement layer is activated to perform local enhancement processing on the region of interest, and enhancement loss analysis is performed based on the local gray-level enhanced image. The grayscale enhancement model is generated when the enhancement loss value is less than or equal to the preset loss amount for a preset number of consecutive preset times.

2. The method as described in claim 1, characterized in that, Images of a pre-defined road section are captured using a high-position camera, and the resulting images include: The light intensity information of the preset road section is obtained through a light intensity sensor; When the light intensity information is less than the light intensity threshold, the CCD supplementary lighting camera is activated to acquire images of the preset road segment and obtain the image acquisition results of the road segment. When the light intensity information is greater than or equal to the light intensity threshold, the spherical camera is activated to acquire images of the preset road segment and obtain the image acquisition results of the road segment.

3. The method as described in claim 1, characterized in that, Gray-level distribution analysis is performed on the image acquisition results of the road segment to obtain a gray-level distribution histogram, wherein the gray-level distribution histogram includes gray-level concentration regions, including: The pixel features of the image acquisition results of the road segment are extracted by traversing the image to obtain grayscale feature information; Based on the preset grayscale deviation, hierarchical clustering analysis is performed on the grayscale feature information to obtain the grayscale feature clustering results; Based on the clustering results of the gray-level features, the gray-level distribution histogram is constructed; The gray-level distribution histogram is analyzed to obtain the concentrated gray-level distribution region.

4. The method as described in claim 3, characterized in that, A concentrated analysis is performed on the gray-level distribution histogram to obtain the concentrated gray-level distribution region, including: Perform sparsity analysis on the k-th histogram to obtain the sparse coefficient of the k-th histogram distribution; When the distribution sparsity coefficient is less than or equal to the first sparsity coefficient threshold, the sum of the distribution frequencies is obtained; When the sum of the distribution frequencies is greater than or equal to the frequency sum threshold, the grayscale distribution concentration area is obtained.

5. The method as described in claim 4, characterized in that, Perform sparsity analysis on the k-th histogram to obtain the sparse coefficients of the k-th histogram distribution, including: For the k-th histogram, calculate the boundary distance with the adjacent histograms to obtain the first gray-level distance and the second gray-level distance; Calculate the mean of the sum of the first gray-level distance and the reciprocal of the second gray-level distance to obtain the distribution density of the k-th histogram; Traverse the grayscale distribution histogram to obtain the mean histogram distribution density; The ratio of the mean distribution density of the histogram to the distribution density of the k-th histogram is calculated and set as the first-order sparsity coefficient of the k-th histogram. When the first-level sparsity coefficient of the k-th histogram is greater than or equal to the second sparsity coefficient threshold, the boundary distance between the k-th histogram and the neighboring histograms is calculated to obtain the third gray-scale distance and the fourth gray-scale distance. Based on the first gray-scale distance, the second gray-scale distance, the third gray-scale distance, and the fourth gray-scale distance, calculate the second-order sparsity coefficient of the k-th histogram; Repeat the iteration until the q-th level sparse coefficient of the k-th histogram is less than the second sparse coefficient threshold, then set the q-th level sparse coefficient of the k-th histogram as the sparse coefficient of the k-th histogram distribution.

6. An image enhancement system based on an attention mechanism, characterized in that, The system is used to implement the image enhancement method based on an attention mechanism according to any one of claims 1-5, the system comprising: A road segment image acquisition module is used to acquire images of a preset road segment using a high-position camera and obtain the road segment image acquisition results. A grayscale distribution analysis module is used to perform grayscale distribution analysis on the road segment image acquisition results and obtain a grayscale distribution histogram, wherein the grayscale distribution histogram includes a grayscale distribution concentration region; The user interest target module is used to receive the target of interest from the user terminal and obtain the texture feature information and shape feature information of the target of interest. An image region recognition module is used to identify the target feature region by analyzing the road segment image acquisition results based on the texture feature information and the shape feature information. A target region determination module is used to determine whether the target feature region belongs to the gray-scale distribution concentration region. The image enhancement result module is used to construct a grayscale enhancement model based on an attention mechanism if the target feature region belongs to the grayscale distribution concentration region, and to perform local enhancement processing on the road segment image acquisition results to obtain road segment image enhancement results. Obtaining the road segment image enhancement results includes: A training image set is acquired, wherein the training image set includes regions of interest (ROIs); Get the template of the area of ​​interest; Based on the region of interest, perform local grayscale transformation to obtain a locally grayscale enhanced image; The grayscale enhancement model includes an attention layer and a grayscale enhancement layer; The training image set and the region of interest template are input into the attention layer to obtain the feature region comparison pass signal; When the feature region comparison pass signal is 1, the gray-level enhancement layer is activated to perform local enhancement processing on the region of interest, and enhancement loss analysis is performed based on the local gray-level enhanced image. The grayscale enhancement model is generated when the enhancement loss value is less than or equal to the preset loss amount for a preset number of consecutive preset times.

Citation Information

Patent Citations

  • Multi-feature adaptive fused ship tracking and track detecting method

    CN102081801A

  • Method and system for detecting food-borne disease pathogens based on microfluid

    CN116500263A