White balance gain parameter correction method, device and equipment

By calculating the deviation value of the red, green and blue component of the blood sample picture and inputting it into the white balance gain parameter correction model, the white balance gain parameters of the blood analyzer are automatically corrected, and the complex and cumbersome problem of parameter correction in the prior art is solved, improving the accuracy of the picture and the stability and accuracy of cell recognition.

CN120238753APending Publication Date: 2025-07-01CHANGSHA HONGAN JIYUAN BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510461546.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

When the light changes or the concentration of the blood sample staining solution changes, the preset white balance gain parameters cannot be adapted, resulting in inaccurate pictures and requires manual adjustments, which makes the process complex and cumbersome.

Method used

By obtaining the preset white balance gain parameters, taking multiple pictures of blood samples, counting the number of pictures that meet the preset ideal white balance conditions, calculating the red, green and blue component deviation value of the pictures that do not meet the conditions, input it into the white balance gain parameter correction model, obtaining the gain adjustment value and correcting parameters.

Benefits of technology

Automatic correction of white balance gain parameters is achieved, which reduces manual intervention, simplifies the correction process, shortens time and cost, and improves the accuracy of blood sample pictures and the stability and accuracy of cell recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238753A_ABST
    Figure CN120238753A_ABST
Patent Text Reader

Abstract

The invention relates to a white balance gain parameter correction method, apparatus and device. The method comprises the steps of obtaining a preset white balance gain parameter; shooting a plurality of positions of the target blood sample according to a preset white balance gain parameter to obtain a plurality of pictures; counting the number of the pictures meeting a preset ideal white balance condition in the plurality of pictures, and judging whether the ratio of the number of the pictures to the total number of the plurality of pictures is greater than a preset threshold value or not; if not, calculating the deviation between the red, green and blue component values of the pictures which do not meet the preset ideal white balance condition in the plurality of pictures and a preset ideal red, green and blue component value interval to obtain a target red, green and blue component deviation value, and inputting the target red, green and blue component deviation value into a white balance gain parameter correction model to obtain a red, green and blue component gain adjustment value; and correcting a preset white balance gain parameter according to the red-green-blue component gain adjustment value. Therefore, according to the scheme, the white balance gain parameter is automatically corrected, manual intervention is not needed, and the parameter correction process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blood analyzers, and particularly to a method, device, and equipment for correcting white balance gain parameters. Background Art

[0002] Currently, microscopy-based blood analyzers use image methods to analyze blood for disease diagnosis assistance. Specifically, a picture of a blood sample is taken by a camera on the blood analyzer. The analyzer classifies and counts the types of cells in the picture using image recognition methods. It can be seen that the accuracy of the picture plays an important role in disease diagnosis. The accuracy and stability of white balance during camera shooting by the blood analyzer have a great impact on the accuracy of image recognition.

[0003] Currently, the cameras on existing blood analyzers use preset white balance gain parameters to finely adjust and correct the default white balance.

[0004] However, when the lighting on the blood analyzer changes or the concentration of the staining solution in the blood sample changes, the preset white balance gain parameters may not be able to adapt to the environmental changes, and there may be differences between the pictures taken and the ideal pictures required, resulting in the inability to truly reflect the characteristics of the blood sample when the blood analyzer performs image recognition. At this time, the user can only manually adjust and verify the preset white balance gain parameters multiple times based on the pictures taken by the blood analyzer to meet the ideal white balance requirements. It can be seen that this solution is relatively complex and cumbersome, requiring a large amount of manpower and material resources. Summary of the Invention

[0005] Embodiments of this application provide a method, device, and computer equipment for correcting white balance gain parameters, aiming to solve the problem of the cumbersome process of manually correcting white balance parameters.

[0006] In a first aspect, embodiments of this application provide a method for correcting white balance gain parameters, which includes:

[0007] Obtain preset white balance gain parameters;

[0008] Take pictures of multiple positions of a target blood sample according to the preset white balance gain parameters to obtain multiple pictures of the target blood sample;

[0009] Count the number of pictures that meet the preset ideal white balance condition among the multiple pictures, and the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within a preset ideal red, green, and blue component value range;

[0010] Determine whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold;

[0011] Otherwise, calculate the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation value;

[0012] Input the target red, green, and blue component deviation value into the white balance gain parameter correction model to obtain the red, green, and blue component gain adjustment value;

[0013] Correct the preset white balance gain parameter according to the red, green, and blue component gain adjustment value.

[0014] Optionally, the preset ideal red, green, and blue component value range is obtained through the following steps:

[0015] Obtain pictures of multiple blood samples;

[0016] Screen the pictures that meet the preset accuracy and preset stability from the pictures of the multiple blood samples to obtain ideal sample pictures;

[0017] Determine the preset ideal red, green, and blue component value range according to the red, green, and blue component values of each picture in the ideal sample pictures.

[0018] Optionally, the preset ideal red, green, and blue component value range includes: a red component value range, a green component value range, and a blue component value range. Determining the ideal red, green, and blue component value range according to the red, green, and blue component values of each picture in the ideal sample pictures includes:

[0019] Determine the red component value range according to the maximum and minimum values of the corresponding red component values in the ideal sample pictures;

[0020] Determine the green component value range according to the maximum and minimum values of the corresponding green component values in the ideal sample pictures;

[0021] Determine the blue component value range according to the maximum and minimum values of the corresponding blue component values in the ideal sample pictures.

[0022] Optionally, calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation value includes:

[0023] Screen the pictures that do not meet the preset ideal white balance condition from the multiple pictures to obtain abnormal pictures;

[0024] Calculate the average red, green, and blue component values of the abnormal pictures according to the red, green, and blue component values of the abnormal pictures;

[0025] Calculate the deviation between the average red, green, and blue component values and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation value.

[0026] Optionally, the average red, green, and blue component values include: the average value of the red component, the average value of the green component, and the average value of the blue component. Calculating the average red, green, and blue component values of the abnormal image based on the red, green, and blue component values of the abnormal image includes:

[0027] Extract the red, green, and blue component values of each image from the abnormal image respectively to obtain a first red component dataset, a first green component dataset, and a first blue component dataset;

[0028] Remove the maximum and minimum values from the first red component dataset, the first green component dataset, and the first blue component dataset respectively to obtain a second red component dataset, a second green component dataset, and a second blue component dataset;

[0029] Calculate the corresponding component average values in the second red component dataset, the second green component dataset, and the second blue component dataset respectively to obtain the average value of the red component, the average value of the green component, and the average value of the blue component.

[0030] Optionally, before inputting the target red, green, and blue component deviation value into the white balance gain parameter correction model to obtain the red, green, and blue component gain adjustment values, the method further includes:

[0031] Based on a preset multiple linear regression function, establish a mapping relationship between the red, green, and blue component deviation values and the red, green, and blue component gain adjustment values. Use the least squares method to solve the coefficients of the preset multiple linear regression function through a training dataset to obtain the white balance gain parameter correction model. The training dataset includes the deviations between the red, green, and blue component values of abnormal images of multiple blood samples and the preset ideal red, green, and blue component value range and the corresponding white balance gain parameters of the deviations.

[0032] Optionally, before calculating the deviations between the red, green, and blue component values of the images that do not meet the preset ideal white balance condition among the multiple images and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation values, the method further includes:

[0033] Judge whether the correction times of the preset white balance gain parameter are greater than the preset correction times;

[0034] If not, execute the step of calculating the deviations between the red, green, and blue component values of the images that do not meet the preset ideal white balance condition among the multiple images and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation values;

[0035] If so, prompt that the correction of the preset white balance gain parameter fails.

[0036] Optionally, after correcting the preset white balance gain parameter according to the red, green, and blue component gain adjustment values, the method further includes:

[0037] Updating the correction count of the preset white balance gain parameter.

[0038] In a second aspect, an embodiment of the present application further provides a white balance gain parameter correction device, and the device includes:

[0039] An acquisition unit, configured to acquire a preset white balance gain parameter;

[0040] A shooting unit, configured to shoot multiple positions of a target blood sample according to the preset white balance gain parameter to obtain multiple pictures of the target blood sample;

[0041] A statistics unit, configured to count the number of pictures that meet the preset ideal white balance condition among the multiple pictures, and the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within a preset ideal red, green, and blue component numerical range;

[0042] A judgment unit, configured to judge whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold;

[0043] A calculation unit, configured to calculate, if the ratio of the number of pictures to the total number of the multiple pictures is less than the preset threshold, the deviation between the red, green, and blue component numerical values of the pictures that do not meet the preset ideal white balance condition and the preset ideal red, green, and blue component numerical range, to obtain a target red, green, and blue component deviation value;

[0044] An input unit, configured to input the target red, green, and blue component deviation value into a white balance gain parameter correction model to obtain a red, green, and blue component gain adjustment value;

[0045] A correction unit, configured to correct the preset white balance gain parameter according to the red, green, and blue component gain adjustment values.

[0046] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, and a computer program is stored on the memory, and when the processor executes the computer program, the above method is implemented.

[0047] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, the above method can be implemented.

