Dynamic white balance adjustment method and system for hysteroscopic field of view optimization

Through the dynamic white balance adjustment method based on the importance index, the key areas in the hysteroscopic image are optimized, and the problem of image color distortion in the traditional method is solved, achieving higher visual quality and diagnostic accuracy.

CN119342359BActive Publication Date: 2025-03-18SHANGHAI YODO MEDICAL TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411860925.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-18
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

Traditional white balance methods cannot accurately identify and process key areas in hysteroscopic images, resulting in distortion of the image color and affecting the clarity and recognition of the surgical field of vision.

Method used

The importance index of the detection area is preferred to optimize the target area that doctors are concerned about, generate a global weight matrix, clarify the importance distribution of each pixel point, and weight the gain value of each pixel point in the detection area based on the global weight matrix, and adjust the dynamic gain value.

Benefits of technology

It improves the allocation effect of computing resources, ensures that the color performance of key areas is more realistic, and improves the visual quality and diagnostic accuracy of hysteroscopic images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342359B_ABST
    Figure CN119342359B_ABST
Patent Text Reader

Abstract

The present invention discloses a dynamic white balance adjustment method and system for optimizing the visual field of hysteroscope, and relates to the technical field of image optimization. After obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area, all detection areas are first sorted according to the importance index, a region list is generated, and then a global weight matrix is ​​generated based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel point in the detection area is weightedly calculated according to the region list sorting result, and the RGB channel dynamic gain value of each pixel point is adjusted. The adjustment system is based on the importance index of the detection area, and the target area that the doctor is concerned about is optimized first, a global weight matrix is ​​generated for the image, the importance distribution of each pixel point is clarified, and the allocation effect of computing resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image optimization, and in particular to a dynamic white balance adjustment method and system for optimizing the visual field of a hysteroscope. Background Art

[0002] Hysteroscope is a minimally invasive medical device commonly used to diagnose and treat intrauterine diseases. The image quality directly affects the doctor's surgical accuracy and diagnostic results. During hysteroscopic examination and surgery, due to the complex lighting conditions in the uterine cavity, the various types of light sources (such as cold light sources, LED light sources, etc.), and the optical properties of the uterine cavity liquid medium (such as turbidity and color) will change, the color of the image in the field of view may be distorted, affecting the clarity and recognition of the surgical field of view.

[0003] The prior art has the following defects:

[0004] Traditional white balance methods lack accurate identification and processing of key areas in the image (such as lesions and surgical tools). They usually perform uniform adjustments on the entire image. The colors of key areas may be distorted due to lack of focus optimization, which affects the diagnosis results, ignores the importance of the area of ​​interest, and reduces the allocation of computing resources.

[0005] Based on this, the present invention proposes a dynamic white balance adjustment method and system for optimizing the hysteroscopic field of view. Based on the importance index of the detection area, the target area of ​​concern to the doctor is optimized first, a global weight matrix is ​​generated for the image, the importance distribution of each pixel point is clarified, and the allocation effect of computing resources is improved. Summary of the invention

[0006] The purpose of the present invention is to provide a dynamic white balance adjustment method and system for optimizing the hysteroscopic field of view, so as to solve the shortcomings of the background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solution: a dynamic white balance adjustment method for optimizing the hysteroscopic field of view, the adjustment method comprising the following steps:

[0008] The adjustment system extracts the global and local features of the current hysteroscopic image, classifies the current scene based on the global and local features, segments the detection area in the image through the region growing algorithm, analyzes the color characteristics and positional relationship of the detection area, and marks the detection area that needs to be optimized;

[0009] After obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area. All detection areas are first sorted according to the importance index to generate an area list, and then a global weight matrix is ​​generated based on the importance index.

[0010] According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weightedly calculated according to the sorting result of the area list, and the dynamic gain value of the RGB channel of each pixel is adjusted.

[0011] In a preferred embodiment, after obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area, all detection areas are sorted according to the importance index, and an area list is generated, including the following steps:

[0012] Obtain the color deviation, texture complexity, edge clarity and position index of the detection area;

[0013] The importance index is obtained by comprehensively calculating the color deviation, texture complexity, edge clarity and position index. The expression is: , where is the importance index, is the position index, is the color deviation, is the texture complexity, is the edge definition, , , is the adjustment coefficient, and , , All are greater than 0;

[0014] After obtaining the importance index of all detection areas, all detection areas are sorted from large to small according to the importance index to generate an area list.

[0015] In a preferred embodiment, generating a global weight matrix based on the importance index comprises the following steps:

[0016] Initialize a matrix of the same size as the image, with each element in the matrix initially set to 1. Sum the importance indexes of all detection areas to obtain the total index value, and divide the importance index by the total index value to obtain the weight of the detection area. After obtaining the weight of each detection area, construct a global weight matrix. The global weight matrix of the entire image is represented as an M×N matrix, in which each element represents the weight of the corresponding detection area in the image. The expression of the global weight matrix is:

[0017] , where is the global weight matrix, Indicates the location of the detection area in the image The weight of .

[0018] In a preferred embodiment, weighted calculation is performed on the RGB channel gain value of each pixel point in the detection area according to the sorting result of the area list, and the RGB channel dynamic gain value of each pixel point is adjusted, including the following steps:

[0019] Based on the sorted list of regions, calculate the position for each region and Channel The adjusted gain value is expressed as: , where Indicates location and Channel The adjusted gain value, Represents the original RGB channel gain value, represents the weight value of the detection area position obtained from the global weight matrix, and the calculation expression of the dynamic gain value is:

[0020] , where For location and Channel The adjusted dynamic gain value, Represents the original RGB channel color value.

[0021] In a preferred embodiment, the logic for obtaining the position index is: obtaining the number of lesions and the number of tissues in the detection area through hysteroscopic images, and obtaining the position index from the number of lesions and the number of tissues;

[0022] The calculation expression of the color deviation is:

[0023] , where , , is the actual RGB value of the current pixel in the detection area, , , It is the standard RGB value of the current pixel in the detection area.

[0024] In a preferred embodiment, the calculation expression of the texture complexity is: , where is the probability of pixel pairs in the gray-level co-occurrence matrix, indicating that the gray level is and The frequency of occurrence of pixel pairs in the image, is the difference between pixel gray values;

[0025] The calculation expression of the edge definition is:

[0026] , where , are the gradient values ​​calculated by the Sobel operator in the horizontal and vertical directions, are the coordinates of the pixels in the detection area.

[0027] In a preferred embodiment, the detection area in the image is segmented by a region growing algorithm, the color characteristics and position relationship of the detection area are analyzed, and the detection area that needs to be optimized is marked, including the following steps:

[0028] For each seed point, check its neighboring pixels to determine whether these neighboring pixels meet the growth conditions, add the neighboring pixels that meet the growth conditions to the growth area, and continue to expand to new neighboring pixels until no pixels meet the conditions;

[0029] Continue to perform region growing on different seed points until all the required detection areas in the image are segmented, and repeat the growing process on other parts of the image to obtain the detection areas;

[0030] For each segmented detection area, extract the RGB color value distribution of the detection area, calculate the color difference between the detection areas, and analyze the color consistency between different detection areas;

[0031] According to the color characteristics and positional relationships, the detection areas that need to be optimized are identified, the detection areas are marked with different colors or labels, and the coordinate information of each marked area is output.

[0032] A dynamic white balance adjustment system for optimizing the hysteroscopic field of view, including a scene classification module, a regional analysis module, and a dynamic balance module;

[0033] Scene classification module: extract the global features and local features of the current hysteroscopic image, and classify the current scene based on the global features and local features;

[0034] Regional analysis module: segment the detection area in the image through the region growing algorithm, analyze the color characteristics and position relationship of the detection area, mark the detection area that needs to be optimized, obtain the importance of each detection area relative to the current classification scene, generate an importance index for the detection area, sort all the detection areas according to the importance index, and generate a region list;

[0035] Dynamic balance module: Generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weightedly calculated according to the area list sorting result, and the RGB channel dynamic gain value of each pixel is adjusted.

[0036] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0037] The present invention analyzes the color characteristics and positional relationship of the detection area, marks the detection area that needs to be optimized, obtains the importance of each detection area relative to the current classification scene, generates an importance index for the detection area, first sorts all the detection areas according to the importance index, generates a region list, and then generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel point in the detection area is weightedly calculated according to the region list sorting result, and the RGB channel dynamic gain value of each pixel point is adjusted. The adjustment system is based on the importance index of the detection area, prioritizes the optimization of the target area that the doctor is concerned about, generates a global weight matrix for the image, clarifies the importance distribution of each pixel point, and improves the allocation effect of computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0039] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Example 1: Please refer to Figure 1 As shown, the dynamic white balance adjustment method for optimizing the hysteroscopic field of view described in this embodiment includes the following steps:

[0042] The adjustment system extracts the global features (such as brightness distribution and color histogram) and local features (such as texture and edge information) of the current hysteroscopic image, classifies the current scene according to the global and local features, segments the detection area in the image through the region growing algorithm, analyzes the color characteristics (RGB value distribution) and positional relationship of the detection area, marks the detection area that needs to be optimized, obtains the importance of each detection area relative to the current classification scene, generates an importance index for the detection area, first sorts all the detection areas according to the importance index, generates a region list, and then generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weightedly calculated according to the region list sorting result, and the RGB channel dynamic gain value of each pixel is adjusted, so as to give priority to color correction for key areas with higher weights to ensure that the colors of these areas are more realistic.

[0043] This application analyzes the color characteristics and positional relationship of the detection area, marks the detection area that needs to be optimized, obtains the importance of each detection area relative to the current classification scene, generates an importance index for the detection area, first sorts all detection areas according to the importance index, generates a region list, and then generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel point in the detection area is weighted and calculated according to the region list sorting result, and the RGB channel dynamic gain value of each pixel point is adjusted. The adjustment system is based on the importance index of the detection area, and the target area of ​​the doctor's concern is optimized first. A global weight matrix is ​​generated for the image, the importance distribution of each pixel point is clarified, and the allocation effect of computing resources is improved.

[0044] Embodiment 2: Adjusting the system to extract global features (such as brightness distribution, color histogram) and local features (such as texture, edge information) of the current hysteroscopic image, and classifying the current scene according to the global features and local features, including the following steps:

[0045] Brightness distribution: Calculate the brightness histogram of the image to obtain the brightness distribution of the image, which helps to identify brightness changes in the environment (such as changes in light source intensity).

[0046] Color Histogram: Counts the color distribution of each channel (RGB) of the image, identifies the hue shift of the image (such as bluish or reddish), and helps evaluate the need for preliminary white balance adjustments.

[0047] Objective: Global features are used to identify the overall light and color distribution of an image and provide preliminary judgment for subsequent scene classification.

[0048] Texture features: Use local binary patterns (LBP) or gray-level co-occurrence matrix (GLCM) to extract texture features of the image. Texture information helps to identify the details of tissues in the image, such as blood vessels, tissue structures, etc.

[0049] Edge information: Use methods such as Canny edge detection or Sobel operator to extract edge information of the image to identify important structural boundaries in the image (such as instrument edges, boundaries of diseased tissues, etc.).

[0050] Objective: Local features are mainly used to detect target areas (such as lesions, tools, etc.) and provide a basis for subsequent regional segmentation and optimization.

[0051] By combining global and local features, machine learning or deep learning models (such as convolutional neural networks (CNNs)) are used to classify the current scene. The classification steps include:

[0052] The extracted global features and local features are fused to form a feature vector containing global and local information of the image.

[0053] Input into a pre-trained scene classification model (such as CNN, SVM, etc.) for scene classification. Common classification scenarios may include:

[0054] Clear liquid environment: The liquid is transparent and the color is relatively uniform.

[0055] Turbid blood environment: The background is turbid and may have a red or dark hue.

[0056] Tissue is close to the environment: tissues, instruments, etc. appear in the image.

[0057] According to the classification result, the scene type to which the current hysteroscopic image belongs is identified, and a scene label (such as clear liquid, turbid blood or tissue display, etc.) is output. The scene classification step belongs to the prior art and will not be described in detail in this application.

[0058] The detection area in the image is segmented by the region growing algorithm, the color characteristics (RGB value distribution) and position relationship of the detection area are analyzed, and the detection area that needs to be optimized is marked, including the following steps:

[0059] Starting from the seed point, it expands to the surrounding pixels until the color and texture characteristics of the area no longer meet the preset conditions.

[0060] Pixel neighborhood check: For each seed point, check its neighboring pixels (4-neighborhood or 8-neighborhood) to determine whether these neighboring pixels meet the growth conditions (for example, whether the color or gray value difference between adjacent pixels is within an acceptable range).

[0061] Growth condition: Usually a threshold range is set (such as the maximum difference in color or grayscale), and only neighborhood pixels that meet this condition will be added to the growth area.

[0062] Update the growing region: add the neighboring pixels that meet the conditions to the current region and continue to expand to new neighboring pixels until no pixels meet the conditions.

[0063] Continue to grow regions at different seed points until all the required detection regions in the image are segmented. Repeat the above process in other parts of the image to ensure that each region of interest can be effectively segmented.

[0064] Analyze the color distribution of each detection area to provide a basis for subsequent optimization strategies.

[0065] For each segmented region, extract the RGB color value distribution of the region. For example, you can calculate the mean, variance, histogram and other statistical features of the R, G, and B channels in each region to help identify color deviations and areas that need to be optimized.

[0066] Determine the color deviation and positional relationship of each detection area to provide guidance for subsequent optimization. Calculate the color difference between regions (for example, through color distance measurement, such as Euclidean distance or color difference formula), analyze the color consistency between different regions, especially the color consistency of key areas (such as lesions). Identify the areas that need to be optimized based on color characteristics and positional relationships. Based on the color analysis results, set thresholds to determine areas with uneven colors or excessive color deviations. Prioritize optimization of areas with large differences in color characteristics, which may be lesion areas, key tissue areas, etc. If there is obvious color difference or uneven brightness in the area, optimization is required as a priority.

[0067] Mark the areas that need to be optimized. You can use different colors or labels to ensure that these areas are given priority in the subsequent dynamic white balance adjustment. Output the coordinate information of each marked area (for example, the coordinates of a rectangular box or polygonal area), which will be used in the subsequent gain adjustment process.

[0068] After obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area, including the following steps:

[0069] Obtain the color deviation, texture complexity, edge clarity and position index of the detection area;

[0070] The importance index is obtained by comprehensively calculating the color deviation, texture complexity, edge clarity and position index. The expression is: , where is the importance index, is the position index, is the color deviation, is the texture complexity, is the edge definition, , , is the adjustment coefficient, and , , Both are greater than 0.

[0071] The logic of obtaining the position index is: obtain the number of lesions and tissues in the detection area through hysteroscopic images, and obtain the position index by converting the number of lesions and tissues;

[0072] The calculation expression of color deviation is:

[0073] , where , , is the actual RGB value of the current pixel in the detection area, , , It is the standard RGB value of the current pixel in the detection area.

[0074] The calculation expression of texture complexity is: , where is the probability of pixel pairs in the gray-level co-occurrence matrix, indicating that the gray level is and The frequency of occurrence of pixel pairs in the image, The gray-level co-occurrence matrix (GLCM) is the difference between pixel gray values. It describes the spatial relationship between pixel pairs in an image and is usually used for texture analysis. It records the gray-level occurrence frequency of adjacent pixel pairs. The difference between pixel gray values ​​measures the brightness difference between two pixels in the image and is usually used to calculate the complexity of the texture or evaluate the color consistency of the image.

[0075] The calculation expression of edge clarity is:

[0076] , where , are the gradient values ​​calculated by the Sobel operator in the horizontal and vertical directions, To detect the coordinates of pixels in the area, the Sobel operator is used for edge detection. The rate of change of the image is measured by calculating the gradients of the image in the horizontal and vertical directions. The method for obtaining the gradient values ​​calculated by the Sobel operator in the horizontal and vertical directions belongs to the prior art and will not be repeated in this application.

[0077] Color deviation is a measure of how different the color of an area of ​​an image is from the ideal reference color. Large color deviations indicate that the color of that area is inaccurate and requires color adjustment.

[0078] The greater the color deviation, the greater the importance of the detection area. If the color deviation of an area is large, it means that it is very different from the expected color performance, which may affect the doctor's diagnosis or interpretation of the image, so this area needs to be optimized first.

[0079] When the color deviation is small, the color performance of the area is closer to the expected value, so its importance is low and does not require too much adjustment.

[0080] Areas with large color deviations are given priority in adjusting their colors to ensure they are more realistic and accurate.

[0081] Texture complexity reflects the richness of details in an image region and is usually quantified by calculating the gray-level co-occurrence matrix (GLCM) or other texture features of the image region. The greater the texture complexity, the richer the details in the region.

[0082] The higher the texture complexity, the more important the detection area is. Areas with rich details (such as the surface of tissues and organs) usually have high texture complexity, and these areas are crucial for doctors to make judgments. Areas with higher texture complexity need to receive more attention to ensure that details in the image are not lost or distorted.

[0083] Areas with less texture complexity, such as flat backgrounds or areas of a single color, do not require as much optimization and are therefore of less importance.

[0084] Areas with higher texture complexity, such as those with noticeable tissue texture, should be prioritized for optimization to preserve detail and clarity.

[0085] Edge clarity measures the clarity of the edges in an image region and is usually calculated using the Sobel operator or other edge detection algorithms. Regions with higher edge clarity have clear boundaries, which can help doctors better identify target areas.

[0086] The lower the edge clarity, the greater the importance of the detection area. If the edge of an image area is unclear (such as the edges in the image are not clearly distinguished), this area may affect the doctor's judgment and therefore needs to be optimized first. Areas with low edge clarity need to be enhanced by enhancing edge information to improve the accuracy of diagnosis.

[0087] Areas with higher edge clarity (such as obvious structural boundaries in the image) already have good edge performance, have a lower priority, and do not require much adjustment.

[0088] Areas with lower edge clarity should be optimized first to ensure clearer edges and improve image readability.

[0089] Areas with large color deviations: large differences in color performance, need to be adjusted first, and are of high importance. Areas with high texture complexity: rich details, need to retain more details, and are of high importance. Areas with low edge clarity: blurred edges, need to enhance edge clarity, and are of high importance.

[0090] In short, the values ​​of these three factors are directly related to the importance of the detection area. The more the area needs to be optimized, the more its corresponding color deviation, texture complexity and edge clarity values ​​tend to deviate from the ideal state. Therefore, it is crucial to give priority to these key areas during the optimization process.

[0091] Sort all detection areas according to the importance index and generate an area list, including the following steps:

[0092] After obtaining the importance index of all detection areas, all detection areas are sorted from large to small according to the importance index to generate an area list.

[0093] A global weight matrix is ​​generated based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel, including the following steps:

[0094] The global weight matrix is ​​a two-dimensional matrix in which each element represents the weight of the corresponding region in the RGB channel gain adjustment. This matrix is ​​generated based on the regional importance index and is used to guide the gain adjustment of each pixel and region in different channels.

[0095] Initialize a matrix of the same size as the image, with each element in the matrix initially set to 1. Sum the importance indexes of all regions to obtain the total index value, and divide the importance index by the total index value to obtain the weight of the region. After obtaining the weight of each region, construct a global weight matrix. The global weight matrix of the entire image is represented as an M×N matrix, in which each element represents the weight of the corresponding region in the image. The expression of the global weight matrix is:

[0096] , where is the global weight matrix, Indicates the location of the area in the image The weight of .

[0097] According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weighted and calculated according to the sorting result of the area list, and the dynamic gain value of the RGB channel of each pixel is adjusted, so as to give priority to color correction for key areas with higher weights to ensure that the colors of these areas are more realistic, including the following steps:

[0098] The gain range is set for each RGB channel based on the initial parameters of the scene classification (such as white balance parameters, light source characteristics, etc.). These parameters provide a reference for the gain adjustment of the RGB channels and determine the target range of gain adjustment, usually to adjust the color to be closer to the real color (such as white balance based on standard light sources or subjective feedback adjustment by doctors).

[0099] Based on the sorted list of regions, calculate the position for each region and Channel The adjusted gain value is expressed as:

[0100] , where Indicates location and Channel The adjusted gain value, Represents the original RGB channel gain value, Represents the weight value of the detection area position obtained from the global weight matrix;

[0101] The calculation expression of the dynamic gain value is:

[0102] , where For location and Channel The adjusted dynamic gain value, Represents the original RGB channel color value;

[0103] After adjusting the RGB channel gain values ​​of all pixels, an optimized hysteroscopic image is generated. The output image color will be more balanced, and the color performance of key areas will be enhanced, so that doctors can make more accurate diagnoses.

[0104] By weighting the RGB channel gain value of each pixel according to the global weight matrix and the initial parameters of the scene classification, combined with the sorting of the region list, the color performance of each region in the image can be effectively optimized. By giving priority to adjusting the regions with higher importance, the colors of the key regions in the image can be ensured to be more realistic, thereby improving the visual quality and diagnostic accuracy of hysteroscopic images.

[0105] Embodiment 3: The dynamic white balance adjustment system for optimizing the hysteroscopic visual field described in this embodiment includes a scene classification module, a region analysis module, and a dynamic balance module;

[0106] Scene classification module: extracts the global features (such as brightness distribution and color histogram) and local features (such as texture and edge information) of the current hysteroscopic image, classifies the current scene based on the global features and local features, and sends the classification results to the regional analysis module;

[0107] Regional analysis module: segment the detection area in the image through the region growing algorithm, analyze the color characteristics (RGB value distribution) and position relationship of the detection area, mark the detection area that needs to be optimized, obtain the importance of each detection area relative to the current classification scene, generate an importance index for the detection area, sort all detection areas according to the importance index, generate a region list, and send the region list and importance index to the dynamic balance module;

[0108] Dynamic balancing module: Generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weightedly calculated according to the area list sorting result, and the RGB channel dynamic gain value of each pixel is adjusted, so as to give priority to color correction for key areas with higher weights to ensure that the colors of these areas are more realistic.

[0109] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0110] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0111] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A dynamic white balance adjustment method for optimizing the visual field of a hysteroscope, characterized in that: The adjustment method comprises the following steps: The adjustment system extracts the global and local features of the current hysteroscopic image, classifies the current scene based on the global and local features, segments the detection area in the image through the region growing algorithm, analyzes the color characteristics and positional relationship of the detection area, and marks the detection area that needs to be optimized; After obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area. All detection areas are first sorted according to the importance index to generate an area list, and then a global weight matrix is ​​generated based on the importance index. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weighted and calculated according to the sorting result of the area list, and the dynamic gain value of the RGB channel of each pixel is adjusted; After obtaining the importance of each detection area relative to the current classification scene, an importance index is generated for the detection area, and all detection areas are sorted according to the importance index to generate an area list, including the following steps: Obtain the color deviation, texture complexity, edge clarity and position index of the detection area; The importance index is obtained by comprehensively calculating the color deviation, texture complexity, edge clarity and position index. The expression is: , where is the importance index, is the position index, is the color deviation, is the texture complexity, is the edge definition, , , is the adjustment coefficient, and , , All are greater than 0; After obtaining the importance index of all detection areas, all detection areas are sorted from large to small according to the importance index to generate an area list.

