CN117095186B - Color card identification method and device, electronic equipment and storage medium - Google Patents
Color card identification method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117095186B CN117095186B CN202311049595.5A CN202311049595A CN117095186B CN 117095186 B CN117095186 B CN 117095186B CN 202311049595 A CN202311049595 A CN 202311049595A CN 117095186 B CN117095186 B CN 117095186B
- Authority
- CN
- China
- Prior art keywords
- color
- block
- blocks
- color block
- class
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/762—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
- G06V10/763—Non-hierarchical techniques, e.g. based on statistics of modelling distributions
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Probability & Statistics with Applications (AREA)
- Color Image Communication Systems (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本公开涉及计算机技术领域,尤其涉及一种色卡识别方法、装置及电子设备和存储介质。The present disclosure relates to the field of computer technology, and in particular to a color card recognition method, device, electronic device and storage medium.
背景技术Background technique
图像信号处理(ISP,Image Signal Processing)算法能够从图像传感器(如CMOS或CCD)捕获的原始数据中提取高质量数字图像。通过对原始数据进行去噪、增强和优化,来得到清晰、准确的图像。ISP算法在各种与图像采集相关的应用场景中广泛使用,如智能手机、相机、安防监控、医疗图像处理和自动驾驶等。Image signal processing (ISP) algorithms can extract high-quality digital images from raw data captured by image sensors (such as CMOS or CCD). Clear and accurate images are obtained by denoising, enhancing, and optimizing the raw data. ISP algorithms are widely used in various application scenarios related to image acquisition, such as smartphones, cameras, security monitoring, medical image processing, and autonomous driving.
颜色校正矩阵模块(Color Correction Matrix,CCM)是ISP处理流程中非常重要的一个模块。由于图像传感器对三原色的响应跟人眼有较大的差别,以及像素之间存在串扰(Crosstalk)现象,所以图像传感器输出的图像数据往往在经过CCM模块后才能还原出符合人眼感知的真实色彩。The Color Correction Matrix (CCM) is a very important module in the ISP processing flow. Since the image sensor's response to the three primary colors is quite different from that of the human eye, and there is crosstalk between pixels, the image data output by the image sensor can only be restored to the true color that conforms to human eye perception after passing through the CCM module.
在通过CCM模块进行颜色校正的过程中,需要通过色卡来计算CCM值,色卡是一种预先设定的包括多个色块的卡片,每个色块具有预设的颜色,各色块的颜色不同,通过多个色块(常用的为24个色块)来尽可能地覆盖一个宽泛的颜色范围,用于对色彩进行选择、比对、沟通,在一定范围内实现色彩标准的统一。In the process of color correction through the CCM module, it is necessary to calculate the CCM value through a color card. A color card is a pre-set card including multiple color blocks. Each color block has a preset color. The colors of the color blocks are different. Multiple color blocks (commonly used are 24 color blocks) are used to cover a wide color range as much as possible. It is used for color selection, comparison, and communication to achieve the unification of color standards within a certain range.
在该过程中,通常会用图像传感器拍摄色卡,然而对于一些功能较多的色卡,往往会有多个不同的色卡区域,来实现不同的颜色校正功能,而如果某次校正只需使用其中的某一色卡区域,则需要将不同的色卡区域区分开来,然而,现有的色卡区域识别方式准确率较低。In this process, an image sensor is usually used to capture a color card. However, for some color cards with more functions, there are often multiple different color card areas to achieve different color correction functions. If a certain correction only needs to use one of the color card areas, the different color card areas need to be distinguished. However, the existing color card area recognition method has a low accuracy rate.
发明内容Summary of the invention
本公开提出了一种色卡识别技术方案。The present disclosure proposes a color card recognition technology solution.
根据本公开的一方面,提供了一种色卡识别方法,包括:According to one aspect of the present disclosure, a color card recognition method is provided, comprising:
对色卡图像进行色块识别,得到识别出的色块,所述色卡图像中包含同一色卡工具中的两部分色卡区域;Performing color block recognition on the color card image to obtain recognized color blocks, wherein the color card image includes two color card areas in the same color card tool;
根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;Determine, according to the coordinates of the color blocks, a first color block and a second color block in the color blocks, wherein a distance between the first color block and the second color block satisfies a distance condition;
分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;Taking the first color block and the second color block as cluster center points respectively, clustering all color blocks to obtain first category color blocks and second category color blocks;
将第一类别色块和第二类别色块,划分至两个区域。The first category color blocks and the second category color blocks are divided into two areas.
在一种可能的实现方式中,所述根据所述色块的坐标,确定所述色块中的第一色块和第二色块,包括:In a possible implementation, determining the first color block and the second color block in the color blocks according to the coordinates of the color blocks includes:
根据所述色块的坐标,确定所有色块中距离最远的两个色块,作为第一色块和第二色块。According to the coordinates of the color block, two color blocks with the farthest distance from each other among all the color blocks are determined as the first color block and the second color block.
在一种可能的实现方式中,所述根据所述色块的坐标,确定所述色块中的第一色块和第二色块,包括:In a possible implementation, determining the first color block and the second color block in the color blocks according to the coordinates of the color blocks includes:
根据色块中心点的纵坐标,分别确定纵坐标最小值和最大值的色块;According to the ordinate of the center point of the color block, the color blocks with the minimum and maximum ordinate values are determined respectively;
基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块;Based on the minimum and maximum values of the ordinate, determine the top row of color blocks and the bottom row of color blocks;
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块,包括:In a possible implementation, determining the top row of color blocks and the bottom row of color blocks based on the minimum and maximum values of the ordinates includes:
基于所述纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块,所述第一范围包括:纵坐标最小值减二分之一色块尺寸至纵坐标最小值加二分之一色块尺寸;Based on the minimum value of the ordinate, determine the color blocks whose ordinate values are within a first range as the color blocks in the top row, wherein the first range includes: the minimum value of the ordinate minus half the size of the color block to the minimum value of the ordinate plus half the size of the color block;
基于所述纵坐标最大值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块,所述第二范围包括:纵坐标最大值减二分之一色块尺寸至纵坐标最大值加二分之一色块尺寸。Based on the maximum ordinate value, determine the color blocks whose ordinate values are within a second range as the color blocks in the bottom row, where the second range includes: the maximum ordinate value minus half the color block size to the maximum ordinate value plus half the color block size.
在一种可能的实现方式中,所述基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块,包括:In a possible implementation, selecting a color block in the top row of color blocks as the first color block and selecting a color block in the bottom row of color blocks as the second color block based on the horizontal coordinate of the center point of the color block includes:
将最上面一行色块中的横坐标最小的色块作为第一色块,将最下面一行色块中横坐标最大的色块作为第一色块;或,The color block with the smallest horizontal coordinate in the top row of color blocks is used as the first color block, and the color block with the largest horizontal coordinate in the bottom row of color blocks is used as the first color block; or,
将最上面一行色块中的横坐标最大的色块作为第一色块,将最下面一行色块中横坐标最小的色块作为第一色块;或,The color block with the largest horizontal coordinate in the top row of color blocks is taken as the first color block, and the color block with the smallest horizontal coordinate in the bottom row of color blocks is taken as the first color block; or,
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块,包括:In a possible implementation, clustering all the color blocks using the first color block and the second color block as cluster centers to obtain first category color blocks and second category color blocks includes:
以所述第一色块和所述第二色块作为聚类中心点,基于各色块的位置,对所有色块进行聚类,得到第一类别色块和第二类别色块。The first color block and the second color block are used as cluster center points, and based on the position of each color block, all color blocks are clustered to obtain first category color blocks and second category color blocks.
在一种可能的实现方式中,所述分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块,包括:In a possible implementation, clustering all the color blocks using the first color block and the second color block as cluster centers to obtain first category color blocks and second category color blocks includes:
针对所有色块,分别计算各色块到两个聚类中心点的距离;For all color blocks, calculate the distance between each color block and the two cluster center points;
将各色块分类至距离最小的聚类中心点对应的类中,得到第一类别色块和第二类别色块;Classify each color block into the class corresponding to the cluster center point with the smallest distance, and obtain the first category color block and the second category color block;
根据第一类别色块和第二类别色块的位置,分别确定第一类别色块和第二类别色块的质心,作为第一类别色块和第二类别色块新的聚类中心点;According to the positions of the first category color blocks and the second category color blocks, respectively determine the centroids of the first category color blocks and the second category color blocks as new clustering center points of the first category color blocks and the second category color blocks;
迭代地执行上述计算距离至确定新的聚类中心点的过程,直至满足迭代停止条件,得到重新分类后的第一类别色块和第二类别色块。The above process of calculating the distance to determine the new cluster center point is iteratively performed until the iteration stop condition is met, and the reclassified first category color blocks and second category color blocks are obtained.
根据本公开的一方面,提供了一种色卡识别装置,包括:According to one aspect of the present disclosure, there is provided a color card recognition device, comprising:
色块识别模块,用于对色卡图像进行色块识别,得到识别出的色块,所述色卡图像中包含同一色卡工具中的两部分色卡区域;A color block recognition module is used to perform color block recognition on a color card image to obtain recognized color blocks, wherein the color card image includes two color card areas in the same color card tool;
中心点确定模块,用于根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;A center point determination module, used to determine a first color block and a second color block in the color blocks according to the coordinates of the color blocks, wherein the distance between the first color block and the second color block satisfies a distance condition;
聚类模块,用于分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;A clustering module, configured to cluster all the color blocks using the first color block and the second color block as cluster centers respectively, to obtain first category color blocks and second category color blocks;
区域划分模块,用于将第一类别色块和第二类别色块,划分至两个区域。The area division module is used to divide the first category color blocks and the second category color blocks into two areas.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
根据所述色块的坐标,确定所有色块中距离最远的两个色块,作为第一色块和第二色块。According to the coordinates of the color block, two color blocks with the farthest distance from each other among all the color blocks are determined as the first color block and the second color block.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
根据色块中心点的纵坐标,分别确定纵坐标最小值和最大值的色块;According to the ordinate of the center point of the color block, the color blocks with the minimum and maximum ordinate values are determined respectively;
基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块;Based on the minimum and maximum values of the ordinate, determine the top row of color blocks and the bottom row of color blocks;
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
基于所述纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块,所述第一范围包括:纵坐标最小值减二分之一色块尺寸至纵坐标最小值加二分之一色块尺寸;Based on the minimum value of the ordinate, determine the color blocks whose ordinate values are within a first range as the color blocks in the top row, wherein the first range includes: the minimum value of the ordinate minus half the size of the color block to the minimum value of the ordinate plus half the size of the color block;
基于所述纵坐标最大值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块,所述第二范围包括:纵坐标最大值减二分之一色块尺寸至纵坐标最大值加二分之一色块尺寸。Based on the maximum ordinate value, determine the color blocks whose ordinate values are within a second range as the color blocks in the bottom row, where the second range includes: the maximum ordinate value minus half the color block size to the maximum ordinate value plus half the color block size.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
将最上面一行色块中的横坐标最小的色块作为第一色块,将最下面一行色块中横坐标最大的色块作为第一色块;或,The color block with the smallest horizontal coordinate in the top row of color blocks is used as the first color block, and the color block with the largest horizontal coordinate in the bottom row of color blocks is used as the first color block; or,
将最上面一行色块中的横坐标最大的色块作为第一色块,将最下面一行色块中横坐标最小的色块作为第一色块;或,The color block with the largest horizontal coordinate in the top row of color blocks is taken as the first color block, and the color block with the smallest horizontal coordinate in the bottom row of color blocks is taken as the first color block; or,
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述聚类模块,用于:In a possible implementation, the clustering module is used to:
以所述第一色块和所述第二色块作为聚类中心点,基于各色块的位置,对所有色块进行聚类,得到第一类别色块和第二类别色块。The first color block and the second color block are used as cluster center points, and based on the position of each color block, all color blocks are clustered to obtain first category color blocks and second category color blocks.
在一种可能的实现方式中,所述聚类模块,用于:In a possible implementation, the clustering module is used to:
针对所有色块,分别计算各色块到两个聚类中心点的距离;For all color blocks, calculate the distance between each color block and the two cluster center points;
将各色块分类至距离最小的聚类中心点对应的类中,得到第一类别色块和第二类别色块;Classify each color block into the class corresponding to the cluster center point with the smallest distance, and obtain the first category color block and the second category color block;
根据第一类别色块和第二类别色块的位置,分别确定第一类别色块和第二类别色块的质心,作为第一类别色块和第二类别色块新的聚类中心点;According to the positions of the first category color blocks and the second category color blocks, respectively determine the centroids of the first category color blocks and the second category color blocks as new clustering center points of the first category color blocks and the second category color blocks;
迭代地执行上述计算距离至确定新的聚类中心点的过程,直至满足迭代停止条件,得到重新分类后的第一类别色块和第二类别色块。The above process of calculating the distance to determine the new cluster center point is iteratively performed until the iteration stop condition is met, and the reclassified first category color blocks and second category color blocks are obtained.
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
在本公开实施例中,对色卡图像进行色块识别,得到识别出的色块后,通过根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;将第一类别色块和第二类别色块,划分至两个区域。由此,通过选择出满足距离条件的第一色块和第二色块作为聚类中心点,对所有色块进行聚类,能够便于快速且精准地将两个区域的色块区分开,实现了对色块所属区域的准确划分。In the disclosed embodiment, color block recognition is performed on the color card image to obtain the recognized color blocks, and then the first color block and the second color block in the color blocks are determined according to the coordinates of the color blocks, and the distance between the first color block and the second color block meets the distance condition; the first color block and the second color block are respectively used as cluster center points to cluster all the color blocks to obtain the first category color blocks and the second category color blocks; the first category color blocks and the second category color blocks are divided into two areas. Therefore, by selecting the first color block and the second color block that meet the distance condition as the cluster center points, clustering all the color blocks, it is possible to quickly and accurately distinguish the color blocks in the two areas, and realize accurate division of the areas to which the color blocks belong.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
图1示出CCM校正前后图像传感器输出的色卡图像的示意图。FIG. 1 is a schematic diagram showing a color chart image output by an image sensor before and after CCM correction.
图2示出一种包含上下两个区域的多功能色卡的色卡图像的示意图。FIG. 2 is a schematic diagram showing a color card image of a multifunctional color card including upper and lower areas.
图3示出根据本公开实施例的色卡识别方法的流程图。FIG. 3 shows a flow chart of a color card recognition method according to an embodiment of the present disclosure.
图4示出根据本公开实施例的一种色卡识别装置的框图。FIG. 4 shows a block diagram of a color card recognition device according to an embodiment of the present disclosure.
图5示出根据本公开实施例的一种电子设备的框图。FIG5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
CCM图像校正的作用是校正图像传感器的光谱响应,通过校正后得到图像更符合人眼感知的真实色彩,图1示出CCM校正前后图像传感器输出的色卡图像的示意图。其中,图1中的(a)部分图像为CCM校正前输出的色卡图像,图1中的(b)部分图像为CCM校正后输出的色卡图像。The function of CCM image correction is to correct the spectral response of the image sensor. After correction, the image is more consistent with the real color perceived by the human eye. Figure 1 shows a schematic diagram of the color card image output by the image sensor before and after CCM correction. Among them, the image in part (a) of Figure 1 is the color card image output before CCM correction, and the image in part (b) of Figure 1 is the color card image output after CCM correction.
CCM是一个3×3的矩阵,在计算某个图像传感器的CCM矩阵值时,通常将该图像传感器对着色卡进行拍摄,然后将色卡图像中各色块的R、G、B平均值去和X-Rite标准各色块的R、G、B目标值进行多项式拟合,从而得到最优化的CCM矩阵系数。CCM is a 3×3 matrix. When calculating the CCM matrix value of an image sensor, the image sensor is usually used to shoot a color card, and then the R, G, B average values of each color block in the color card image are polynomially fitted with the R, G, B target values of each color block in the X-Rite standard to obtain the optimized CCM matrix coefficients.
目前的色卡往往功能较多,作为一个示例,图2示出一种包含上下两个区域的多功能色卡的色卡图像的示意图。在该图中,除了下半部常规24色块外,还有上半部的创意增强色块,用来给视频、图像添加新颖的颜色效果,比如带创意的冷暖色调等。通过该色卡,可以完成颜色校正和创意增强任务,对视频制作和后期加工编辑效率非常有帮助。Current color cards often have many functions. As an example, FIG2 shows a schematic diagram of a color card image of a multifunctional color card including upper and lower areas. In this figure, in addition to the conventional 24 color blocks in the lower half, there are also creative enhancement color blocks in the upper half, which are used to add novel color effects to videos and images, such as creative warm and cold tones. Through this color card, color correction and creative enhancement tasks can be completed, which is very helpful for video production and post-processing editing efficiency.
在图像自动识别出所有色块后,如何自动区分开上半部和下半部色块,只对下半部色块或上半部色块进行CCM值的调优是常见的工程问题。After all color blocks are automatically identified in the image, how to automatically distinguish the upper and lower color blocks and only adjust the CCM value of the lower or upper color blocks is a common engineering problem.
在相关技术中,对于区分上半部和下半部色块而言,通常是在图像坐标系(图像左上角为原点)的Y方向上预先设定一个阈值Ty,当某个色块中心点的y坐标值小于Ty时就属于上半部;反之,如果某个色块中心点的y坐标值大于Ty时就属于下半部。但是,由于每次拍摄时,色卡在图像中的位置总是会变化,导致人为设定的Ty可能不符合实际情况,从而错误地判断当前色块是在上半部还是下半部,准确率较低。In the related art, to distinguish between the upper and lower color blocks, a threshold value Ty is usually pre-set in the Y direction of the image coordinate system (the upper left corner of the image is the origin). When the y coordinate value of the center point of a color block is less than Ty, it belongs to the upper half; conversely, if the y coordinate value of the center point of a color block is greater than Ty, it belongs to the lower half. However, since the position of the color card in the image always changes every time the image is taken, the artificially set Ty may not conform to the actual situation, thereby incorrectly judging whether the current color block is in the upper half or the lower half, and the accuracy is low.
本公开提供了一种色卡识别方法,在本公开实施例中,对色卡图像进行色块识别,得到识别出的色块后,通过根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;将第一类别色块和第二类别色块,划分至两个区域。由此,通过选择出满足距离条件的第一色块和第二色块作为聚类中心点,对所有色块进行聚类,能够便于快速且精准地将两个区域的色块区分开,实现了对色块所属区域的准确划分。The present disclosure provides a color card recognition method. In the embodiment of the present disclosure, color block recognition is performed on a color card image. After the recognized color blocks are obtained, the first color block and the second color block in the color blocks are determined according to the coordinates of the color blocks, and the distance between the first color block and the second color block meets the distance condition; the first color block and the second color block are respectively used as cluster center points to cluster all the color blocks to obtain the first category color blocks and the second category color blocks; the first category color blocks and the second category color blocks are divided into two areas. Therefore, by selecting the first color block and the second color block that meet the distance condition as the cluster center points, clustering all the color blocks, it is possible to quickly and accurately distinguish the color blocks in the two areas, and realize accurate division of the areas to which the color blocks belong.
图3示出根据本公开实施例的色卡识别方法的流程图,如图3所示,所述方法包括:FIG3 shows a flow chart of a color card recognition method according to an embodiment of the present disclosure. As shown in FIG3 , the method includes:
在步骤S11中,对色卡图像进行色块识别,得到识别出的色块,所述色卡图像中包含同一色卡工具中的两部分色卡区域;In step S11, color block recognition is performed on the color card image to obtain recognized color blocks, wherein the color card image includes two color card areas in the same color card tool;
色卡图像是图像传感器对色卡进行拍摄到的图像,在本公开中,色卡图像可以包含两部分色卡区域,例如,图2所示的图像中,色卡包含上下两部分区域,下部区域中包含24个色块,上部区域中包含26个色块,两部分色块对应不同的颜色校准功能。为了便于后续的色块识别,在通过图像传感器拍摄色卡时,可以使图像传感器正对色卡进行拍摄,以免由于近大远小的透视效果,使得图像中的色块相对位置与实际的色块相对位置差距较大,便于后续基于色块在图像中的位置准确地区分两部分色卡区域。The color card image is an image of the color card captured by the image sensor. In the present disclosure, the color card image may include two color card areas. For example, in the image shown in FIG2 , the color card includes an upper and lower area. The lower area includes 24 color blocks, and the upper area includes 26 color blocks. The two color blocks correspond to different color calibration functions. In order to facilitate subsequent color block recognition, when the color card is photographed by the image sensor, the image sensor may be directed to the color card to avoid a large difference between the relative position of the color blocks in the image and the actual relative position of the color blocks due to the perspective effect of near being larger and far being smaller, so as to facilitate the subsequent accurate distinction of the two color card areas based on the position of the color blocks in the image.
在该步骤中,对色块的识别可以是完整识别出色卡图像中的所有色块,以便于后续基于色块的位置划分色块所属的区域。具体识别的方式可以有多种,在一个示例中,可以基于自动或半自动的方式进行识别,例如,通过算法初步识别出部分色块后,借助人工标注识别剩余色块;在另一个示例中,可以基于全自动识别的方式,识别所有色块。在一个示例中,可以根据色块的像素值与背景像素值的差异,通过阈值分割的方式,对色块进行识别;在另一个示例中,还可以根据色块的边缘的灰度值的变化,通过基于边缘检测的分割方式,对色块进行识别;在另一个示例中,还可以基于深度学习算法,通过对图像特征进行编码,利用神经网络来对色块进行识别,该神经网络例如可以是卷积神经网络、残差神经网络等等。In this step, the recognition of color blocks can be to completely recognize all color blocks in the color card image, so as to facilitate the subsequent division of the area to which the color blocks belong based on the positions of the color blocks. There can be many specific recognition methods. In one example, the recognition can be based on an automatic or semi-automatic method. For example, after the partial color blocks are initially recognized by the algorithm, the remaining color blocks are identified with the help of manual annotation. In another example, all color blocks can be recognized based on a fully automatic recognition method. In one example, the color blocks can be recognized by threshold segmentation based on the difference between the pixel value of the color block and the background pixel value; in another example, the color blocks can also be recognized by edge detection-based segmentation based on the change of the gray value of the edge of the color block; in another example, the color blocks can also be recognized by encoding the image features based on a deep learning algorithm and using a neural network. The neural network can be, for example, a convolutional neural network, a residual neural network, and the like.
在步骤S12中,根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;In step S12, a first color block and a second color block in the color blocks are determined according to the coordinates of the color blocks, and the distance between the first color block and the second color block satisfies a distance condition;
这里色块的坐标为色块在图像坐标系中的坐标,具体可以是色块中心点的坐标,或者也可以是色块的某个角点的坐标,本公开对此不作具体限定。Here, the coordinates of the color block are the coordinates of the color block in the image coordinate system, and specifically may be the coordinates of the center point of the color block, or may also be the coordinates of a corner point of the color block, which is not specifically limited in the present disclosure.
第一色块和第二色块之间的距离为第一色块和第二色块在图像上的距离,需要说明的是,本公开实施例中可不必求出第一色块和第二色块之间的距离,而是可以依据色块的坐标值来确定色块之间距离的远近,示例性的,可以依据色块的y值,确定色块是属于最上面一行还是最下面一行,然后再依据色块的x值,确定色块在色卡中的哪个位置,即确定了色块之间距离的远近,具体可参见本公开提供的可能的实现方式,此次不做赘述。The distance between the first color block and the second color block is the distance between the first color block and the second color block on the image. It should be noted that in the embodiment of the present disclosure, it is not necessary to calculate the distance between the first color block and the second color block. Instead, the distance between the color blocks can be determined based on the coordinate values of the color blocks. For example, based on the y value of the color block, it can be determined whether the color block belongs to the top row or the bottom row, and then based on the x value of the color block, the position of the color block in the color card can be determined, that is, the distance between the color blocks is determined. For details, please refer to the possible implementation methods provided in the present disclosure, which will not be elaborated here.
这里的距离条件可以有多种,在一种可能的实现方式中,该距离条件可以是所有色块中距离最远的两个色块;在另外一种可能的实现方式中,在两个色卡区域的位置关系为上下相邻关系时,距离条件可以是所有色块中纵向距离最远;在另外一种可能的实现方式中,在两个色卡区域的位置关系为左右相邻关系时,距离条件可以是所有色块中横向距离最远;在另外一种可能的实现方式中,距离条件可以是所有色块中纵向距离最远,且横向距离最远。There may be multiple distance conditions here. In one possible implementation, the distance condition may be the two color blocks that are the farthest apart from each other among all color blocks. In another possible implementation, when the positional relationship of the two color card areas is an up-and-down adjacent relationship, the distance condition may be the farthest vertical distance among all color blocks. In another possible implementation, when the positional relationship of the two color card areas is a left-and-right adjacent relationship, the distance condition may be the farthest horizontal distance among all color blocks. In another possible implementation, the distance condition may be the farthest vertical distance and the farthest horizontal distance among all color blocks.
色块的距离可以依据色块的坐标来对比,例如,可以基于比较色块x坐标的大小,以及y坐标的大小,来确定不同色块距离的大小;此外,也可以直接依据色块的坐标来确定色块的距离,然后再对色块的距离进行对比。这里色块的距离还可以是基于色块的坐标确定的欧式距离,该欧氏距离即为色块的中心点在欧几里得空间中的直线距离。The distances of color blocks can be compared based on the coordinates of the color blocks. For example, the distances of different color blocks can be determined based on the comparison of the size of the x coordinate and the size of the y coordinate. In addition, the distances of color blocks can be determined directly based on the coordinates of the color blocks, and then the distances of the color blocks can be compared. The distance of the color blocks can also be the Euclidean distance determined based on the coordinates of the color blocks, which is the straight-line distance between the center points of the color blocks in the Euclidean space.
在步骤S13中,分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;In step S13, all color blocks are clustered using the first color block and the second color block as cluster center points to obtain first category color blocks and second category color blocks;
聚类的过程为确定与第一色块属于同一类的色块,以及确定与第二色块属于同一类的色块,进而得到第一类别色块和第二类别色块。The clustering process is to determine the color blocks that belong to the same category as the first color block, and to determine the color blocks that belong to the same category as the second color block, thereby obtaining the first category color blocks and the second category color blocks.
聚类的过程具体可以是依据色块的位置来进行的,在一种可能的实现方式中,所述分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块,包括:以所述第一色块和所述第二色块作为聚类中心点,基于各色块的位置,对所有色块进行聚类,得到第一类别色块和第二类别色块。The clustering process can be specifically performed based on the positions of the color blocks. In a possible implementation, the first color block and the second color block are used as clustering centers, all the color blocks are clustered, and first category color blocks and second category color blocks are obtained, including: using the first color block and the second color block as clustering centers, based on the position of each color block, all the color blocks are clustered to obtain first category color blocks and second category color blocks.
在该实现方式中,基于色块的位置,会将距离靠近第一色块的色块聚类为第一类别色块,将距离靠近第二色块的色块聚类为第二类别色块,且由于第一色块和第二色块之间的距离较远,因此,能够便于快速且精准地将两个区域的色块区分开,实现了对色块所属区域的准确划分。In this implementation, based on the positions of the color blocks, the color blocks close to the first color block are clustered into the first category of color blocks, and the color blocks close to the second color block are clustered into the second category of color blocks. Since the distance between the first color block and the second color block is far, it is possible to quickly and accurately distinguish the color blocks in the two areas, thereby achieving accurate division of the areas to which the color blocks belong.
在一种可能的实现方式中,所述分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块,包括:针对所有色块,分别计算各色块到两个聚类中心点的距离;将各色块分类至距离最小的聚类中心点对应的类中,得到第一类别色块和第二类别色块;根据第一类别色块和第二类别色块的位置,分别确定第一类别色块和第二类别色块的质心,作为第一类别色块和第二类别色块新的聚类中心点;迭代地执行上述计算距离至确定新的聚类中心点的过程,直至满足迭代停止条件,得到重新分类后的第一类别色块和第二类别色块。In a possible implementation, the method of clustering all color blocks with the first color block and the second color block as cluster center points respectively to obtain first category color blocks and second category color blocks includes: for all color blocks, respectively calculating the distance from each color block to the two cluster center points; classifying each color block into the class corresponding to the cluster center point with the smallest distance to obtain first category color blocks and second category color blocks; according to the positions of the first category color blocks and the second category color blocks, respectively determining the centroids of the first category color blocks and the second category color blocks as new cluster center points of the first category color blocks and the second category color blocks; iteratively executing the above process of calculating the distance to determine the new cluster center points until the iteration stop condition is met to obtain the reclassified first category color blocks and second category color blocks.
迭代停止条件例如可以是迭代达到预设的次数,在一个示例中,由于经过步骤S12已经选择出了符合距离条件的两个聚类中心点,因此,算法很快就会收敛,通常只需要3次迭代即可准确地将两个色卡区域的色块聚类为2个类别。因此,可以预先设置迭代次数为3次,达到3次后即可停止迭代,输出第一类别色块和第二类别色块。此外,迭代条件还可以是其它条件,例如,达到预定的迭代时间,等等。The iteration stop condition may be, for example, that the iteration reaches a preset number of times. In one example, since two cluster center points that meet the distance condition have been selected after step S12, the algorithm will converge quickly, and usually only three iterations are needed to accurately cluster the color blocks in the two color card areas into two categories. Therefore, the number of iterations may be preset to three times, and the iteration may be stopped after reaching three times, and the color blocks of the first category and the color blocks of the second category may be output. In addition, the iteration condition may also be other conditions, such as reaching a predetermined iteration time, etc.
在该实现方式中,第一类别色块是距离第一类别的聚类中心点最近的色块,而第二类别色块是距离第二类别的聚类中心点最近的色块,且由于经过步骤S12已经选择出了符合距离条件的两个聚类中心点,因此,能够快速聚类出两个不同色卡区域的中心点。In this implementation, the first category color block is the color block closest to the cluster center point of the first category, and the second category color block is the color block closest to the cluster center point of the second category. Since two cluster center points that meet the distance condition have been selected in step S12, the center points of two different color card areas can be quickly clustered.
在步骤S14中,将第一类别色块和第二类别色块,划分至两个区域。In step S14, the first category color blocks and the second category color blocks are divided into two areas.
在得到第一类别色块和第二类别色块后,依据两类色块的坐标,即可将色块分别划分至两个区域。示例性的,针对图2所示的色卡图像,依据色卡的y值,可以将两类色块划分为上下两个区域。After obtaining the first category color block and the second category color block, the color blocks can be divided into two areas according to the coordinates of the two categories of color blocks. For example, for the color card image shown in FIG2 , the two categories of color blocks can be divided into upper and lower areas according to the y value of the color card.
在一种可能的实现方式中,在距离条件是所有色块中距离最远的两个色块的情况下,那么,所述根据所述色块的坐标,确定所述色块中的第一色块和第二色块,包括:根据所述色块的坐标,确定所有色块中距离最远的两个色块,作为第一色块和第二色块。In a possible implementation, when the distance condition is the two color blocks that are the farthest apart among all color blocks, then determining the first color block and the second color block among the color blocks according to the coordinates of the color blocks includes: determining the two color blocks that are the farthest apart among all color blocks as the first color block and the second color block according to the coordinates of the color blocks.
示例性的,可以依据色块的y值,确定出最上面一行色块和最下面一行色块,然后再依据色块的x值,确定色卡中具备对角线关系的两对色块,这两对色块中,x值差距最大的一对色块,即可认定为所有色块中距离最远的两个色块。此外,还可以依据两个色块的中心点坐标,直接计算两个坐标之间的距离,进而确定出所有色块中距离最远的两个色块。For example, the top row of color blocks and the bottom row of color blocks can be determined based on the y value of the color block, and then two pairs of color blocks with a diagonal relationship in the color card can be determined based on the x value of the color block. Among the two pairs of color blocks, the pair of color blocks with the largest difference in x value can be identified as the two color blocks with the farthest distance among all color blocks. In addition, the distance between the two coordinates can be directly calculated based on the coordinates of the center points of the two color blocks, thereby determining the two color blocks with the farthest distance among all color blocks.
通过实践表明,色卡中距离最远的两个色块必然属于不同的色卡区域,在该实现方式中,通过根据所述色块的坐标,确定所有色块中距离最远的两个色块,作为第一色块和第二色块,使得聚类的中心点为所有色块中距离最远的两个色块,因此,能够准确地将两个区域的色块聚类到离自己最近的聚类中心点,以便于准确地将不同区域的色块区分开,提高了区分色卡区域的准确性。Practice has shown that the two color blocks that are farthest apart in the color card must belong to different color card areas. In this implementation, the two color blocks that are farthest apart from all the color blocks are determined according to the coordinates of the color blocks as the first color block and the second color block, so that the center point of the cluster is the two color blocks that are farthest apart from all the color blocks. Therefore, the color blocks in the two areas can be accurately clustered to the cluster center point closest to themselves, so as to accurately distinguish the color blocks in different areas, thereby improving the accuracy of distinguishing the color card areas.
在一种可能的实现方式中,在两个色卡区域的位置关系为上下相邻关系时,在距离条件是所有色块中纵向距离最远时,那么,所述根据所述色块的坐标,确定所述色块中的第一色块和第二色块,包括:根据色块中心点的纵坐标,分别确定纵坐标最小值和最大值的色块;基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块;基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。In a possible implementation, when the positional relationship between two color card areas is an upper and lower adjacent relationship, and when the distance condition is the longest longitudinal distance among all color blocks, then, determining the first color block and the second color block in the color blocks according to the coordinates of the color blocks includes: determining the color blocks with minimum and maximum longitudinal coordinates according to the longitudinal coordinates of the center points of the color blocks; determining the top row of color blocks and the bottom row of color blocks based on the minimum and maximum longitudinal coordinates; and selecting the color blocks in the top row of color blocks as the first color blocks, and selecting the color blocks in the bottom row of color blocks as the second color blocks based on the horizontal coordinates of the center points of the color blocks.
在两个色卡区域的位置关系为上下相邻关系时,聚类中心点分别位于最上面一行色块和最下面一行色块时,基于位置进行聚类的效率更快,且聚类的结果更准确,因此,可以基于色块中心点的纵坐标的最大值和最小值,确定最上面一行色块和最下面一行色块,然后,可以选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。由此,选择出的聚类中心点的纵向距离较大,以使得基于位置进行聚类的效率更快,且聚类的结果更准确。When the positional relationship between the two color card areas is an upper and lower adjacent relationship, and the cluster center points are located at the top row of color blocks and the bottom row of color blocks respectively, the efficiency of clustering based on position is faster, and the clustering result is more accurate. Therefore, the top row of color blocks and the bottom row of color blocks can be determined based on the maximum and minimum values of the longitudinal coordinates of the color block center points, and then the color blocks in the top row of color blocks can be selected as the first color blocks, and the color blocks in the bottom row of color blocks can be selected as the second color blocks. As a result, the longitudinal distance of the selected cluster center points is larger, so that the efficiency of clustering based on position is faster, and the clustering result is more accurate.
在一个示例中,可以选取最上面一行色块中的任一色块作为第一色块,选取最下面一行色块中的任一色块作为第二色块;在另一个示例中,将最上面一行色块中的横坐标最小的色块作为第一色块,将最下面一行色块中横坐标最大的色块作为第一色块;或,将最上面一行色块中的横坐标最大的色块作为第一色块,将最下面一行色块中横坐标最小的色块作为第一色块;或,基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。由此,能够选取位于两个色卡区域构成的矩形框中对角线端点处的一对色块,作为聚类中心点,由于两个聚类中心点不仅在纵向上距离足够大,且在横向上距离也足够大,因此,能够使得基于位置进行聚类的效率更快,且聚类的结果更准确。并且,该过程基于比对色块中心点的横纵坐标来实现,无需利用坐标值计算出色块的距离,提高了确定聚类中心点的效率。In one example, any color block in the top row of color blocks can be selected as the first color block, and any color block in the bottom row of color blocks can be selected as the second color block; in another example, the color block with the smallest horizontal coordinate in the top row of color blocks is selected as the first color block, and the color block with the largest horizontal coordinate in the bottom row of color blocks is selected as the first color block; or, the color block with the largest horizontal coordinate in the top row of color blocks is selected as the first color block, and the color block with the smallest horizontal coordinate in the bottom row of color blocks is selected as the first color block; or, based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block. Thus, a pair of color blocks located at the diagonal endpoints of the rectangular frame formed by the two color card areas can be selected as the cluster center points. Since the distance between the two cluster center points is not only large enough in the vertical direction, but also large enough in the horizontal direction, the efficiency of position-based clustering can be made faster, and the clustering result can be more accurate. Furthermore, the process is implemented based on comparing the horizontal and vertical coordinates of the center point of the color block, without using the coordinate values to calculate the distance of the color block, thereby improving the efficiency of determining the center point of the cluster.
在一种可能的实现方式中,所述基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块,包括:基于所述纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块,所述第一范围包括:纵坐标最小值减二分之一色块尺寸至纵坐标最小值加二分之一色块尺寸;基于所述纵坐标最大值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块,所述第二范围包括:纵坐标最大值减二分之一色块尺寸至纵坐标最大值加二分之一色块尺寸。In a possible implementation, the determining of the top row of color blocks and the bottom row of color blocks based on the minimum and maximum values of the ordinate includes: based on the minimum value of the ordinate, determining the color blocks whose ordinate values are within a first range as the top row of color blocks, the first range including: the minimum value of the ordinate minus half the color block size to the minimum value of the ordinate plus half the color block size; based on the maximum value of the ordinate, determining the color blocks whose ordinate values are within a second range as the bottom row of color blocks, the second range including: the maximum value of the ordinate minus half the color block size to the maximum value of the ordinate plus half the color block size.
考虑到拍摄角度的影响,最上面一行色块的纵坐标往往是不完全相同的,且最下面一行色块的纵坐标往往也是不完全相同的,因此,在确定最上面一行色块时,可以基于纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块,这里的第一范围的端点可以是纵坐标最小值±1/2色块纵向尺寸。经验证结果表明,基于该第一范围确定最上面一行色块时,恰好能将最上面一行色块准确区分出来,且不会将其它色块误判为最上面一行色块,准确率较高。Considering the influence of the shooting angle, the vertical coordinates of the color blocks in the top row are often not completely the same, and the vertical coordinates of the color blocks in the bottom row are often not completely the same. Therefore, when determining the color blocks in the top row, the color blocks with vertical coordinates within the first range can be determined based on the minimum vertical coordinate value as the color blocks in the top row. The endpoints of the first range here can be the minimum vertical coordinate value ±1/2 of the vertical size of the color block. The verification results show that when the color blocks in the top row are determined based on the first range, the color blocks in the top row can be accurately distinguished, and other color blocks will not be misjudged as the color blocks in the top row, with a high accuracy rate.
同样的,在确定最下面一行色块时,可以基于纵坐标最小值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块,这里的第二范围的端点可以是纵坐标最大值±1/2色块纵向尺寸。经验证结果表明,基于该第二范围确定最下面一行色块时,恰好能将最下面一行色块准确区分出来,且不会将其它色块误判为最下面一行色块,准确率较高。Similarly, when determining the bottom row of color blocks, the color blocks with ordinate values within the second range can be determined based on the minimum ordinate value as the bottom row of color blocks, where the endpoints of the second range can be the maximum ordinate value ±1/2 of the vertical size of the color block. Verification results show that when determining the bottom row of color blocks based on the second range, the bottom row of color blocks can be accurately distinguished, and other color blocks will not be misjudged as the bottom row of color blocks, with a high accuracy rate.
需要说明的是,在本公开实施例中,图像坐标系的原点位于图像左上角,纵向为Y轴,从上到下y值逐渐增大;横向为X轴,从左到右x值逐渐增大。因此色块纵坐标的最大值用于确定最下面一行色块,色块纵坐标的最小值用于确定最上面一行色块。It should be noted that in the disclosed embodiment, the origin of the image coordinate system is located at the upper left corner of the image, the vertical direction is the Y axis, and the y value gradually increases from top to bottom; the horizontal direction is the X axis, and the x value gradually increases from left to right. Therefore, the maximum value of the vertical coordinate of the color block is used to determine the color block in the bottom row, and the minimum value of the vertical coordinate of the color block is used to determine the color block in the top row.
在本公开实施例中,通过基于所述纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块;基于所述纵坐标最大值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块。由此,能够准确地确定出最上面一行色块和最下面一行色块,减少了遗漏色块的可能性,便于后续基于最上面一行色块和最下面一行色块对色块进行聚类,提高了聚类的效率和准确率,提高了区分色卡区域的效率和准确率。In the embodiment of the present disclosure, based on the minimum value of the ordinate, the color blocks with ordinate values within the first range are determined as the top row of color blocks; based on the maximum value of the ordinate, the color blocks with ordinate values within the second range are determined as the bottom row of color blocks. Thus, the top row of color blocks and the bottom row of color blocks can be accurately determined, reducing the possibility of missing color blocks, facilitating the subsequent clustering of color blocks based on the top row of color blocks and the bottom row of color blocks, improving the efficiency and accuracy of clustering, and improving the efficiency and accuracy of distinguishing color card areas.
在一种可能的实现方式中,所述色卡识别方法可通过终端设备和服务器等电子设备执行,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,所述方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In one possible implementation, the color card recognition method can be executed by electronic devices such as terminal devices and servers. The terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory.
此外,本公开还提供了一种色卡识别装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种色卡识别方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides a color card recognition device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any color card recognition method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
图4示出根据本公开实施例的一种色卡识别装置的框图,如图4所示,所述装置40包括:FIG4 shows a block diagram of a color card recognition device according to an embodiment of the present disclosure. As shown in FIG4 , the device 40 includes:
色块识别模块41,用于对色卡图像进行色块识别,得到识别出的色块,所述色卡图像中包含同一色卡工具中的两部分色卡区域;A color block recognition module 41 is used to perform color block recognition on a color card image to obtain recognized color blocks, wherein the color card image includes two color card areas in the same color card tool;
中心点确定模块42,用于根据所述色块的坐标,确定所述色块中的第一色块和第二色块,所述第一色块和第二色块之间的距离满足距离条件;A center point determination module 42, configured to determine a first color block and a second color block in the color blocks according to the coordinates of the color blocks, wherein the distance between the first color block and the second color block satisfies a distance condition;
聚类模块43,用于分别以所述第一色块和所述第二色块作为聚类中心点,对所有色块进行聚类,得到第一类别色块和第二类别色块;A clustering module 43, configured to cluster all color blocks using the first color block and the second color block as cluster centers to obtain first category color blocks and second category color blocks;
区域划分模块44,用于将第一类别色块和第二类别色块,划分至两个区域。The region division module 44 is used to divide the first category color blocks and the second category color blocks into two regions.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
根据所述色块的坐标,确定所有色块中距离最远的两个色块,作为第一色块和第二色块。According to the coordinates of the color block, two color blocks with the farthest distance from each other among all the color blocks are determined as the first color block and the second color block.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
根据色块中心点的纵坐标,分别确定纵坐标最小值和最大值的色块;According to the ordinate of the center point of the color block, the color blocks with the minimum and maximum ordinate values are determined respectively;
基于所述纵坐标最小值和最大值,确定最上面一行色块和最下面一行色块;Based on the minimum and maximum values of the ordinate, determine the top row of color blocks and the bottom row of color blocks;
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
基于所述纵坐标最小值,确定纵坐标的值在第一范围内的色块,作为最上面一行色块,所述第一范围包括:纵坐标最小值减二分之一色块尺寸至纵坐标最小值加二分之一色块尺寸;Based on the minimum value of the ordinate, determine the color blocks whose ordinate values are within a first range as the color blocks in the top row, wherein the first range includes: the minimum value of the ordinate minus half the size of the color block to the minimum value of the ordinate plus half the size of the color block;
基于所述纵坐标最大值,确定纵坐标的值在第二范围内的色块,作为最下面一行色块,所述第二范围包括:纵坐标最大值减二分之一色块尺寸至纵坐标最大值加二分之一色块尺寸。Based on the maximum ordinate value, determine the color blocks whose ordinate values are within a second range as the color blocks in the bottom row, where the second range includes: the maximum ordinate value minus half the color block size to the maximum ordinate value plus half the color block size.
在一种可能的实现方式中,所述中心点确定模块,用于:In a possible implementation, the center point determination module is used to:
将最上面一行色块中的横坐标最小的色块作为第一色块,将最下面一行色块中横坐标最大的色块作为第一色块;或,The color block with the smallest horizontal coordinate in the top row of color blocks is used as the first color block, and the color block with the largest horizontal coordinate in the bottom row of color blocks is used as the first color block; or,
将最上面一行色块中的横坐标最大的色块作为第一色块,将最下面一行色块中横坐标最小的色块作为第一色块;或,The color block with the largest horizontal coordinate in the top row of color blocks is taken as the first color block, and the color block with the smallest horizontal coordinate in the bottom row of color blocks is taken as the first color block; or,
基于色块中心点的横坐标,选取最上面一行色块中的色块作为第一色块,选取最下面一行色块中的色块作为第二色块。Based on the horizontal coordinate of the center point of the color block, the color block in the top row of color blocks is selected as the first color block, and the color block in the bottom row of color blocks is selected as the second color block.
在一种可能的实现方式中,所述聚类模块,用于:In a possible implementation, the clustering module is used to:
以所述第一色块和所述第二色块作为聚类中心点,基于各色块的位置,对所有色块进行聚类,得到第一类别色块和第二类别色块。The first color block and the second color block are used as cluster center points, and based on the position of each color block, all color blocks are clustered to obtain first category color blocks and second category color blocks.
在一种可能的实现方式中,所述聚类模块,用于:In a possible implementation, the clustering module is used to:
针对所有色块,分别计算各色块到两个聚类中心点的距离;For all color blocks, calculate the distance between each color block and the two cluster center points;
将各色块分类至距离最小的聚类中心点对应的类中,得到第一类别色块和第二类别色块;Classify each color block into the class corresponding to the cluster center point with the smallest distance, and obtain the first category color block and the second category color block;
根据第一类别色块和第二类别色块的位置,分别确定第一类别色块和第二类别色块的质心,作为第一类别色块和第二类别色块新的聚类中心点;According to the positions of the first category color blocks and the second category color blocks, respectively determine the centroids of the first category color blocks and the second category color blocks as new clustering center points of the first category color blocks and the second category color blocks;
迭代地执行上述计算距离至确定新的聚类中心点的过程,直至满足迭代停止条件,得到重新分类后的第一类别色块和第二类别色块。The above process of calculating the distance to determine the new cluster center point is iteratively performed until the iteration stop condition is met, and the reclassified first category color blocks and second category color blocks are obtained.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, a server, or a device in other forms.
图5示出根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等终端设备。5 shows a block diagram of an electronic device 800 according to an embodiment of the present disclosure. For example, the electronic device 800 may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or other terminal devices.
参照图5,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input/output (I/O) interface 812 , a sensor component 814 , and a communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。I/O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open/closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(Wi-Fi)、第二代移动通信技术(2G)、第三代移动通信技术(3G)、第四代移动通信技术(4G)、通用移动通信技术的长期演进(LTE)、第五代移动通信技术(5G)或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (Wi-Fi), a second generation mobile communication technology (2G), a third generation mobile communication technology (3G), a fourth generation mobile communication technology (4G), a long-term evolution (LTE) of a universal mobile communication technology, a fifth generation mobile communication technology (5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure may be a system, a method and/or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing/processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers. The network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device.
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Various aspects of the present disclosure are described herein with reference to the flowcharts and/or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and/or block diagram and the combination of each box in the flowchart and/or block diagram can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions/actions specified in one or more boxes in the flowchart and/or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and/or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
若本申请技术方案涉及个人信息,应用本申请技术方案的产品在处理个人信息前,已明确告知个人信息处理规则,并取得个人自主同意。若本申请技术方案涉及敏感个人信息,应用本申请技术方案的产品在处理敏感个人信息前,已取得个人单独同意,并且同时满足“明示同意”的要求。例如,在摄像头等个人信息采集装置处,设置明确显著的标识告知已进入个人信息采集范围,将会对个人信息进行采集,若个人自愿进入采集范围即视为同意对其个人信息进行采集;或者在个人信息处理的装置上,利用明显的标识/信息告知个人信息处理规则的情况下,通过弹窗信息或请个人自行上传其个人信息等方式获得个人授权;其中,个人信息处理规则可包括个人信息处理者、个人信息处理目的、处理方式以及处理的个人信息种类等信息。If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs/information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311049595.5A CN117095186B (en) | 2023-08-18 | 2023-08-18 | Color card identification method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311049595.5A CN117095186B (en) | 2023-08-18 | 2023-08-18 | Color card identification method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117095186A CN117095186A (en) | 2023-11-21 |
CN117095186B true CN117095186B (en) | 2024-07-05 |
Family
ID=88774707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311049595.5A Active CN117095186B (en) | 2023-08-18 | 2023-08-18 | Color card identification method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117095186B (en) |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080101693A1 (en) * | 2006-10-26 | 2008-05-01 | Intelligence Frontier Media Laboratory Ltd | Video image based tracking system for identifying and tracking encoded color surface |
JP5267422B2 (en) * | 2009-10-28 | 2013-08-21 | セイコーエプソン株式会社 | Image processing method and program, and image processing apparatus |
US9183641B2 (en) * | 2014-02-10 | 2015-11-10 | State Farm Mutual Automobile Insurance Company | System and method for automatically identifying and matching a color of a structure's external surface |
CN110189329B (en) * | 2019-04-03 | 2022-12-13 | 创新先进技术有限公司 | System and method for locating patch regions of a color chip |
CN112102441B (en) * | 2020-09-14 | 2024-07-23 | 上海米哈游天命科技有限公司 | Color card manufacturing method, device, electronic equipment and storage medium |
CN113840135B (en) * | 2021-09-03 | 2023-10-20 | 大连中科创达软件有限公司 | Color cast detection method, device, equipment and storage medium |
CN115761270A (en) * | 2022-11-23 | 2023-03-07 | 上海闻泰电子科技有限公司 | Color card detection method and device, electronic equipment and storage medium |
CN116578225A (en) * | 2023-05-23 | 2023-08-11 | 北京字跳网络技术有限公司 | Image processing method, apparatus, device, computer readable storage medium, and product |
-
2023
- 2023-08-18 CN CN202311049595.5A patent/CN117095186B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN117095186A (en) | 2023-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11481975B2 (en) | Image processing method and apparatus, electronic device, and computer-readable storage medium | |
WO2021155632A1 (en) | Image processing method and apparatus, and electronic device and storage medium | |
US20210058595A1 (en) | Method, Device, and Storage Medium for Converting Image | |
US10007841B2 (en) | Human face recognition method, apparatus and terminal | |
KR20210065180A (en) | Image processing method and apparatus, electronic device and storage medium | |
CN113409342B (en) | Image style transfer model training method, device and electronic device | |
US11450021B2 (en) | Image processing method and apparatus, electronic device, and storage medium | |
US11222235B2 (en) | Method and apparatus for training image processing model, and storage medium | |
CN112219224B (en) | Image processing method and device, electronic equipment and storage medium | |
CN102096898A (en) | Method and device for image processing | |
CN105528765B (en) | Method and device for processing images | |
CN112200040B (en) | Occlusion image detection method, device and medium | |
CN111126108A (en) | Training method and device of image detection model and image detection method and device | |
CN112184787A (en) | Image registration method and device, electronic equipment and storage medium | |
AU2020323956B2 (en) | Image processing method and apparatus, electronic device, and storage medium | |
CN108171222B (en) | A real-time video classification method and device based on multi-stream neural network | |
CN117315031A (en) | Method, device, equipment and storage medium for determining pose of insertion seat | |
AU2020309091B2 (en) | Image processing method and apparatus, electronic device, and storage medium | |
CN117095186B (en) | Color card identification method and device, electronic equipment and storage medium | |
EP4106321A1 (en) | Image processing method and apparatus, model training method and apparatus, and storage medium | |
CN114821797A (en) | Lip language content identification method and device, storage medium and electronic equipment | |
CN104871532B (en) | Filming apparatus and its method of controlling operation | |
CN116438568A (en) | Method and device for generating location difference map, electronic equipment, chip and medium | |
CN117058255B (en) | Color card identification method and device, electronic equipment and storage medium | |
US12354248B2 (en) | Image processing method and apparatus, model training method and apparatus, and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: B655, 4th Floor, Building 14, Cuiwei Zhongli, Haidian District, Beijing, 100036 Patentee after: Mole Thread Intelligent Technology (Beijing) Co.,Ltd. Country or region after: China Address before: 209, 2nd Floor, No. 31 Haidian Street, Haidian District, Beijing Patentee before: Moore Threads Technology Co., Ltd. Country or region before: China |