[0048] An embodiment of the present application provides a method, apparatus, and computer device for correcting white balance gain parameters. Among them, the method includes: obtaining preset white balance gain parameters; taking pictures of multiple positions of a target blood sample according to the preset white balance gain parameters to obtain multiple pictures of the target blood sample; counting the number of pictures that meet the preset ideal white balance condition among the multiple pictures, where the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within a preset ideal red, green, and blue component value range; determining whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold; if not, calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range to obtain a target red, green, and blue component deviation value; inputting the target red, green, and blue component deviation value into a white balance gain parameter correction model to obtain a red, green, and blue component gain adjustment value; and correcting the preset white balance gain parameters according to the red, green, and blue component gain adjustment value. In the embodiment of the present application, by calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range, a target red, green, and blue component deviation value is obtained, and the target red, green, and blue component deviation value is input into the white balance gain parameter correction model to obtain a red, green, and blue component gain adjustment value. This solution realizes automatic correction of the preset white balance gain parameters without manual intervention, simplifies the process of correcting the white balance gain parameters, thereby shortening the time for correcting the white balance gain parameters and reducing the cost of correcting the white balance gain parameters. Therefore, the pictures taken of the blood sample based on the corrected white balance gain parameters can truly reflect the conditions of various cells in the blood sample, so as to improve the stability and accuracy of cell recognition and classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0051] One or more embodiments are illustrated by way of example in the pictures in the corresponding accompanying drawings. These exemplary illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a proportional limitation.

[0052] Figure 1 FIG. 1 is one of the flow diagrams of a method for correcting white balance gain parameters provided by an embodiment of the present application;

[0053] Figure 2 A simplified diagram of a blood analyzer provided by an embodiment of the present application;

[0054] Figure 3 The second flowchart of a white balance gain parameter correction method provided by an embodiment of the present application;

[0055] Figure 4 The third flowchart of a white balance gain parameter correction method provided by an embodiment of the present application;

[0056] Figure 5 The fourth flowchart of a white balance gain parameter correction method provided by an embodiment of the present application;

[0057] Figure 6 A schematic diagram of a white balance gain parameter correction device provided by an embodiment of the present application;

[0058] Figure 7 A computer device provided by an embodiment of the present application. Detailed implementation manners

[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0060] The following disclosure provides many different embodiments or examples for implementing different structures of the present application. To simplify the disclosure of the present application, components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present application. In addition, the present application may repeat reference numerals and / or letters in different examples. Such repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0061] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0062] It should also be understood that the terms used in the specification of the present application are merely for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0063] It should be further understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0064] As used in this specification and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context.

[0065] In order to solve the technical problem that the process of manually correcting the white balance gain parameters in the prior art is complex and cumbersome, the present application provides a white balance gain parameter correction device, which can implement a white balance gain parameter correction method.

[0066] Please refer to Figure 1 , Figure 1 which is one of the flow diagrams of a white balance gain parameter correction method provided by an embodiment of the present application. In one embodiment, the white balance gain parameter correction method includes:

[0067] S1. Obtain preset white balance gain parameters;

[0068] The preset white balance gain parameters are the white balance parameters built into the blood analyzer when it leaves the factory. Optionally, the preset white balance gain parameters are obtained according to empirical data and can meet the shooting requirements in most environments.

[0069] S2. Take pictures of multiple positions of the target blood sample according to the preset white balance gain parameters to obtain multiple pictures of the target blood sample.

[0070] Please refer to Figure 2 , Figure 2It is a simplified diagram of a blood analyzer provided by an embodiment of the present application. Among them, the bottom is the illumination light, the middle is the reagent card counting board, and the upper part is the micro camera. The blood analyzer takes pictures of multiple positions of the target blood sample according to the preset white balance gain parameter. Specifically, the movement mechanism on the blood analyzer drives the reagent card counting board to move. The micro camera takes pictures of different positions of the target blood sample on the reagent card counting board. The 100 pictures of the target blood sample include pictures of different positions of the target blood sample. Preferably, the micro camera can take 100 pictures of the target blood sample. Of course, it can also take more or fewer than 100 pictures of the target blood sample. In this regard, the present application does not make any restrictions.

[0071] It should be noted that Figure 2 It is only a simplified diagram of a blood analyzer provided by an embodiment of the present application. The structure method and the movement mechanism during actual shooting are not limited to the use of the present invention. The method provided by the embodiment of the present application can be adapted to different instrument models and usage scenarios.

[0072] S3. Count the number of pictures that meet the preset ideal white balance condition among multiple pictures.

[0073] Among them, the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within the preset ideal red, green, and blue component value ranges. For example, the preset ideal red, green, and blue component value ranges are: the red component value range is [100, 120], the green component value range is [100, 140], and the blue component value range is [200, 220]. If the red, green, and blue component values of the picture are (101, 120, 201) respectively, and the red, green, and blue component values of the picture are within the preset ideal red, green, and blue component value ranges, then the picture meets the preset ideal white balance condition. If the red, green, and blue component values of the picture are (91, 120, 201) respectively, the green and blue component values of the picture are within the preset ideal green and blue component value ranges, but the red component value of the picture is not within the preset ideal red component value range, then the picture does not meet the preset ideal white balance condition. It should be noted that the preset ideal red, green, and blue component value ranges vary under different project conditions and different micro cameras.

[0074] S4. Determine whether the ratio of the number of pictures to the total number of multiple pictures is greater than the preset threshold.

[0075] The preset threshold is obtained by technicians based on experience, and this experience is obtained based on a large amount of experimental data. For example, if the number of pictures is 20 and the total number of multiple pictures is 100, then the ratio between the number of pictures and the total number of multiple pictures is 20%.

[0076] S5. If not, calculate the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition and the preset ideal red, green, and blue component value range in multiple pictures to obtain the target red, green, and blue component deviation value.

[0077] For example, if 80 out of 100 pictures do not meet the preset ideal white balance condition, then calculate the difference between the red, green, and blue component values of these 80 pictures and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation value. For example, the target red, green, and blue component deviation value is (+10, -22, +20). Among them, how to obtain the preset ideal red, green, and blue component value range will be introduced in detail in the following embodiments. Here, this application will not elaborate further.

[0078] S6. Input the target red, green, and blue component deviation value into the white balance gain parameter correction model to obtain the red, green, and blue component gain adjustment values.

[0079] For example, input the target red, green, and blue component deviation value of (+10, -22, +20) into the white balance gain parameter correction model to obtain the red, green, and blue component gain adjustment values of (-9, +20, -18). Among them, how to obtain the white balance gain parameter correction model will be introduced in detail in the following embodiments. Here, this application will not elaborate further.

[0080] S7. Correct the preset white balance gain parameter according to the red, green, and blue component gain adjustment values.

[0081] For example, correct the preset white balance gain parameter according to the obtained red, green, and blue component gain adjustment values of (-9, +20, -18) to obtain the corrected preset white balance gain parameter (-9, +20, -18).

[0082] S8. Do not correct the preset white balance gain parameter.

[0083] If the ratio of the number of pictures to the total number of multiple pictures is greater than the preset threshold, then there is no need to correct the preset ideal white balance gain parameter.

[0084] The blood analyzer takes pictures of the target blood sample according to the corrected preset white balance gain parameter, and repeats steps S1 - S7 until the pictures taken meet the preset ideal white balance condition. The entire white balance gain parameter correction process takes about 2 - 10 minutes.

[0085] An embodiment of the present application provides a method for correcting white balance gain parameters, including: obtaining preset white balance gain parameters; taking pictures of multiple positions of a target blood sample according to the preset white balance gain parameters to obtain multiple pictures of the target blood sample; counting the number of pictures that meet the preset ideal white balance condition among the multiple pictures, where the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within a preset ideal red, green, and blue component value range; determining whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold; if not, calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range to obtain a target red, green, and blue component deviation value; inputting the target red, green, and blue component deviation value into a white balance gain parameter correction model to obtain red, green, and blue component gain adjustment values; and correcting the preset white balance gain parameters according to the red, green, and blue component gain adjustment values. In the embodiment of the present application, by calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value range, a target red, green, and blue component deviation value is obtained, and the target red, green, and blue component deviation value is input into the white balance gain parameter correction model to obtain red, green, and blue component gain adjustment values. This solution realizes the automatic correction of the preset white balance gain parameters without manual intervention, simplifies the process of correcting the white balance gain parameters, thereby shortening the time for correcting the white balance gain parameters and reducing the cost of correcting the white balance gain parameters. Thus, the pictures taken of the blood sample based on the corrected white balance gain parameters can truly reflect the conditions of various cells in the blood sample, so as to improve the stability and accuracy of cell recognition and classification.

[0086] In one embodiment, the preset ideal red, green, and blue component value range is obtained through the following steps:

[0087] Step a: Obtain pictures of multiple blood samples.

[0088] Among them, the blood sample is a blood sample after white blood cell staining. Of course, it can also be a blood sample of red blood cells. The present application does not limit this.

[0089] Step b: Screen the pictures that meet the preset accuracy and preset stability from the pictures of multiple blood samples to obtain ideal sample pictures.

[0090] The pictures that meet the preset accuracy and preset stability are screened from the pictures of multiple historical blood samples by means of manual screening. Among them, the pictures that meet the preset accuracy and preset stability can more accurately reflect the true characteristics of the blood sample.

[0091] Step c: Confirm the preset ideal red, green, and blue component value range according to the red, green, and blue component values of each picture in the ideal sample pictures.

[0092] The preset ideal red, green, and blue component value ranges include: a red component value range, a green component value range, and a blue component value range. In one embodiment, determining the preset ideal red, green, and blue component value ranges according to the red, green, and blue component values of each picture in the ideal sample pictures includes:

[0093] Step A: Determine the red component value range according to the maximum and minimum values of the corresponding red component values in the ideal sample pictures.

[0094] For example, if there are 3 ideal sample pictures, and the red components of each picture are 100, 120, and 200 respectively, then the red component value range is [100, 200].

[0095] Step B: Determine the green component value range according to the maximum and minimum values of the corresponding green component values in the ideal sample pictures.

[0096] The calculation method of the green component value range in Step B is similar to that of the red component value range in Step A. For this, the present application will not elaborate further.

[0097] Step C: Determine the blue component value range according to the maximum and minimum values of the corresponding blue component values in the ideal sample pictures.

[0098] The calculation method of the blue component value range in Step C is similar to that of the red component value range in Step A. For this, the present application will not elaborate further.

[0099] Please refer to Figure 3 , Figure 3 which is the second flowchart of a white balance gain parameter correction method provided by an embodiment of the present application. In one embodiment, calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition in the multiple pictures and the preset ideal red, green, and blue component value ranges to obtain the target red, green, and blue component deviation values includes:

[0100] S51: Screen out the pictures that do not meet the preset ideal white balance from the multiple pictures to obtain abnormal pictures.

[0101] S52: Calculate the average red, green, and blue component values of the abnormal pictures according to the red, green, and blue component values of the abnormal pictures.

[0102] Among them, the average red, green, and blue component values include: the average value of the red component, the average value of the green component, and the average value of the blue component. In one embodiment, calculating the average red, green, and blue component values of the abnormal pictures according to the red, green, and blue component values of the abnormal pictures includes:

[0103] S520: Extract the red, green, and blue component values of each picture from the abnormal pictures respectively to obtain a first red component data set, a first green component data set, and a first blue component data set.

[0104] Among them, the first red component dataset includes at least one red component value. The first green component dataset includes at least one green component value. The first blue component dataset includes at least one blue component value. For example, if there are n abnormal pictures, the first red component dataset can be expressed as R[n], the first green component dataset can be expressed as G[n], and the first blue component dataset can be expressed as B[n].

[0105] S521. Remove the maximum and minimum values from the first red component dataset, the first green component dataset, and the first blue component dataset respectively to obtain the second red component dataset, the second green component dataset, and the second blue component dataset.

[0106] For example, remove the maximum and minimum values from the first red component dataset R[n] to obtain the second red component dataset R1[n - 2]. Remove the maximum and minimum values from the first green component dataset G[n] to obtain the second green component dataset G1[n - 2]. Remove the maximum and minimum values from the first blue component dataset B[n] to obtain the second blue component dataset B1[n - 2].

[0107] S522. Calculate the average values corresponding to the second red component dataset, the second green component dataset, and the second blue component dataset respectively to obtain the average value of the red component, the average value of the green component, and the average value of the blue component.

[0108] Among them, the average value of the red component is the average value of the red component values in the second red component dataset R1[n - 2]. The average value of the green component is the average value of the green component values in the second green component dataset G1[n - 2]. The average value of the blue component is the average value of the blue component values in the second blue component dataset B1[n - 2].

[0109] S53. Calculate the deviation between the average red, green, and blue component values and the preset ideal red, green, and blue component value intervals to obtain the target red, green, and blue component deviation values.

[0110] For example, the preset ideal red, green, and blue component value intervals are: the red component value interval is [100, 120], the green component value interval is [100, 140], and the blue component value interval is

[0111] [200, 220]. If the average red, green, and blue component values are (90, 120, 201) respectively, then the target red, green, and blue component deviation values are (+10, 0, 0).

[0112] Please refer to Figure 4 , Figure 4FIG. 3 is a schematic flowchart of a method for correcting white balance gain parameters provided by an embodiment of the present application. In one embodiment, before inputting the target red, green, and blue component deviation values into the white balance gain parameter correction model to obtain the red, green, and blue component gain adjustment values, the method further includes:

[0113] S9. Based on a preset multiple linear regression function, establish a mapping relationship between the red, green, and blue component deviation values and the red, green, and blue component gain adjustment values. Using the least squares method, solve the coefficients of the preset multiple linear regression function through a training data set to obtain the white balance gain parameter correction model.

[0114] Among them, a problem model is established for the preset white balance gain parameter correction. Specifically, the input is the red, green, and blue color deviations of the picture, that is, Δ = [ΔR, ΔG, ΔB]. The output is the red, green, and blue component gain adjustment values of the picture, that is, K = [K R , K G , K B . The goal is to establish a mapping model from Δ to K based on the historical data set {(Δ (i) , K (i) )} N i=1 .

[0115] The linear equation for each gain component is:

[0116] K R = β R0 + β R1 ΔR + β R2 ΔG + β R3 ΔB

[0117] Among them, β R0 represents the reference gain adjustment parameter for the red component, β R1 represents 11 the influence coefficient of ΔR on K R , β R2 represents the influence coefficient of ΔG on K R , β R3 represents the influence coefficient of ΔB on K R .

[0118] K G = β G0 + β G1 ΔR + β G2 ΔG + β G3 ΔB

[0119] Among them, β G0 represents the reference gain adjustment parameter for the green component, β G1 represents 11 the influence coefficient of ΔR on K G ​G2 Indicates the influence coefficient of ΔG on K G , β G3 Indicates the influence coefficient of ΔB on K G .

[0120] K B = β B0 + β B1 ΔR + β B2 ΔG + β B3 ΔB

[0121] Among them, β B0 Indicates the reference gain adjustment parameter of the green component, β B1 Indicates 11 The influence coefficient of ΔR on K B , β B2 Indicates the influence coefficient of ΔG on K B , β B3 Indicates the influence coefficient of ΔB on K B .

[0122] Using the least squares method, solve the coefficients of the preset multiple linear regression function through the training data set.

[0123] Among them, the training data set includes the deviations of the red, green, and blue component values of multiple abnormal blood sample pictures from the preset ideal red, green, and blue component value ranges and the white balance gain parameters corresponding to the deviations. For example, for abnormal picture A, the deviation of the red, green, and blue component values of picture A from the preset ideal red, green, and blue component value ranges is (+10, -2, +34), and according to historical calibration experience, the white balance gain parameter corresponding to this deviation is (-10, +2, -34).

[0124] Construct the training data set into matrix X (N×3, each row is a Δ sample) and response matrix Y (N×3, each row is a K sample).

[0125]

[0126] Using the least squares method, solve for each gain component (K R , K G , K B ):

[0127]

[0128] Among them, where Y j Is the vector of the gain value of the jth column.

[0129] Please refer to Figure 5 , Figure 5This is the fourth flowchart diagram of a white balance gain parameter correction method provided by an embodiment of the present application. In one embodiment, before calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition in the multiple pictures and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation values, the method further includes:

[0130] S10. Determine whether the correction times of the preset white balance gain parameter are greater than the preset correction times;

[0131] The preset correction times are obtained based on the experience of technicians. Preferably, it can be 3. Of course, the preset correction times can also be other positive integers, and the present application does not limit this.

[0132] If not, then execute the step of calculating the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition in the multiple pictures and the preset ideal red, green, and blue component value range to obtain the target red, green, and blue component deviation values. That is, execute S5.

[0133] S11. Update the correction times of the preset white balance gain parameter.

[0134] After each completion of the correction of the preset white balance gain parameter, add one to the correction times of the preset white balance gain parameter.

[0135] S12. Prompt that the correction of the preset white balance gain parameter fails.

[0136] If the correction times of the preset white balance gain parameter are greater than the preset correction times, then prompt that the correction of the preset white balance gain parameter fails.

[0137] If the pictures taken after the preset correction times are still abnormal, then prompt that the automatic correction fails. At this time, manual intervention is required to find other reasons for the white balance abnormality. For example, the light is damaged, the camera is abnormal, the focus is abnormal, etc.

[0138] It should be noted that the above embodiment can be applied to the scenario of automatic correction of blood analysis instruments. Specifically, after the production personnel assemble the instrument, click on the white balance automatic correction, and the instrument runs automatically to obtain the white balance correction parameters, so that the taken pictures reach the ideal effect. The whole process runs automatically, and the technical requirements for the production personnel are relatively low.

[0139] Of course, the above embodiments can also be applied to scenarios where reagent dispensing modifications result in changes in the concentration of the blood sample staining solution. Specifically, when a reagent formula modification causes a change in the shooting background, the customer can be notified to perform an automatic white balance correction. Either independently or under the remote guidance of customer service personnel, click on the automatic white balance correction, and the blood analysis instrument will automatically run to obtain white balance correction parameters to eliminate the impact caused by the formula modification. The technical requirements for the entire process are relatively low, and corresponding white balance corrections can be made for reagent formula changes without the need to return the instrument to the factory or have professional personnel perform on-site operations. The process of correcting the white balance gain parameter takes approximately 2 - 10 minutes.

[0140] See Figure 6 , Figure 6 which is a schematic block diagram of a white balance gain parameter correction device provided by an embodiment of the present application. Corresponding to the above white balance gain parameter correction method, the present application also provides a white balance gain parameter correction device. Specifically, the white balance gain parameter correction device includes:

[0141] An acquisition unit 601, configured to acquire a preset white balance gain parameter;

[0142] A shooting unit 602, configured to shoot multiple positions of a target blood sample according to the preset white balance gain parameter to obtain multiple pictures of the target blood sample;

[0143] A statistics unit 603, configured to count the number of pictures that meet the preset ideal white balance condition among the multiple pictures, where the preset ideal white balance condition includes: the red, green, and blue component values of the picture are within a preset ideal red, green, and blue component value range;

[0144] A judgment unit 604, configured to judge whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold;

[0145] A calculation unit 605, configured to, if the ratio of the number of pictures to the total number of the multiple pictures is less than the preset threshold, calculate the deviation between the red, green, and blue component values of the pictures that do not meet the preset ideal white balance condition and the preset ideal red, green, and blue component value range to obtain a target red, green, and blue component deviation value;

[0146] An input unit 606, configured to input the target red, green, and blue component deviation value into a white balance gain parameter correction model to obtain red, green, and blue component gain adjustment values;

[0147] A correction unit 607, configured to correct the preset white balance gain parameter according to the red, green, and blue component gain adjustment values.

[0148] In one embodiment, the white balance gain parameter correction device further includes:

[0149] A blood sample acquisition unit 608, configured to acquire pictures of multiple blood samples;

[0150] An ideal picture screening unit 609, configured to screen pictures that meet the preset accuracy and preset stability from the pictures of the multiple blood samples to obtain ideal sample pictures;

[0151] A determination unit 610, configured to determine the preset ideal RGB component value range according to the RGB component values of each picture in the ideal sample pictures.

[0152] In one embodiment, the determination unit 610 is specifically configured to determine the red component value range according to the maximum and minimum values of the corresponding red component values in the ideal sample pictures;

[0153] Determine the green component value range according to the maximum and minimum values of the corresponding green component values in the ideal sample pictures;

[0154] Determine the blue component value range according to the maximum and minimum values of the corresponding blue component values in the ideal sample pictures.

[0155] In one embodiment, the calculation unit 605 is specifically configured to screen pictures that do not meet the preset ideal white balance condition from the multiple pictures to obtain abnormal pictures;

[0156] Calculate the average RGB component value of the abnormal pictures according to the RGB component values of the abnormal pictures;

[0157] Calculate the deviation between the average RGB component value and the preset ideal RGB component value range to obtain the target RGB component deviation value.

[0158] In one embodiment, the average RGB component value includes: the average value of the red component, the average value of the green component, and the average value of the blue component. The calculation unit 605 is specifically further configured to respectively extract the RGB component values of each picture from the abnormal pictures to obtain a first red component data set, a first green component data set, and a first blue component data set;

[0159] Remove the maximum and minimum values corresponding to the first red component data set, the first green component data set, and the first blue component data set respectively to obtain a second red component data set, a second green component data set, and a second blue component data set;

[0160] Obtain the average value of the corresponding components in the second red component data set, the second green component data set, and the second blue component data set to obtain the average value of the red component, the average value of the green component, and the average value of the blue component.

[0161] In one embodiment, the device further includes:

[0162] A modeling unit 611, configured to establish a mapping relationship between the red, green, and blue component deviation values and the red, green, and blue component gain adjustment values based on a preset multiple linear regression function, and use the least squares method to solve the coefficients of the preset multiple linear regression function through a training data set to obtain the white balance gain parameter correction model. The training data set includes the deviations between the red, green, and blue component values of multiple abnormal pictures of blood samples and the preset ideal red, green, and blue component value ranges, and the white balance gain parameters corresponding to the deviations.

[0163] In one embodiment, the device further includes:

[0164] A correction times judgment unit 612, configured to judge whether the correction times of the preset white balance gain parameters are greater than a preset number of correction times;

[0165] A prompting unit 613, configured to prompt that the preset white balance gain parameter correction fails if the correction times of the preset white balance gain parameters are greater than a preset number of correction times.

[0166] In one embodiment, the device further includes:

[0167] An updating unit 614, configured to update the correction times of the preset white balance gain parameters.

[0168] As Figure 7 shown, an embodiment of the present application provides a computer device, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704. Among them, the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704.

[0169] The memory 703 is used to store a computer program;

[0170] In an embodiment of the present application, when the processor 701 executes the program stored on the memory 703, it implements the control method for correcting the white balance gain parameters provided in any one of the foregoing method embodiments.

[0171] Those of ordinary skill in the art can understand that all or part of the processes of the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the method embodiments.

[0172] Therefore, the embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the white balance gain parameter correction method provided in any of the foregoing method embodiments are implemented.

[0173] The storage medium is a physical and non-transitory storage medium. For example, it can be various physical storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc, etc., which can store program codes. The computer-readable storage medium can be non-volatile or volatile.

[0174] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0175] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0176] The steps in the method embodiments of the present application can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present application can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0178] In the above embodiments, the descriptions of the various embodiments each have their own emphasis. For parts not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0179] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, provided that these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application also intends to include these changes and modifications.

