CN114972065A - Training method and system of color difference correction model, electronic equipment and mobile equipment - Google Patents
Training method and system of color difference correction model, electronic equipment and mobile equipment Download PDFInfo
- Publication number
- CN114972065A CN114972065A CN202210379718.0A CN202210379718A CN114972065A CN 114972065 A CN114972065 A CN 114972065A CN 202210379718 A CN202210379718 A CN 202210379718A CN 114972065 A CN114972065 A CN 114972065A
- Authority
- CN
- China
- Prior art keywords
- color
- image
- card image
- blocks
- block
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012937 correction Methods 0.000 title claims abstract description 90
- 238000012549 training Methods 0.000 title claims abstract description 49
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000004075 alteration Effects 0.000 claims abstract description 41
- 238000012545 processing Methods 0.000 claims abstract description 23
- 238000011179 visual inspection Methods 0.000 claims abstract description 21
- 238000013135 deep learning Methods 0.000 claims abstract description 9
- 238000010586 diagram Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 13
- 230000000694 effects Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 10
- 238000011156 evaluation Methods 0.000 claims description 6
- 238000000605 extraction Methods 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 claims description 2
- 238000005286 illumination Methods 0.000 claims 6
- 238000003745 diagnosis Methods 0.000 abstract description 42
- 210000001508 eye Anatomy 0.000 description 63
- 239000003086 colorant Substances 0.000 description 12
- 239000003814 drug Substances 0.000 description 12
- 230000000007 visual effect Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 10
- 208000011580 syndromic disease Diseases 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000010365 information processing Effects 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000011158 quantitative evaluation Methods 0.000 description 2
- 210000004204 blood vessel Anatomy 0.000 description 1
- 210000005252 bulbus oculi Anatomy 0.000 description 1
- 238000011982 device technology Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 210000003786 sclera Anatomy 0.000 description 1
- 210000001835 viscera Anatomy 0.000 description 1
Images
Classifications
-
- G06T5/90—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
Abstract
The application discloses a training method and a system of a chromatic aberration correction model, electronic equipment and mobile equipment, wherein the training method and the system are used for acquiring a first color card image shot by a standard visual inspection instrument and a second color card image shot by the mobile equipment; processing the first color card image and the second color card image by using a color block positioning deep learning network model to obtain all first image blocks in the first color card image and all second image blocks in the second color card image; extracting a first color value of each first image block and a second color value of each second image block; and performing iterative regression solving processing on all the first color values and all the second color values to obtain a color difference correction model. When the chromatic aberration correction model is configured on the corresponding mobile equipment, the mobile equipment can obtain the eye chart with the same parameters as the standard eye diagnosis instrument based on the chromatic aberration correction model, so that the mobile equipment can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
Description
Technical Field
The present application relates to the field of medical device technologies, and in particular, to a method and a system for training a color difference correction model, an electronic device, and a mobile device.
Background
The eye diagnosis was first recorded in the classic Huangdi's internal classic of traditional Chinese medicine, and is called "five-color micro diagnosis". The traditional Chinese medicine considers that five colors in eyes, namely red, yellow, white, black and green, respectively correspond to five internal organs of a human body. The theory of traditional Chinese medicine eye diagnosis considers that characteristics such as sclera color and blood vessel color on eyeballs reflect the health state of corresponding regions of human bodies, so the key point for developing computer intelligent eye diagnosis auxiliary diagnosis and treatment equipment is that acquired eye image data can highly restore the real color of the eye image data, and the eye image data can accord with the observation result of traditional Chinese medicine.
The existing standard eye diagnosis instrument equipment acquires and analyzes high-quality eye images, achieves breakthrough performance in the aspect of health management, but is large in size, not suitable for frequent movement, high in cost and high in price, and is difficult to popularize in basic crowds. With the popularization of mobile devices such as smart phones, the arrangement of a visual diagnosis system on the mobile device becomes possible by relying on a camera with higher imaging quality on the mobile device.
However, different models of mobile devices have different camera hardware and ISP (Image Signal Processing) modules, which result in a large difference in the colors of eye images acquired by different mobile phones of the same subject under the same light source environment, which inevitably has a great influence on diagnosis and cannot obtain a reliable and accurate diagnosis result. Therefore, the method solves the problem of imaging color difference of different models of mobile equipment, and is the key for ensuring that the eye diagnosis systems on different models of mobile equipment obtain reliable and accurate diagnosis results.
Disclosure of Invention
In view of the above, the present application provides a method, a system, an electronic device, and a mobile device for training a chromatic aberration correction model, which are used to obtain a tool capable of correcting chromatic aberration of an eye diagram, so that the mobile device configured with the chromatic aberration correction model can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
In order to achieve the above object, the following solutions are proposed:
a training method of a chromatic aberration correction model is applied to electronic equipment and comprises the following steps:
acquiring a first color card image and a second color card image, wherein the first color card image is obtained by shooting an exclusive color card by a standard visual inspection instrument, the second color card image is obtained by shooting the exclusive color card by a mobile device to be calibrated, and the first color card image comprises a plurality of first image blocks;
processing the second color card image by using a color block positioning deep learning network model to obtain all second image blocks in the second color card image;
extracting a first color value of each first image block and a second color value of each second image block;
and performing iterative regression solving processing on all the first color values and all the second color values to obtain the color difference correction model.
Optionally, the dedicated color card includes a plurality of first color patches, a plurality of second color patches and a plurality of third color patches arranged on a background plate with 18 degrees of gray, wherein:
the plurality of first color patches comprise part or all of the color patches in a 24 color ColorCheck color card;
the plurality of second color blocks comprise a plurality of color blocks matched with parameters of the mobile device;
the third color patch includes a plurality of color patches of the same color as commonly occurs in a conventional eye diagram.
Optionally, the second color card image is obtained by shooting the mobile device under the condition that the plurality of irradiation lamps irradiate at different angles, and each of the second color values is an average color value of the second image block under different irradiation angles.
Optionally, the method further comprises the steps of:
and evaluating the correction effect of the chromatic aberration correction model.
A training system of a chromatic aberration correction model is applied to an electronic device, and comprises:
the image transmission acquisition module is configured to acquire a first color card image and a second color card image, the first color card image is obtained by shooting an exclusive color card by a standard visual inspection instrument, the second color card image is obtained by shooting the exclusive color card by a mobile device to be calibrated, and the first color card image comprises a plurality of first image blocks;
the color block positioning module is configured to process the second color card image by using a color block positioning deep learning network model to obtain all second image blocks in the second color card image;
a color value extraction module configured to extract a first color value of each of the first image blocks and a second color value of each of the second image blocks;
and the model training module is configured to perform iterative regression solving processing on all the first color values and all the second color values to obtain the chromatic aberration correction model.
Optionally, the dedicated color card includes a plurality of first color patches, a plurality of second color patches and a plurality of third color patches arranged on a background plate with 18 degrees of gray, wherein:
the plurality of first color patches comprise some or all of the 24 color ColorCheck color patches;
the plurality of second color blocks comprise a plurality of color blocks matched with parameters of the mobile device;
the third color patch includes a plurality of color patches of the same color as commonly occurs in a conventional eye diagram.
Optionally, the second color card image is obtained by shooting the mobile device under the condition that the plurality of irradiation lamps irradiate at different angles, and each of the second color values is an average color value of the second image block under different irradiation angles.
Optionally, the method further includes:
an effect evaluation module configured to evaluate a correction effect of the color difference correction model.
An electronic device, optionally, comprising at least one processor and a memory coupled to the processor, wherein:
the memory is for storing a computer program or instructions;
the processor is configured to execute the computer program or the instructions to enable the electronic device to implement the training method of the color difference correction model as described above.
A mobile device is configured with the chromatic aberration correction model as described above.
According to the technical scheme, the training method and the system for the chromatic aberration correction model are used for acquiring a first color card image shot by a standard visual inspection instrument and a second color card image shot by mobile equipment; processing the first color card image and the second color card image by using a color block positioning deep learning network model to obtain all first image blocks in the first color card image and all second image blocks in the second color card image; extracting a first color value of each first image block and a second color value of each second image block; and performing iterative regression solving processing on all the first color values and all the second color values to obtain a color difference correction model. When the chromatic aberration correction model is configured on the corresponding mobile equipment, the mobile equipment can obtain the eye chart with the same parameters as the standard eye diagnosis instrument based on the chromatic aberration correction model, so that the mobile equipment can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
In the color block positioning and color value extraction stage of the technical scheme, a yolov 4-based color block positioning model is trained, the color category of a color block in a color card is not considered, only the color block is positioned, the learning of the position of the color block is strengthened in the training stage, and the color block color value is obtained according to the position relation of the color block. The method is just suitable for the conditions that color block types are different, the number of color blocks is different, and even color block typesetting is irregular and unfixed when color correction is carried out on cameras of different mobile devices, and when the trained positioning model is used for positioning the color blocks, the method can adjust the size of the color card image of the input model, does not need to carry out any previous processing on the color card image, and is quick and accurate in color block positioning.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a training method of a chromatic aberration correction model according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for training a color difference correction model according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a training system for a color difference correction model according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a training system for a color difference correction model according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Example one
Fig. 1 is a flowchart of a training method of a chromatic aberration correction model according to an embodiment of the present application.
The chromatic aberration correction model of the embodiment is used for carrying out chromatic aberration correction on an eye chart acquired by a mobile device provided with a visual inspection system or a target image required by other visual inspections, so that the color of the eye chart or the other target image is the same as that of an image acquired by a standard visual inspection instrument, and the mobile device can obtain the same diagnosis result as the standard visual inspection instrument based on the visual inspection system arranged on the mobile device, namely, the mobile device can obtain a reliable and accurate diagnosis result based on the correction of the chromatic aberration correction model.
As shown in fig. 1, the training method provided in this embodiment is implemented on the basis of an electronic device, which can be understood as a computer or a server with information processing and data calculation, and specifically includes the following steps:
and S1, acquiring a first color card image and a second color card image.
In particular, the first color card image is acquired from a standard diagnostic camera, so that the mobile device to be calibrated acquires a second color card image, which is the image to be calibrated. The first color card image is obtained by shooting the exclusive color card provided by the embodiment by a standard visual diagnosis instrument; the second color card image is obtained by shooting the exclusive color card by the mobile equipment.
The dedicated color card in this embodiment includes a plurality of first color blocks, second color blocks, and third color blocks disposed on a 18-degree gray background plate. The first color block refers to part or all of color blocks in a 24-color ColorCheck color card; the second color blocks refer to a plurality of color blocks matched with the parameters of the mobile equipment to be calibrated; the third color patch includes a plurality of color patches of the same colors as those commonly found in conventional eye diagrams. For the convenience of subsequent operations, all the color blocks are uniformly numbered, and the size of each color block is selected to be a square of 3mm by 3 mm.
Based on the theory of traditional Chinese medicine, five colors of red, yellow, white, black and green often appear in eyes, so that the colors which often appear in the conventional eye chart referred to in the application comprise the five colors of red, yellow, white, black and green, and can also comprise other colors found in practice.
In addition, because the camera shooting window of the standard visual diagnosis instrument is small, each color block needs to be shot independently and sequentially. The light source system of the vision diagnosis instrument comprises point light sources in the upper direction, the lower direction, the left direction and the right direction, so that the standard vision diagnosis instrument shoots corresponding color cards when the four directional lamps respectively illuminate the cavity, and the obtained first color card image comprises a plurality of first image blocks with the same number as the color blocks. When shooting the exclusive color card, the mobile device to be corrected shoots the exclusive color card by using the light sources in four directions to irradiate and simultaneously obtain four images as the second color card image, namely the second color card image is actually a group of images.
And S2, positioning a second image block in the image at the second moment.
The number of the second image blocks is the same as that of the color blocks of the exclusive color card, and since the second color card image is a group of images, each image is processed by using a color block positioning depth network model to obtain the second image blocks corresponding to each color block, and each obtained second image block also comprises a group of color block images.
And S3, extracting the first color value and the second color value.
The color value of each first image block in the first color card image and the color value of each second image block are extracted, and for good distinction, the color value of each first image block is described as a first color value, and the color value of each second image block is described as a second color value.
In extracting the color values of each image block, first pixel values of the RGB channels are first extracted, and then the first pixel values are converted from the RGB color space to the CIE Lab color space to obtain second pixel values of the Lab channel. Since each second image block is a group of color block images and naturally includes a group of second pixel values, for the corresponding mobile device, averaging the plurality of second pixel values of the same image block to obtain the color value of the corresponding second image block, that is, the color value of the corresponding second image block
Here, f (x) denotes conversion from RGB color space to CIE Lab color space.
And S4, performing model training by using the first color value and the second color value.
After the plurality of first Color values and the plurality of second Color values are obtained, the first Color values are used as Color reference values of corresponding Color blocks, the corresponding second Color values are used as actual Color observation values of the mobile device to be corrected, a Color difference Correction model F (x) based on CCM (Color Correction Matrix) is solved through iterative regression, and obtained model parameters are stored and used for Color Correction of the Color card image and the eye chart.
Here, the number of training iterations is determined by a set maximum number of iterations or an iteration error, and when the number of iterations reaches a maximum or the iteration error is smaller than a set threshold, the model training is stopped. The structure of a relation model between the color actual observed value and the reference value, namely a color difference correction model, is as follows:
R in ,G in ,B in respectively, the value of the image to be corrected on R, G, B channels, R out ,G out ,,B out The values of the color corrected image on three channels of RGB are obtained, and the model needs to solve the problem c 00 ~c 22 ,C 1 ~C 3 ,g 1 ~g 3 There are 15 parameters.
R, G, B values of color blocks actually observed are taken as R to be corrected in the solving process in ,G in ,B in Taking Mean Square Error (MSE) as an objective function, and iteratively training to obtain model parameters, namely optimizing MSE continuously to minimize MSE. The process is as follows:
1) initializing 15 parameters of the model;
2) iter is 0; // iter denotes the number of iterations
3) When iter < total number of iterations, perform:
iter++;
If MSE < threshold:
the iteration is stopped.
It can be seen from the above technical solutions that, the present embodiment provides a method for training a color difference correction model, which is applied to an electronic device, and specifically, the method collects a first color card image shot by a standard visual inspection instrument and a second color card image shot by a mobile device; processing the first color card image and the second color card image by using a color block positioning deep learning network model to obtain all first image blocks in the first color card image and all second image blocks in the second color card image; extracting a first color value of each first image block and a second color value of each second image block; and performing iterative regression solving processing on all the first color values and all the second color values to obtain a color difference correction model. When the chromatic aberration correction model is configured on the corresponding mobile equipment, the mobile equipment can obtain the eye chart with the same parameters as the standard eye diagnosis instrument based on the chromatic aberration correction model, so that the mobile equipment can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
In one embodiment of the present application, the method further comprises the following steps, as shown in fig. 2:
s5, the correction effect of the color difference correction model is evaluated.
And respectively correcting the color card image and the eye image shot by different mobile equipment to be corrected by using the obtained color difference correction model, and evaluating the correction effect of the color difference correction model by a quantitative mode and a qualitative mode.
The quantitative evaluation comprises calculating color difference of the color blocks, and comparing the number of syndromes obtained by the corrected eye image with the number of syndromes obtained by the eye image of the standard visual inspection instrument; and the qualitative evaluation comprises the step of observing the color consistency of the eye image shot by the corrected mobile visual inspection instrument equipment and the eye image shot by the standard visual inspection instrument by human eyes.
The color value of the color block after correction obtained in the scheme is adopted, and the chromatic aberration delta Lab of the color block after color correction is calculated, wherein the chromatic aberration delta Lab comprises the average value, the standard deviation and the maximum value of chromatic aberration of all the color blocks, and the calculation formula of the chromatic aberration delta Lab is as follows:
here, i represents a color patch number. The average value, standard deviation and maximum value of the color difference are respectively
N represents the total number of color blocks on the color card, std (x) represents the function of solving the standard deviation, and Max (x) represents the function of solving the maximum value.
If the color correction is carried out, the average color difference value of the color blocks is less than or equal to 4, the standard deviation is less than or equal to 2, the maximum value is not more than 15, the traditional Chinese medicine syndrome obtained by analyzing the eye image of the same subject and the traditional Chinese medicine syndrome obtained by the standard visual diagnostic apparatus are the same in number after the color correction, at least 2 of the traditional Chinese medicine syndrome are the same as the standard visual diagnostic apparatus, the eye image is observed by human eyes, the color of the eye image is close to or the same as that of the standard visual diagnostic apparatus, the color correction result can be received at the moment, and the obtained color difference correction model is packaged into corresponding mobile equipment so as to serve a visual diagnostic system in the mobile equipment. Otherwise, the special color card is made by reselecting the color block combination according to the scheme, and the subsequent training scheme is executed again.
In the color block positioning and color value extraction stage of the technical scheme, a color block positioning model based on yolov4 is trained, the color category of a color block in a color card is not considered, only the color block is positioned, the learning of the position of the color block is strengthened in the training stage, and the color block color value is obtained according to the position relation of the color block. The method is just suitable for the conditions that color block types are different, the number of color blocks is different, and even color block typesetting is irregular and unfixed when color correction is carried out on cameras of different mobile devices, and when the trained positioning model is used for positioning the color blocks, the method can adjust the size of the color card image of the input model, does not need to carry out any previous processing on the color card image, and is quick and accurate in color block positioning.
Example two
Fig. 3 is a block diagram of a training system of a chromatic aberration correction model according to an embodiment of the present application.
As shown in fig. 3, the training system provided in this embodiment is used for training the color difference correction model, and the training system may be understood as a functional module of an electronic device or the electronic device itself, and the electronic device may be understood as a computer or a server having information processing and data calculation, and specifically includes an image acquisition module 10, a color block positioning module 20, a color value extraction module 30, and a model training module 40.
The image acquisition module is used for acquiring a first color card image and a second color card image.
Specifically, the first color card image is acquired from a standard visual inspection instrument, so that the mobile device to be calibrated acquires a second color card image, wherein the second color card image is an image to be calibrated. The first color card image is obtained by shooting the exclusive color card provided by the embodiment by a standard visual diagnosis instrument; the second color card image is obtained by shooting the exclusive color card by the mobile equipment.
The dedicated color card in this embodiment includes a plurality of first color blocks, second color blocks, and third color blocks disposed on a 18-degree gray background plate. The first color block refers to part or all of color blocks in a 24-color ColorCheck color card; the second color blocks refer to a plurality of color blocks matched with the parameters of the mobile equipment to be calibrated; the third color patch includes a plurality of color patches of the same colors as those commonly found in conventional eye diagrams. For the convenience of subsequent operations, all the color blocks are uniformly numbered, and the size of each color block is selected to be a square of 3mm by 3 mm.
Based on the theory of traditional Chinese medicine, five colors of red, yellow, white, black and green often appear in eyes, so that the colors which often appear in the conventional eye chart referred to in the application comprise the five colors of red, yellow, white, black and green, and can also comprise other colors found in practice.
In addition, because the camera shooting window of the standard eye diagnosis instrument is small, each color block needs to be shot independently and sequentially. The light source system of the vision diagnosis instrument comprises point light sources in the upper direction, the lower direction, the left direction and the right direction, so that the standard vision diagnosis instrument shoots corresponding color cards when the four directional lamps respectively illuminate the cavity, and the obtained first color card image comprises a plurality of first image blocks with the same number as the color blocks. When shooting the exclusive color card, the mobile device to be corrected shoots the exclusive color card by using the light sources in four directions to irradiate and simultaneously obtain four images as the second color card image, namely the second color card image is actually a group of images.
The color block positioning module is used for positioning a second image block in the image at the second moment.
The number of the second image blocks is the same as that of the color blocks of the exclusive color card, and since the second color card image is a group of images, each image is processed by using a color block positioning depth network model to obtain the second image blocks corresponding to each color block, and each obtained second image block also comprises a group of color block images.
The color value extraction module is used for extracting a first color value and a second color value.
The color value of each first image block in the first color card image and the color value of each second image block are extracted, and for good distinction, the color value of each first image block is described as a first color value, and the color value of each second image block is described as a second color value.
In extracting the color values of each image block, first pixel values of the RGB channels are first extracted, and then the first pixel values are converted from the RGB color space to the CIE Lab color space to obtain second pixel values of the Lab channel. Since each second image block is a group of color block images and naturally includes a group of second pixel values, for the corresponding mobile device, averaging the plurality of second pixel values of the same image block to obtain the color value of the corresponding second image block, that is, the color value of the corresponding second image block
Here, f (x) denotes conversion from RGB color space to CIE Lab color space.
The model training module is used for performing model training by using the first color value and the second color value.
After the plurality of first Color values and the plurality of second Color values are obtained, the first Color values are used as Color reference values of corresponding Color blocks, the corresponding second Color values are used as actual Color observation values of the mobile device to be corrected, a Color difference Correction model F (x) based on CCM (Color Correction Matrix) is solved through iterative regression, and obtained model parameters are stored and used for Color Correction of the Color card image and the eye chart.
Here, the number of training iterations is determined by a set maximum number of iterations or an iteration error, and when the number of iterations reaches a maximum or the iteration error is smaller than a set threshold, the model training is stopped. The structure of a relation model between the color actual observed value and the reference value, namely a color difference correction model, is as follows:
R in ,G in ,B in respectively, the value of the image to be corrected on R, G, B channels, R out ,G out ,,B out The values of the color corrected image on three channels of RGB are obtained, and the model needs to solve the problem c 00 ~c 22 ,C 1 ~C 3 ,g 1 ~g 3 There are 15 parameters.
In the process of solving, R, G, B values of actually observed color blocks are taken as R to be corrected in ,G in ,B in Taking Mean Square Error (MSE) as an objective function, and iteratively training to obtain model parameters, namely optimizing MSE continuously to minimize MSE. The process is as follows:
1) initializing 15 parameters of the model;
2) iter is 0; // iter denotes the number of iterations
3) When iter < total number of iterations, perform:
iter++;
If MSE < threshold:
the iteration is stopped.
It can be seen from the above technical solutions that, the present embodiment provides a training system for a chromatic aberration correction model, which is applied to an electronic device, and specifically, the system collects a first color card image shot by a standard visual inspection instrument and a second color card image shot by a mobile device; processing the first color card image and the second color card image by using a color block positioning deep learning network model to obtain all first image blocks in the first color card image and all second image blocks in the second color card image; extracting a first color value of each first image block and a second color value of each second image block; and performing iterative regression solving processing on all the first color values and all the second color values to obtain a color difference correction model. When the chromatic aberration correction model is configured on the corresponding mobile equipment, the mobile equipment can obtain the eye chart with the same parameters as the standard eye diagnosis instrument based on the chromatic aberration correction model, so that the mobile equipment can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
In one embodiment of the present application, the effect evaluation module 50 is further included, as shown in fig. 4:
the effect evaluation module is used for evaluating the correction effect of the color difference correction model.
And respectively correcting the color card image and the eye image shot by different mobile equipment to be corrected by using the obtained color difference correction model, and evaluating the correction effect of the color difference correction model by a quantitative mode and a qualitative mode.
The quantitative evaluation comprises calculating color difference of the color blocks, and comparing the number of syndromes obtained by the corrected eye image with the number of syndromes obtained by the eye image of the standard visual inspection instrument; and the qualitative evaluation comprises the step of observing the color consistency of the eye image shot by the corrected mobile visual inspection instrument equipment and the eye image shot by the standard visual inspection instrument by human eyes.
The color value of the color block after correction obtained in the scheme is adopted, and the chromatic aberration delta Lab of the color block after color correction is calculated, wherein the chromatic aberration delta Lab comprises the average value, the standard deviation and the maximum value of chromatic aberration of all the color blocks, and the calculation formula of the chromatic aberration delta Lab is as follows:
here, i represents a color patch number. The average value, standard deviation and maximum value of the color difference are respectively
N represents the total number of color blocks on the color card, std (x) represents the function of solving the standard deviation, and Max (x) represents the function of solving the maximum value.
If the color correction is carried out, the average color difference value of the color blocks is less than or equal to 4, the standard deviation is less than or equal to 2, the maximum value is not more than 15, the traditional Chinese medicine syndrome obtained by analyzing the eye image of the same subject and the traditional Chinese medicine syndrome obtained by the standard visual diagnostic apparatus are the same in number after the color correction, at least 2 of the traditional Chinese medicine syndrome are the same as the standard visual diagnostic apparatus, the eye image is observed by human eyes, the color of the eye image is close to or the same as that of the standard visual diagnostic apparatus, the color correction result can be received at the moment, and the obtained color difference correction model is packaged into corresponding mobile equipment so as to serve a visual diagnostic system in the mobile equipment. Otherwise, the special color card is made by reselecting the color block combination according to the scheme, and the subsequent training scheme is executed again.
EXAMPLE III
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 5, the electronic device provided in the present embodiment can be understood as a computer or server having information processing and data computing capabilities, and includes at least one processor 101 and a memory 102, which are connected by a data bus 103. The memory is used for storing a computer program or instructions, and the processor is used for executing the corresponding computer program or instructions, so that the electronic device realizes the training method of the color difference correction model provided in the first embodiment.
The training method specifically comprises the steps of collecting a first color card image shot by a standard visual inspection instrument and a second color card image shot by mobile equipment; processing the first color card image and the second color card image by using a color block positioning deep learning network model to obtain all first image blocks in the first color card image and all second image blocks in the second color card image; extracting a first color value of each first image block and a second color value of each second image block; and performing iterative regression solving processing on all the first color values and all the second color values to obtain a color difference correction model. When the chromatic aberration correction model is configured on the corresponding mobile equipment, the mobile equipment can obtain the eye chart with the same parameters as the standard eye diagnosis instrument based on the chromatic aberration correction model, so that the mobile equipment can obtain a reliable and accurate diagnosis result based on a corresponding eye diagnosis system.
Example four
The embodiment provides a mobile device, which can be understood as an intelligent device such as a mobile phone or a tablet computer. The mobile device is provided with a camera for acquiring a color card image and an eye image, and is also provided with the color difference correction model and the eye diagnosis system provided by the embodiment, wherein the eye diagnosis system can correct the color of the acquired eye image based on the color difference correction model so as to obtain a reliable and accurate diagnosis result based on the eye diagnosis system.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The technical solutions provided by the present invention are described in detail above, and the principle and the implementation of the present invention are explained in this document by applying specific examples, and the description of the above examples is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A training method of a chromatic aberration correction model is applied to electronic equipment, and is characterized by comprising the following steps:
acquiring a first color card image and a second color card image, wherein the first color card image is obtained by shooting an exclusive color card by a standard visual inspection instrument, the second color card image is obtained by shooting the exclusive color card by a mobile device to be calibrated, and the first color card image comprises a plurality of first image blocks;
processing the second color card image by using a color block positioning deep learning network model to obtain all second image blocks in the second color card image;
extracting a first color value of each first image block and a second color value of each second image block;
and performing iterative regression solving processing on all the first color values and all the second color values to obtain the color difference correction model.
2. The training method of claim 1, wherein the proprietary color chip comprises a plurality of first color patches, a plurality of second color patches, and a plurality of third color patches disposed on a background plate of 18 degrees gray, wherein:
the plurality of first color patches comprise part or all of the color patches in a 24 color ColorCheck color card;
the plurality of second color blocks comprise a plurality of color blocks matched with parameters of the mobile device;
the third color patch includes a plurality of color patches of the same color as commonly occurs in a conventional eye diagram.
3. The training method as claimed in claim 1, wherein the second color card image is obtained by capturing the second image block by the mobile device under different illumination angles of a plurality of illumination lamps, and each of the second color values is an average color value of the second image block under different illumination angles.
4. A training method as claimed in any one of claims 1 to 3, further comprising the steps of:
and evaluating the correction effect of the chromatic aberration correction model.
5. A training system of a color difference correction model is applied to an electronic device, and is characterized by comprising:
the image transmission acquisition module is configured to acquire a first color card image and a second color card image, the first color card image is obtained by shooting an exclusive color card by a standard visual inspection instrument, the second color card image is obtained by shooting the exclusive color card by a mobile device to be calibrated, and the first color card image comprises a plurality of first image blocks;
the color block positioning module is configured to process the second color card image by using a color block positioning deep learning network model to obtain all second image blocks in the second color card image;
a color value extraction module configured to extract a first color value of each of the first image blocks and a second color value of each of the second image blocks;
and the model training module is configured to perform iterative regression solving processing on all the first color values and all the second color values to obtain the chromatic aberration correction model.
6. The training system of claim 5, wherein the proprietary color chip comprises a plurality of first color patches, a plurality of second color patches, and a plurality of third color patches disposed on a background plate that is 18 degrees gray, wherein:
the plurality of first color patches comprise part or all of the color patches in a 24 color ColorCheck color card;
the plurality of second color blocks comprise a plurality of color blocks matched with parameters of the mobile device;
the third color patch includes a plurality of color patches of the same color as commonly occurs in a conventional eye diagram.
7. The training system of claim 5, wherein the second color card image is captured by the mobile device under different illumination angles of a plurality of illumination lamps, and each of the second color values is an average color value of the second image block under different illumination angles.
8. Training system according to any of the claims 1-3, further comprising:
an effect evaluation module configured to evaluate a correction effect of the color difference correction model.
9. An electronic device comprising at least one processor and a memory coupled to the processor, wherein:
the memory is for storing a computer program or instructions;
the processor is configured to execute the computer program or the instructions to enable the electronic device to implement the method for training a color difference correction model according to any one of claims 1 to 4.
10. A mobile device, characterized in that it is provided with a chromatic aberration correction model according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210379718.0A CN114972065A (en) | 2022-04-12 | 2022-04-12 | Training method and system of color difference correction model, electronic equipment and mobile equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210379718.0A CN114972065A (en) | 2022-04-12 | 2022-04-12 | Training method and system of color difference correction model, electronic equipment and mobile equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114972065A true CN114972065A (en) | 2022-08-30 |
Family
ID=82977111
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210379718.0A Pending CN114972065A (en) | 2022-04-12 | 2022-04-12 | Training method and system of color difference correction model, electronic equipment and mobile equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114972065A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116668656A (en) * | 2023-07-24 | 2023-08-29 | 荣耀终端有限公司 | Image processing method and electronic equipment |
-
2022
- 2022-04-12 CN CN202210379718.0A patent/CN114972065A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116668656A (en) * | 2023-07-24 | 2023-08-29 | 荣耀终端有限公司 | Image processing method and electronic equipment |
CN116668656B (en) * | 2023-07-24 | 2023-11-21 | 荣耀终端有限公司 | Image processing method and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110600122A (en) | Digestive tract image processing method and device and medical system | |
CN109871845B (en) | Certificate image extraction method and terminal equipment | |
CN110766656B (en) | Method, device, equipment and storage medium for screening fundus macular region abnormality | |
CN111161272B (en) | Embryo tissue segmentation method based on generation of confrontation network | |
CN111488912B (en) | Laryngeal disease diagnosis system based on deep learning neural network | |
CN109242792B (en) | White balance correction method based on white object | |
CN105678245A (en) | Target position identification method based on Haar features | |
CN106331661A (en) | White balance processing method and device | |
CN107516004A (en) | The identifying processing method and device of medical image picture | |
CN114121232A (en) | Classification model training method and device, electronic equipment and storage medium | |
CN114972065A (en) | Training method and system of color difference correction model, electronic equipment and mobile equipment | |
CN112464871A (en) | Deep learning-based traditional Chinese medicine tongue image processing method and system | |
CN117156289A (en) | Color style correction method, system, electronic device, storage medium and chip | |
CN116597246A (en) | Model training method, target detection method, electronic device and storage medium | |
CN111178229A (en) | Vein imaging method and device based on deep learning | |
CN116310637A (en) | Cervical fluid-based cell image data set generation, model training and image recognition system | |
CN113237881B (en) | Detection method and device for specific cells and pathological section detection system | |
CN115456974A (en) | Strabismus detection system, method, equipment and medium based on face key points | |
CN110726536B (en) | Color correction method for color digital reflection microscope | |
CN110827211B (en) | Image detail enhancement method | |
CN113920556A (en) | Face anti-counterfeiting method and device, storage medium and electronic equipment | |
CN210043980U (en) | Color card | |
CN113706400A (en) | Image correction method, image correction device, microscope image correction method, and electronic apparatus | |
CN110807739A (en) | Image color feature processing method, system and device for target detection and storage medium | |
CN110674828A (en) | Method and device for normalizing fundus images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |