Color detection method, device, equipment, medium and product
By compensating the color difference detection data using linear compensation in color detection, the problem of large color detection error and low accuracy in the prior art is solved, and higher detection accuracy and production efficiency are achieved.
Patent Information
- Application Number
- CN202411137644.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-03-11
AI Technical Summary
The existing color detection methods have large errors and low accuracy. Especially when the measurement differences are large, it is difficult to effectively reduce the error between the color difference detection data and the color difference standard data, resulting in product error detection and reduced production efficiency.
The color difference detection data is compensated by linear compensation. By obtaining the preset number of chromatic aberration detection data of the target to be detected, and based on the pre-acquisitioned chromatic aberration compensation data, the color difference compensation data matched by each target to be detected is determined, and the color detection results of each target to be detected are finally determined.
Through linear compensation, the accuracy of color detection is improved, errors are reduced, and the reliability and production efficiency of product detection are improved.
Smart Images

Figure CN119595109A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a color detection method, device, electronic equipment, storage medium and program product. Background Art
[0002] Color inspection is an optical inspection of the surface of products with color requirements such as mobile phones and laptops.
[0003] At present, the existing color detection method usually uses the mean compensation method to compensate the collected color difference detection data, and performs color evaluation based on the color difference compensation data and the color difference standard data. The color difference detection data and the color difference standard data come from two measurement systems respectively. For two measurement systems whose measurement difference is less than a certain threshold, the mean compensation method can reduce the error between the color difference detection data and the color difference standard data. However, for two measurement systems whose measurement difference exceeds a certain threshold, the mean compensation method is difficult to achieve error reduction, which can easily lead to product misdetection and reduce product production efficiency. Summary of the invention
[0004] The present invention provides a color detection method, device, electronic device, storage medium and program product to solve the problems of large error and low accuracy of existing color detection methods. Color difference detection data is compensated by linear compensation method, thereby improving the color detection accuracy.
[0005] According to one aspect of the present invention, a color detection method is provided, the method comprising:
[0006] Acquire color difference detection data of a preset number of targets to be detected;
[0007] According to the pre-acquired color difference standard data and the color difference detection data of each target to be detected, based on the linear compensation method, the color difference compensation data matching each target to be detected is determined;
[0008] The color detection result of each target to be detected is determined according to the color difference standard data and the color difference compensation data matched by each target to be detected.
[0009] According to another aspect of the present invention, there is provided a color detection device, the device comprising:
[0010] A detection data acquisition module is used to acquire color difference detection data of a preset number of targets to be detected;
[0011] A compensation data determination module is used to determine the color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on a linear compensation method;
[0012] The detection result determination module is used to determine the color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matched by each target to be detected.
[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0014] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the color detection method described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the color detection method described in any embodiment of the present invention when executed.
[0016] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the color detection method according to any embodiment of the present invention is implemented.
[0017] The technical solution of the embodiment of the present invention obtains color difference detection data of a preset number of targets to be detected, determines color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on the linear compensation method, and then determines the color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matching each target to be detected. This technical solution solves the problem of large error and low accuracy of the existing color detection method, and compensates the color difference detection data through the linear compensation method, thereby improving the color detection accuracy.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flow chart of a color detection method provided according to Embodiment 1 of the present invention;
[0021] Figure 2 is a flow chart of a color detection method provided according to Embodiment 2 of the present invention;
[0022] Figure 3 is a structural schematic diagram of a color detection device provided according to Embodiment 3 of the present invention;
[0023] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the color detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0026] Embodiment 1
[0027] Figure 1 A flowchart of a color detection method is provided for the first embodiment of the present invention. This embodiment is applicable to color detection scenarios on the surfaces of products such as mobile phones and laptops. The method can be performed by a color detection device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0028] S110, obtaining color difference detection data of a preset number of targets to be detected.
[0029] This solution can be implemented by a color detection device, which can be used to detect the color deviation of the target to be detected. The target to be detected can be the surface of a product such as a mobile phone or a laptop, or a specific area of the product, such as a key area. The color detection device can usually perform color detection on batches of targets to be detected, such as 24 or 32 targets to be detected at the same time.
[0030] After color detection of a preset number of targets to be detected, the color detection device can generate color difference detection data corresponding to each target to be detected. The color difference detection data can be description data of each dimension of a color space, and the color space can be one of the color spaces such as CIELAB space, RGB space, and HSV space.
[0031] In a feasible solution, the color space is CIELAB space, and brightness, red-green color difference, and yellow-blue color difference are used as the three dimensions of CIELAB space. The color difference detection data may include brightness detection data, red-green detection data, and yellow-blue detection data. Among them, the brightness detection data is used to describe the color of the target to be detected from the brightness dimension, the red-green detection data is used to describe the color of the target to be detected from the red-green color difference dimension, and the yellow-blue detection data is used to describe the color of the target to be detected from the yellow-blue color difference dimension.
[0032] S120 , determining color difference compensation data matching each target to be detected based on the linear compensation method according to the pre-acquired color difference standard data and the color difference detection data of each target to be detected.
[0033] After obtaining the color difference detection data of each target to be detected, the color detection device can read the color difference standard data input by the user. The color detection device can also communicate with the standard measurement device to receive the color difference measurement data of the standard product and use the color difference measurement data of the standard product as the color difference standard data.
[0034] It should be noted that the dimensions of the color space described by the color difference standard data should be the same as the dimensions of the color space described by the color difference detection data. If the color difference detection data includes brightness detection data, red and green detection data, and yellow and blue detection data, the color difference standard data should include brightness standard data, red and green standard data, and yellow and blue standard data. Among them, the brightness standard data is used to describe the color of the standard product from the brightness dimension, the red and green standard data is used to describe the color of the standard product from the red and green difference dimension, and the yellow and blue standard data is used to describe the color of the standard product from the yellow and blue difference dimension.
[0035] Since the color difference detection data and the color difference standard data come from two measurement systems respectively, the color difference detection data needs to be compensated to reduce the measurement differences caused by different measurement systems. The color detection device can use the color difference detection data as the independent variable and the color difference standard data as the dependent variable to fit the linear relationship curve between the color difference standard data and the color difference detection data, and extract the compensation coefficient from the linear relationship curve to use the compensation coefficient to linearly compensate the color difference detection data of each target to be detected, and obtain the color difference compensation data matching each target to be detected.
[0036] S130 , determining a color detection result of each target to be detected according to the color difference standard data and the color difference compensation data matched with each target to be detected.
[0037] After obtaining the color difference compensation data matched by each target to be detected, the color detection device can evaluate the color difference compensation data of each target to be detected based on a pre-selected color evaluation model to determine the color detection result of each target to be detected. Specifically, the color evaluation model can be a color measurement standard, such as Delta E, Delta E (94) and other standards. The color detection device can substitute the color difference standard data and the color difference compensation data matched by each target to be detected into the calculation formula corresponding to the color evaluation model to obtain the color detection result of each target to be detected.
[0038] The technical solution of the embodiment of the present invention obtains color difference detection data of a preset number of targets to be detected, determines color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on the linear compensation method, and then determines the color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matching each target to be detected. This technical solution solves the problem of large error and low accuracy of the existing color detection method, and compensates the color difference detection data through the linear compensation method, thereby improving the color detection accuracy.
[0039] Embodiment 2
[0040] Figure 2 This is a flow chart of a color detection method provided in Embodiment 2 of the present invention. This embodiment refines the above embodiment. Figure 2 As shown, the method includes:
[0041] S210: Acquire color difference detection data of a preset number of targets to be detected.
[0042] In this solution, the color difference detection data includes brightness detection data, red and green detection data, and yellow and blue detection data; the color difference standard data includes brightness standard data, red and green standard data, and yellow and blue standard data.
[0043] S220 , performing linear fitting on the color difference detection data of each target to be detected based on the least square method according to the color difference standard data acquired in advance, and determining the compensation coefficient.
[0044] It is understandable that the color detection device can use the color difference detection data as an independent variable and the color difference standard data as a dependent variable, and fit the linear relationship curve between the color difference standard data and the color difference detection data based on the least squares method, and extract the compensation coefficient from the linear relationship curve. The compensation coefficient includes a compensation slope and a compensation intercept.
[0045] Specifically, the color difference detection data of each target to be detected is linearly fitted based on the least square method according to the color difference standard data obtained in advance to determine the compensation coefficient, including:
[0046] According to the brightness standard data, based on the least square method, linear fitting is performed on the brightness detection data of each target to be detected to determine a first compensation coefficient;
[0047] According to the red and green standard data, based on the least square method, linear fitting is performed on the red and green detection data of each target to be detected to determine the second compensation coefficient;
[0048] According to the yellow-blue standard data, based on the least squares method, a linear fitting is performed on the yellow-blue detection data of each target to be detected to determine the third compensation coefficient.
[0049] It can be understood that the least squares method can be used to solve curve fitting problems by minimizing the sum of squares of errors and finding the best function match for the data. The color detection device can use brightness detection data as an independent variable and brightness standard data as a dependent variable. Based on the least squares method, a linear relationship curve between brightness standard data and brightness detection data is fitted, and a first compensation coefficient is extracted from the linear relationship curve. Among them, the first compensation coefficient includes a first compensation slope and a first compensation intercept. The linear relationship curve between brightness standard data and brightness detection data can be expressed in the form of a linear function, for example, y1=k1x1+b1, x1 represents the brightness detection data fitting result, y1 represents the brightness standard data, k1 represents the first compensation slope, and b1 represents the first compensation intercept.
[0050] The color detection device can use the red and green detection data as the independent variable and the red and green standard data as the dependent variable, and fit the linear relationship curve between the red and green standard data and the red and green detection data based on the least squares method, and extract the second compensation coefficient from the linear relationship curve. Among them, the second compensation coefficient includes the second compensation slope and the second compensation intercept. The linear relationship curve between the red and green standard data and the red and green detection data can be expressed in the form of a linear function, for example, y2=k2x2+b2, x2 represents the fitting result of the red and green detection data, y2 represents the red and green standard data, k2 represents the second compensation slope, and b2 represents the second compensation intercept.
[0051] The color detection device can use the yellow-blue detection data as an independent variable and the yellow-blue standard data as a dependent variable, and fit the linear relationship curve between the yellow-blue standard data and the yellow-blue detection data based on the least squares method, and extract the third compensation coefficient from the linear relationship curve. Among them, the third compensation coefficient includes a third compensation slope and a third compensation intercept. The linear relationship curve between the yellow-blue standard data and the yellow-blue detection data can be expressed in the form of a linear function, for example, y3=k3x3+b3, x3 represents the fitting result of the yellow-blue detection data, y3 represents the yellow-blue standard data, k3 represents the third compensation slope, and b3 represents the third compensation intercept.
[0052] S230 . Compensate the color difference detection data of each target to be detected according to the compensation coefficient, and determine the color difference compensation data matched by each target to be detected.
[0053] After obtaining the linear relationship curve between the color difference standard data and the color difference detection data, the color detection device can compensate the color difference detection data of each target to be detected by extracting the compensation coefficient from the linear relationship curve, and calculate the color difference compensation data of each target to be detected. Specifically, the calculation formula of the color difference compensation data can be as follows: X=kx+b; wherein X represents the color difference compensation data, x represents the color difference detection data, k represents the compensation slope, and b represents the compensation intercept.
[0054] Based on the above solution, the color difference compensation data includes brightness compensation data, red and green compensation data, and yellow and blue compensation data;
[0055] The method of compensating the color difference detection data of each target to be detected according to the compensation coefficient and determining the color difference compensation data matched by each target to be detected includes:
[0056] Compensating the brightness detection data of each target to be detected according to the first compensation coefficient to determine the brightness compensation data matched by each target to be detected;
[0057] According to the second compensation coefficient, the red and green detection data of each target to be detected are compensated to determine the red and green compensation data matching each target to be detected;
[0058] The yellow-blue detection data of each target to be detected is compensated according to the third compensation coefficient to determine the yellow-blue compensation data matching each target to be detected.
[0059] It is easy to understand that the calculation formula for the brightness compensation data of each target to be detected can be as follows: X1=k1x1+b1; wherein X1 represents the brightness compensation data, x1 represents the brightness detection data, k1 represents the first compensation slope, and b1 represents the second compensation intercept. The calculation formula for the red and green compensation data of each target to be detected can be as follows: X2=k2x2+b2; wherein X2 represents the red and green compensation data, x2 represents the red and green detection data, k2 represents the second compensation slope, and b2 represents the second compensation intercept. The calculation formula for the yellow and blue compensation data of each target to be detected can be as follows: X3=k3x3+b3; wherein X3 represents the yellow and blue compensation data, x3 represents the yellow and blue detection data, k3 represents the third compensation slope, and b3 represents the third compensation intercept.
[0060] S240 , determining a color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matched by each target to be detected and the color evaluation model.
[0061] After obtaining the color difference compensation data, the color detection device can evaluate the color difference compensation data of each target to be detected based on the color difference standard data and use the color evaluation model to determine the color detection result of each target to be detected.
[0062] In a feasible solution, the color evaluation model includes:
[0063]
[0064] Where, ΔL=L1-L2; ΔC ab =C1-C2; Δa=a1-a2;Δb=b1-b2;S L =1;S C =1+K1C1;S H =1+K2C1; L1 represents the brightness compensation data matched by the target to be detected, L2 represents the brightness standard data, a1 represents the red and green detection data of the target to be detected, b1 represents the yellow and blue detection data of the target to be detected, a2 represents the red and green standard data, b2 represents the yellow and blue standard data, K L , K C and K H Respectively represent the weight coefficients of brightness, saturation and color matching, S L Indicates the brightness of the target to be detected, S C Indicates the saturation of the target to be detected, S H represents the hue of the target to be detected, K1 and K2 represent the adjustment coefficients of saturation and hue respectively, and ΔE represents the color detection result of the target to be detected.
[0065] After obtaining the color detection results of each target to be detected, the color detection device can compare the color detection results of each target to be detected with a preset error range. If the color detection result of the target to be detected is within the error range, the target to be detected is qualified; if the color detection result of the target to be detected is not within the error range, the target to be detected is unqualified.
[0066] The technical solution of the embodiment of the present invention obtains color difference detection data of a preset number of targets to be detected, determines color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on the linear compensation method, and then determines the color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matching each target to be detected. This technical solution solves the problem of large error and low accuracy of the existing color detection method, and compensates the color difference detection data through the linear compensation method, thereby improving the color detection accuracy.
[0067] Embodiment 3
[0068] Figure 3 This is a schematic diagram of the structure of a color detection device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:
[0069] The detection data acquisition module 310 is used to acquire color difference detection data of a preset number of targets to be detected;
[0070] The compensation data determination module 320 is used to determine the color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on the linear compensation method;
[0071] The detection result determination module 330 is used to determine the color detection result of each target to be detected according to the color difference standard data and the color difference compensation data matched by each target to be detected.
[0072] In this solution, optionally, the compensation data determination module 320 includes:
[0073] A compensation coefficient determination unit, used to perform linear fitting on the color difference detection data of each target to be detected based on the least square method according to the color difference standard data acquired in advance, and determine the compensation coefficient; wherein the compensation coefficient includes a compensation slope and a compensation intercept;
[0074] The compensation data determination unit is used to compensate the color difference detection data of each target to be detected according to the compensation coefficient, and determine the color difference compensation data matching each target to be detected.
[0075] On the basis of the above scheme, the color difference detection data includes brightness detection data, red and green detection data, and yellow and blue detection data; the color difference standard data includes brightness standard data, red and green standard data, and yellow and blue standard data;
[0076] The compensation coefficient determination unit is specifically used for:
[0077] According to the brightness standard data, based on the least square method, linear fitting is performed on the brightness detection data of each target to be detected to determine a first compensation coefficient;
[0078] According to the red and green standard data, based on the least square method, linear fitting is performed on the red and green detection data of each target to be detected to determine the second compensation coefficient;
[0079] According to the yellow-blue standard data, based on the least squares method, a linear fitting is performed on the yellow-blue detection data of each target to be detected to determine the third compensation coefficient.
[0080] Based on the above solution, the color difference compensation data includes brightness compensation data, red and green compensation data, and yellow and blue compensation data;
[0081] The compensation data determination unit is specifically used to:
[0082] Compensating the brightness detection data of each target to be detected according to the first compensation coefficient to determine the brightness compensation data matched by each target to be detected;
[0083] According to the second compensation coefficient, the red and green detection data of each target to be detected are compensated to determine the red and green compensation data matching each target to be detected;
[0084] The yellow-blue detection data of each target to be detected is compensated according to the third compensation coefficient to determine the yellow-blue compensation data matching each target to be detected.
[0085] In a feasible solution, the detection result determination module 330 is specifically used to:
[0086] According to the color difference standard data and the color difference compensation data matched by each target to be detected, the color detection result of each target to be detected is determined based on the color evaluation model.
[0087] Based on the above solution, optionally, the color evaluation model includes:
[0088]
[0089] Where, ΔL=L1-L2; ΔC ab =C1-C2; Δa=a1-a2;Δb=b1-b2;S L=1;S C =1+K1C1;S H =1+K2C1; L1 represents the brightness compensation data matched by the target to be detected, L2 represents the brightness standard data, a1 represents the red and green detection data of the target to be detected, b1 represents the yellow and blue detection data of the target to be detected, a2 represents the red and green standard data, b2 represents the yellow and blue standard data, K L , K C and K H Respectively represent the weight coefficients of brightness, saturation and color matching, S L Indicates the brightness of the target to be detected, S C Indicates the saturation of the target to be detected, S H represents the hue of the target to be detected, K1 and K2 represent the adjustment coefficients of saturation and hue respectively, and ΔE represents the color detection result of the target to be detected.
[0090] The color detection device provided in the embodiment of the present invention can execute the color detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0091] Embodiment 4
[0092] Figure 4 A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0093] like Figure 4As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0094] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0095] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 performs the various methods and processes described above, such as a color detection method.
[0096] In some embodiments, the color detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the color detection method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to perform the color detection method in any other suitable manner (e.g., by means of firmware).
[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0098] The computer programs for implementing the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable color detection device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0099] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0101] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0102] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A color detection method, characterized in that: The method comprises: Acquire color difference detection data of a preset number of targets to be detected; According to the pre-acquired color difference standard data and the color difference detection data of each target to be detected, based on the linear compensation method, the color difference compensation data matching each target to be detected is determined; The color detection result of each target to be detected is determined according to the color difference standard data and the color difference compensation data matched by each target to be detected.
2. The method according to claim 1, characterized in that The method of determining color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on a linear compensation method includes: According to the color difference standard data acquired in advance, based on the least square method, linear fitting is performed on the color difference detection data of each target to be detected to determine the compensation coefficient; wherein the compensation coefficient includes a compensation slope and a compensation intercept; According to the compensation coefficient, the color difference detection data of each target to be detected is compensated to determine the color difference compensation data matched by each target to be detected.
3. The method according to claim 2, characterized in that The color difference detection data includes brightness detection data, red and green detection data, and yellow and blue detection data; the color difference standard data includes brightness standard data, red and green standard data, and yellow and blue standard data; The method of performing linear fitting on the color difference detection data of each target to be detected based on the color difference standard data acquired in advance and determining the compensation coefficient includes: According to the brightness standard data, based on the least square method, linear fitting is performed on the brightness detection data of each target to be detected to determine a first compensation coefficient; According to the red and green standard data, based on the least square method, linear fitting is performed on the red and green detection data of each target to be detected to determine the second compensation coefficient; According to the yellow-blue standard data, based on the least squares method, a linear fitting is performed on the yellow-blue detection data of each target to be detected to determine the third compensation coefficient.
4. The method according to claim 3, characterized in that: The color difference compensation data includes brightness compensation data, red and green compensation data, and yellow and blue compensation data; The method of compensating the color difference detection data of each target to be detected according to the compensation coefficient and determining the color difference compensation data matched by each target to be detected includes: Compensating the brightness detection data of each target to be detected according to the first compensation coefficient to determine the brightness compensation data matched by each target to be detected; According to the second compensation coefficient, the red and green detection data of each target to be detected are compensated to determine the red and green compensation data matching each target to be detected; The yellow-blue detection data of each target to be detected is compensated according to the third compensation coefficient to determine the yellow-blue compensation data matching each target to be detected.
5. The method according to claim 1, characterized in that Determining the color detection result of each target to be detected according to the color difference standard data and the color difference compensation data matched by each target to be detected includes: According to the color difference standard data and the color difference compensation data matched by each target to be detected, the color detection result of each target to be detected is determined based on the color evaluation model.
6. The method according to claim 5, characterized in that The color evaluation model includes: Where, ΔL=L1-L2; ΔC ab =C1-C2; Δa=a1-a2;Δb=b1-b2;S L =1;S C =1+K1C1;S H =1+K2C1; L1 represents the brightness compensation data matched by the target to be detected, L2 represents the brightness standard data, a1 represents the red and green detection data of the target to be detected, b1 represents the yellow and blue detection data of the target to be detected, a2 represents the red and green standard data, b2 represents the yellow and blue standard data, K L , K C and K H Respectively represent the weight coefficients of brightness, saturation and color matching, S L Indicates the brightness of the target to be detected, S C Indicates the saturation of the target to be detected, S H represents the hue of the target to be detected, K1 and K2 represent the adjustment coefficients of saturation and hue respectively, and ΔE represents the color detection result of the target to be detected.
7. A color detection device, characterized in that: The device comprises: A detection data acquisition module is used to acquire color difference detection data of a preset number of targets to be detected; A compensation data determination module is used to determine the color difference compensation data matching each target to be detected based on the pre-acquired color difference standard data and the color difference detection data of each target to be detected based on a linear compensation method; The detection result determination module is used to determine the color detection result of each target to be detected based on the color difference standard data and the color difference compensation data matched by each target to be detected.
8. An electronic device, characterized in that: The electronic device comprises: At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the color detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the color detection method according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the color detection method according to any one of claims 1 to 6.