[0180] As described above, the above are only the specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims

1. A white balance gain parameter correction method, characterized in that: The method comprises: Get preset white balance gain parameters; photographing multiple positions of the target blood sample according to the preset white balance gain parameter to obtain multiple images of the target blood sample; Counting the number of pictures that meet a preset ideal white balance condition among the multiple pictures, wherein the preset ideal white balance condition includes: red, green and blue component values ​​of the picture are within a preset ideal red, green and blue component value interval; Determine whether the ratio of the number of pictures to the total number of the multiple pictures is greater than a preset threshold; If not, calculating the deviation between the red, green and blue component values ​​of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green and blue component value interval to obtain a target red, green and blue component deviation value; Inputting the target red, green and blue component deviation values ​​into a white balance gain parameter correction model to obtain red, green and blue component gain adjustment values; The preset white balance gain parameter is corrected according to the red, green and blue component gain adjustment values.

2. The method according to claim 1, characterized in that: The preset ideal red, green and blue component value intervals are obtained by the following steps: Get pictures of multiple blood samples; Selecting images that meet a preset accuracy and a preset stability from the multiple images of the blood samples to obtain an ideal sample image; The preset ideal red, green and blue component value range is determined according to the red, green and blue component values ​​of each picture in the ideal sample pictures.