2. The dynamic white balance adjustment method for hysteroscopic visual field optimization according to claim 1, characterized in that: Generating a global weight matrix based on the importance index includes the following steps: Initialize a matrix of the same size as the image, with each element in the matrix initially set to 1. Sum the importance indexes of all detection areas to obtain the total index value, and divide the importance index by the total index value to obtain the weight of the detection area. After obtaining the weight of each detection area, construct a global weight matrix. The global weight matrix of the entire image is represented as an M×N matrix, in which each element represents the weight of the corresponding detection area in the image. The expression of the global weight matrix is: , where is the global weight matrix, Indicates the location of the detection area in the image The weight of .

3. The dynamic white balance adjustment method for hysteroscopic visual field optimization according to claim 2, characterized in that: According to the sorting result of the area list, a weighted calculation is performed on the RGB channel gain value of each pixel point in the detection area, and the RGB channel dynamic gain value of each pixel point is adjusted, including the following steps: Based on the sorted list of regions, calculate the position for each region and Channel The adjusted gain value is expressed as: , where Indicates location and Channel The adjusted gain value, Represents the original RGB channel gain value, represents the weight value of the detection area position obtained from the global weight matrix, and the calculation expression of the dynamic gain value is: , where For location and Channel The adjusted dynamic gain value, Represents the original RGB channel color value.

4. The dynamic white balance adjustment method for hysteroscopic visual field optimization according to claim 3, characterized in that: The calculation expression of the color deviation is: , where , , is the actual RGB value of the current pixel in the detection area, , , It is the standard RGB value of the current pixel in the detection area.

5. The dynamic white balance adjustment method for hysteroscopic visual field optimization according to claim 4, characterized in that: The calculation expression of the texture complexity is: , where is the probability of pixel pairs in the gray-level co-occurrence matrix, indicating that the gray level is and The frequency of occurrence of pixel pairs in the image, is the difference between pixel gray values; The calculation expression of the edge definition is: , where , are the gradient values ​​calculated by the Sobel operator in the horizontal and vertical directions, are the coordinates of the pixels in the detection area.

6. The dynamic white balance adjustment method for hysteroscopic visual field optimization according to claim 5, characterized in that: The detection area in the image is segmented by the region growing algorithm, the color characteristics and position relationship of the detection area are analyzed, and the detection area that needs to be optimized is marked, including the following steps: For each seed point, check its neighboring pixels to determine whether these neighboring pixels meet the growth conditions, add the neighboring pixels that meet the growth conditions to the growth area, and continue to expand to new neighboring pixels until no pixels meet the conditions; Continue to perform region growing on different seed points until all the required detection areas in the image are segmented, and repeat the growing process on other parts of the image to obtain the detection areas; For each segmented detection area, extract the RGB color value distribution of the detection area, calculate the color difference between the detection areas, and analyze the color consistency between different detection areas; According to the color characteristics and positional relationships, the detection areas that need to be optimized are identified, the detection areas are marked with different colors or labels, and the coordinate information of each marked area is output.

7. A dynamic white balance adjustment system for optimizing the visual field of a hysteroscope, used to implement the adjustment method according to any one of claims 1 to 6, characterized in that: Including scene classification module, regional analysis module, and dynamic balance module; Scene classification module: extract the global features and local features of the current hysteroscopic image, and classify the current scene based on the global features and local features; Regional analysis module: segment the detection area in the image through the region growing algorithm, analyze the color characteristics and position relationship of the detection area, mark the detection area that needs to be optimized, obtain the importance of each detection area relative to the current classification scene, generate an importance index for the detection area, sort all the detection areas according to the importance index, and generate a region list; Dynamic balance module: Generates a global weight matrix based on the importance index. The global weight matrix is ​​used to guide the gain adjustment of each channel. According to the global weight matrix and the initial parameters of the scene classification, the RGB channel gain value of each pixel in the detection area is weightedly calculated according to the area list sorting result, and the RGB channel dynamic gain value of each pixel is adjusted.

Citation Information

Patent Citations

  • Image processing method and device, storage medium and electronic equipment

    CN108764208A

  • Multi-sensor white balance synchronization method and electronic device using same

    CN114554170A