3. The method according to claim 2, characterized in that: The preset ideal red, green and blue component value intervals include: a red component value interval, a green component value interval and a blue component value interval, and the determining of the ideal red, green and blue component value intervals according to the red, green and blue component values ​​of each picture in the ideal sample pictures includes: Determine the red component value interval according to the maximum value and the minimum value of the red component values ​​corresponding to the ideal sample image; Determine the green component value interval according to the maximum value and the minimum value of the green component values ​​corresponding to the ideal sample image; The blue component value interval is determined according to the maximum value and the minimum value of the blue component values ​​corresponding to the ideal sample picture.

4. The method according to claim 1 or 2, characterized in that: The calculating the deviation between the red, green and blue component values ​​of the pictures that do not meet the preset ideal white balance condition and the preset ideal red, green and blue component value interval to obtain the target red, green and blue component deviation value includes: Screening pictures that do not meet the preset ideal white balance condition from the multiple pictures to obtain abnormal pictures; Calculate the average red, green and blue component values ​​of the abnormal picture according to the red, green and blue component values ​​of the abnormal picture; The deviation between the average red, green and blue component value and the preset ideal red, green and blue component value interval is calculated to obtain the target red, green and blue component deviation value.

5. The method according to claim 4, characterized in that: The average red, green and blue component values ​​include: an average value of the red component, an average value of the green component and an average value of the blue component. The step of calculating the average red, green and blue component values ​​of the abnormal picture according to the red, green and blue component values ​​of the abnormal picture includes: Extracting red, green and blue component values ​​of each image from the abnormal image respectively to obtain a first red component data set, a first green component data set and a first blue component data set; Removing the maximum value and the minimum value respectively corresponding to the first red component data set, the first green component data set and the first blue component data set to obtain a second red component data set, a second green component data set and a second blue component data set; Calculate the component averages corresponding to the second red component data set, the second green component data set, and the second blue component data set, respectively, to obtain the average value of the red component, the average value of the green component, and the average value of the blue component.

6. The method according to claim 1 or 2, characterized in that: Before inputting the target red, green and blue component deviation values ​​into the white balance gain parameter correction model to obtain the red, green and blue component gain adjustment values, the method further includes: Based on a preset multiple linear regression function, a mapping relationship between red, green and blue component deviation values ​​and red, green and blue component gain adjustment values ​​is established, and the coefficients of the preset multiple linear regression function are solved through a training data set using the least squares method to obtain the white balance gain parameter correction model. The training data set includes deviations between red, green and blue component values ​​of abnormal images of multiple blood samples and the preset ideal red, green and blue component value ranges, and white balance gain parameters corresponding to the deviations.

7. The method according to claim 1 or 2, characterized in that: Before calculating the deviation between the red, green and blue component values ​​of the pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green and blue component value interval to obtain the target red, green and blue component deviation value, the method further includes: Determining whether the number of corrections of the preset white balance gain parameter is greater than a preset number of corrections; If not, the step of calculating the deviation between the red, green and blue component values ​​of the pictures that do not meet the preset ideal white balance condition and the preset ideal red, green and blue component value interval is performed to obtain the target red, green and blue component deviation value; If so, it is prompted that the preset white balance gain parameter calibration fails.

8. The method according to claim 7, characterized in that: After correcting the preset white balance gain parameter according to the red, green and blue component gain adjustment value, the method further includes: Update the preset white balance gain parameter correction times.

9. A white balance gain parameter correction device, characterized in that: The device comprises: An acquisition unit, used for acquiring preset white balance gain parameters; A photographing unit, configured to photograph multiple positions of a target blood sample according to the preset white balance gain parameter to obtain multiple images of the target blood sample; A counting unit, configured to count the number of pictures that meet a preset ideal white balance condition among the plurality of pictures, wherein the preset ideal white balance condition includes: the red, green and blue component values ​​of the picture are within a preset ideal red, green and blue component value interval; A judging unit, used to judge whether the ratio of the number of the pictures to the total number of the multiple pictures is greater than a preset threshold; a calculating unit, configured to calculate deviations between red, green, and blue component values ​​of pictures that do not meet the preset ideal white balance condition among the multiple pictures and the preset ideal red, green, and blue component value intervals, and obtain target red, green, and blue component deviation values, if the ratio of the number of pictures to the total number of the multiple pictures is less than the preset threshold value; An input unit, used for inputting the target red, green and blue component deviation values ​​into a white balance gain parameter correction model to obtain red, green and blue component gain adjustment values; A correction unit is used to correct the preset white balance gain parameter according to the red, green and blue component gain adjustment value.

10. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program.