Method, device and equipment for identifying color of lighter shell, medium and product

Through image processing technology, the R, G, and B components of the lighter case image are extracted, the correlation coefficient with the standard image is calculated, and the area is determined, which automatically recognizes the color of the lighter case, solves the problem of low manual classification efficiency, and improves production efficiency and recognition accuracy.

CN119741505APending Publication Date: 2025-04-01JIAYING UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411805777.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, the color classification of lighter case mainly relies on manual observation, resulting in large repetitive work, fatigue of workers, low efficiency, and lack of automated identification methods.

Method used

By obtaining the image to be tested, segmenting the image center area, extracting R, G, and B components, calculating the correlation coefficient with the standard image, determining the area area, and determining the color if the area exceeds the threshold, it is judged that the color is the same, so that the lighter case color can be automatically recognized.

Benefits of technology

It improves the efficiency and accuracy of color recognition of lighter case, reduces manual intervention, reduces workers' labor intensity, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741505A_ABST
    Figure CN119741505A_ABST
Patent Text Reader

Abstract

The invention discloses a lighter shell color recognition method and device, equipment, a medium and a product, and relates to the field of image processing.The method comprises the steps that R, G and B components of all to-be-detected sub-areas in a center area of a to-be-detected image are extracted, and a first gray level histogram data set is obtained; performing correlation coefficient calculation on the first gray level histogram data set and the second gray level histogram data set to obtain a correlation coefficient of each to-be-detected sub-region and a corresponding standard sub-region; the second grayscale histogram data set comprises R, G and B components of each standard sub-region of the central region of the standard image; determining a region area according to the correlation coefficient; the area of the region is the sum of the areas of all the to-be-measured sub-regions with the correlation coefficients greater than a set correlation coefficient threshold; if the area of the area is larger than the set area threshold value, it is determined that the to-be-detected lighter shell and the sample lighter shell are the same in color, automatic recognition of the color of the lighter shell can be achieved, and the recognition efficiency and the recognition accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a lighter casing color recognition method, device, equipment, medium and product. Background Art

[0002] At present, in order to effectively improve the production efficiency of lighters, reduce production costs, and maintain the security of the lighter industry chain, it is of great significance to study various methods for automatic production and automatic assembly of lighters.

[0003] Classifying lighters is an important part of lighter production and assembly. In the classification of lighter casing colors, the relevant method is for workers to observe and classify each sample. This manual classification method is extremely repetitive, increases the workload of workers, and easily causes worker fatigue, affecting work. Therefore, how to achieve automatic recognition of lighter casing colors has become a problem that needs to be solved urgently. Summary of the invention

[0004] The purpose of this application is to provide a lighter casing color recognition method, device, equipment, medium and product, which can realize automatic recognition of the lighter casing color and improve recognition efficiency and recognition accuracy.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a lighter housing color recognition method, comprising:

[0007] Acquire an image to be tested; the image to be tested is an image of a casing of a lighter to be tested;

[0008] Segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested;

[0009] Extracting R, G, and B components of each of the sub-regions to be tested to obtain a first grayscale histogram data set;

[0010] Calculating the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region; the second grayscale histogram data set includes: R, G, B components of each standard sub-region in the central region of the standard image; the standard image is an image of a sample lighter housing with a known color;

[0011] Determine the area of ​​the region according to the correlation coefficient; the area of ​​the region is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold;

[0012] If the area of ​​the region is greater than the set area threshold, it is determined that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter.

[0013] Optionally, before segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested, the lighter housing color recognition method further includes:

[0014] The Sobel algorithm is used to extract the edge of the image to be measured to obtain the edge to be measured;

[0015] The center position of the lighter housing to be tested is located according to the edge to be tested, and the center area of ​​the image to be tested is determined.

[0016] Optionally, obtaining the image to be tested specifically includes:

[0017] An image acquisition platform is used to acquire the image to be tested; the image acquisition platform comprises: an industrial camera, an optical imaging lens and a planar light source; the surface of the planar light source is used to place the lighter casing to be tested; the optical imaging lens is arranged at the front end of the industrial camera; the industrial camera photographs the lighter casing to be tested through the optical imaging lens to obtain the image to be tested.

[0018] Optionally, before calculating the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region, the lighter housing color recognition method further includes:

[0019] Get a standard image;

[0020] Segmenting the central area of ​​the standard image to obtain a plurality of standard sub-areas;

[0021] The R, G, and B components of each of the standard sub-regions are extracted to obtain a second grayscale histogram data set.

[0022] Optionally, before segmenting the central area of ​​the standard image to obtain a plurality of standard sub-areas, the lighter housing color recognition method further includes:

[0023] Using the Sobel algorithm to extract the edge of the standard image to obtain a standard edge;

[0024] The center position of the sample lighter housing is located according to the standard edge to determine the center area of ​​the standard image.

[0025] Optionally, the set correlation coefficient threshold and the set area threshold are determined according to a statistical method.

[0026] In a second aspect, the present application provides a lighter housing color recognition device, comprising:

[0027] An image acquisition module, used for acquiring an image to be tested; the image to be tested is an image of a casing of a lighter to be tested;

[0028] An image segmentation module, used for segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested;

[0029] A feature extraction module, used to extract the R, G, and B components of each sub-region to be measured to obtain a first grayscale histogram data set;

[0030] A feature matching module is used to calculate the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region; the second grayscale histogram data set includes: R, G, B components of each standard sub-region in the central area of ​​the standard image; the standard image is an image of a sample lighter casing with a known color;

[0031] A region area determination module, used to determine the region area according to the correlation coefficient; the region area is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold;

[0032] The color recognition module is used to determine that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter if the area of ​​the region is greater than a set area threshold.

[0033] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described lighter housing color recognition methods.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for identifying the color of a lighter casing.

[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned lighter housing color recognition methods.

[0036] According to the specific embodiments provided in this application, this application has the following technical effects:

[0037] The present application provides a lighter casing color recognition method, device, equipment, medium and product. The area of ​​a region is determined by calculating the correlation coefficient between a first grayscale histogram data set of a test image and a second grayscale histogram data set of a standard image. Whether the color of a test lighter casing and a sample lighter casing are the same is determined based on the size of the area of ​​the region. The present application realizes automatic recognition of the color of a lighter casing based on image processing technology, improves recognition efficiency and recognition accuracy, and can effectively improve the production efficiency of lighters. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 This is an application environment diagram of a lighter casing color recognition method in one embodiment of the present application;

[0040] Figure 2 A schematic diagram of a flow chart of a lighter casing color recognition method provided in one embodiment of the present application;

[0041] Figure 3 A schematic diagram of the structure of an image acquisition platform provided in one embodiment of the present application;

[0042] Figure 4 A more specific complete flow chart of a lighter housing color recognition method provided in one embodiment of the present application;

[0043] Figure 5 A schematic diagram of an example of a lighter housing identification work with a pink color feature provided by an embodiment of the present application;

[0044] Figure 6 A schematic diagram of an example of a lighter housing identification work with a blue color feature provided by an embodiment of the present application;

[0045] Figure 7 A schematic diagram of an example of a lighter housing identification work with a red color feature provided by an embodiment of the present application;

[0046] Figure 8 A schematic diagram of functional modules of a lighter casing color recognition device provided by another embodiment of the present application;

[0047] Fig. 9 A schematic diagram of the structure of a computer device provided in one embodiment of the present application.

[0048] Reference numerals: industrial camera—1, optical imaging lens—2, plane light source—3, casing of lighter to be tested—4. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0051] At present, the color classification of lighter casings is mainly done manually. In order to simplify the workers' work and overcome the uncertainty brought by human subjective factors to the screening work, the embodiment of the present application adopts image processing technology to convert the experiential knowledge of the detection workers into formal knowledge that can be understood and executed by computers, thereby realizing automatic classification of lighter casings according to color features.

[0052] The lighter housing color recognition method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the image to be tested to the server 104. After the server 104 receives the image to be tested, for the image to be tested, the server 104 divides the central area of ​​the image to be tested to obtain multiple sub-areas to be tested; extracts the R, G, and B components of each sub-area to be tested to obtain a first grayscale histogram data set; calculates the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-area to be tested and the corresponding standard sub-area; the second grayscale histogram data set includes: the R, G, and B components of each standard sub-area in the central area of ​​the standard image; the standard image is an image of a sample lighter case with known color; determines the area of ​​the area according to the correlation coefficient; the area of ​​the area is the sum of the areas of all sub-areas to be tested whose correlation coefficients are greater than a set correlation coefficient threshold; if the area of ​​the area is greater than the set area threshold, it is determined that the color of the lighter case to be tested is the same as the color of the sample lighter case.

[0053] The server 104 can feed back the obtained color recognition result to the terminal 102. In addition, in some embodiments, the lighter housing color recognition method can also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 can directly process the image to be tested, or the server 104 can obtain the image to be tested from the data storage system and process the image to be tested.

[0054] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0055] In an exemplary embodiment, Figure 2 As shown, a method for identifying the color of a lighter casing is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps 201 to 206. Among them:

[0056] Step 201, obtaining an image to be tested; the image to be tested is an image of a casing of a lighter to be tested.

[0057] Step 202 : segment the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested.

[0058] Step 203: extract the R, G, and B components of each of the sub-regions to be tested to obtain a first grayscale histogram data set.

[0059] Step 204 , calculating the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region.

[0060] The second grayscale histogram data set includes: R, G, B components of each standard sub-area in the central area of ​​the standard image; the standard image is an image of a sample lighter casing with a known color.

[0061] Step 205, determining the area of ​​the region according to the correlation coefficient; the area of ​​the region is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold.

[0062] Step 206: If the area of ​​the region is greater than the set area threshold, it is determined that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter.

[0063] The implementation of the above steps 201 to 206 can realize automatic recognition of the color of the lighter casing, improve recognition efficiency and recognition accuracy, and thus effectively improve the production efficiency of the lighter.

[0064] In another exemplary embodiment of the present application, before step 202, the lighter housing color recognition method further includes: using the Sobel algorithm to extract the edge of the image to be tested to obtain the edge to be tested; locating the center position of the lighter housing to be tested according to the edge to be tested to determine the central area of ​​the image to be tested.

[0065] In another exemplary embodiment of the present application, step 201 specifically includes: using an image acquisition platform to acquire an image to be tested.

[0066] See also Figure 3 The image acquisition platform includes: an industrial camera 1, an optical imaging lens 2 and a plane light source 3; the surface of the plane light source 3 is used to place the lighter casing 4 to be tested; the optical imaging lens 2 is set at the front end of the industrial camera 1; the industrial camera 1 shoots the lighter casing 4 to be tested through the optical imaging lens 2 to obtain the image to be tested.

[0067] In another exemplary embodiment of the present application, before step 204, the lighter casing color recognition method further includes: acquiring a standard image; segmenting the central area of ​​the standard image to obtain a plurality of standard sub-areas; extracting the R, G, and B components of each of the standard sub-areas to obtain a second grayscale histogram data set.

[0068] In this embodiment, before segmenting the central area of ​​the standard image to obtain multiple standard sub-areas, the lighter case color recognition method also includes: using the Sobel algorithm to extract the edge of the standard image to obtain a standard edge; locating the center position of the sample lighter case according to the standard edge to determine the central area of ​​the standard image.

[0069] In another exemplary embodiment of the present application, the set correlation coefficient threshold and the set area threshold can be determined based on experience or statistics.

[0070] The following is an introduction to a specific process of a lighter casing color recognition method in practical applications.

[0071] This embodiment realizes lighter casing color recognition based on the visual system, and uses image processing technology to convert the experience knowledge of the inspection personnel into formal knowledge that can be understood and executed by the computer, thereby realizing the recognition of the lighter casing color and laying the foundation for the subsequent classification process. Specifically:

[0072] (1) A lighter casing of a certain color is selected as a standard sample and placed on the surface of a plane light source 3. An industrial camera 1 obtains an image of the lighter casing through an optical imaging lens 2.

[0073] (2) Extract edges based on the Sobel algorithm and locate the area where the center of the lighter casing is located based on the edges.

[0074] (3) A standard sample is selected, and the image of the central area of ​​the lighter casing is segmented to obtain a grayscale histogram data set of the three components R, G, and B of the image as a reference.

[0075] (4) Randomly select a lighter case with any color feature as the lighter case to be tested, obtain the R, G, B grayscale histogram data set of the lighter case to be tested, and perform correlation coefficient analysis with the histogram data set used for reference, and quantify the color similarity between the targets through the correlation coefficient. The larger the correlation coefficient, the higher the similarity, and the correlation coefficient of the histogram data set is used to determine whether the colors are the same.

[0076] (5) A correlation coefficient threshold is set based on experience or statistical results, and colors above the threshold are considered to be the same.

[0077] (6) Within the lighter housing location area, count the areas with the same color characteristics.

[0078] (7) An area threshold is set based on experience or statistical results. When the area is higher than the area threshold, the two lighter casings have the same color. Otherwise, they are different.

[0079] The above embodiment places the lighter casing on the surface of the plane light source 3, so that the lighter casing has a clear contrast with the background, highlighting the outline of the lighter casing; the industrial camera 1 collects the image of the lighter casing through the optical imaging lens 2, and uses the Sobel algorithm to extract the edge of the lighter casing, thereby determining the placement position and placement direction (i.e., placement angle) of the lighter according to the edge; the image at the center position of the casing is segmented to obtain R, G, and B histogram data; with the histogram data of qualified samples as a reference, the correlation between the histogram data and the color of the target object is analyzed; matching and identification of targets with the same color characteristics are achieved based on the correlation coefficient. This method can efficiently match and identify lighter casings of different colors, effectively improving the production efficiency of lighters.

[0080] The correctness and effectiveness of the above method of this application are verified below.

[0081] See also Figure 4 , description of the color characteristics of the lighter casing: select a standard product with a certain color characteristic, obtain the R, G, and B color histogram data sets respectively, and detect the color characteristics based on the correlation coefficient of the histogram data sets: 1. Obtain the R, G, and B color component histogram data sets of the test sample (i.e., the lighter casing to be tested); 2. Calculate the correlation coefficient between the R, G, and B color histogram data sets of the test sample and the reference data; 3. Set the correlation coefficient threshold according to statistics or experience, and a value above the threshold indicates that the color characteristics are the same; 4. In the detection target position, count the area of ​​the region with the same color characteristics; 5. Set the area threshold according to statistics or experience, and a value above the threshold indicates that the test sample and the reference sample have the same color characteristics.

[0082] The expression for the correlation coefficient of the histogram data set is as follows:

[0083]

[0084] Wherein, N means that the grayscale is divided into N intervals, and R(i) means the number of pixels whose grayscale falls into interval i under the condition of obtaining the reference sample histogram grayscale data set; represents the average value of R(i), H(i) represents the number of pixels whose grayscale falls within the i interval under the condition of obtaining the grayscale histogram data set of the test sample; represents the average value of H(i); r is the correlation coefficient value, which is used to measure the similarity between the color characteristics of the test sample and the standard sample. The larger r is, the higher the similarity is.

[0085] Figure 5 An example of a lighter case recognition operation with a pink color feature is shown. Figure 5 Part (a) is the standard pink sample. Figure 5 Part (b) shows the pink sample G component grayscale histogram dataset, Figure 5 Part (c) shows the lighter housing to be tested. Figure 5 Part (d) shows the three-dimensional distribution of the correlation coefficient. Figure 5 Part (e) shows a region having a pink color feature.

[0086] Figure 6 An example of a lighter case recognition operation with a blue color feature is shown. Figure 6 Part (a) is the standard blue sample. Figure 6 Part (b) in FIG. 1 shows a blue sample B component grayscale histogram dataset. Figure 6 Part (c) shows the lighter housing to be tested. Figure 6Part (d) shows the three-dimensional distribution of the correlation coefficient. Figure 6 Part (e) shows a region having a blue color feature.

[0087] Figure 7 An example of a lighter case recognition operation with a red color feature is shown. Figure 7 Part (a) is the standard red sample. Figure 7 Part (b) in FIG. 1 shows a grayscale histogram data set of the red sample G component. Figure 7 Part (c) shows the lighter housing to be tested. Figure 7 Part (d) shows the three-dimensional distribution of the correlation coefficient. Figure 7 Part (e) shows a region having a red color feature.

[0088] By adopting the method of the present application, regions with the same color characteristics can be segmented based on the correlation coefficient, and the color characteristics can be judged according to the area of ​​the region. Figure 5-Figure 7 It is shown that the method of the present application can screen out targets having the same color characteristics as the standard sample. Figure 5 Part (e) of Figure 6 Part (e) of Figure 7 Part (e) is the area searched by the correlation coefficient, and the target is finally accurately screened out based on the area.

[0089] In this embodiment, 600 samples of different colors are selected for the experiment, and the accuracy of the results is subject to the inspection workers. The experimental results are shown in Table 1. The experimental results show that the accuracy rate is satisfactory and meets the needs of practical applications.

[0090] Table 1 Experimental results

[0091] method Total number of sample groups Correct number Number of errors Accuracy This application 600 593 7 98.83%

[0092] Based on the same inventive concept, the embodiment of the present application also provides a lighter case color recognition device for implementing the lighter case color recognition method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the lighter case color recognition device provided below can refer to the limitations of the lighter case color recognition method above, and will not be repeated here.

[0093] In an exemplary embodiment, Figure 8 As shown, a lighter housing color recognition device is provided, comprising:

[0094] The image acquisition module 801 is used to acquire the image to be tested; the image to be tested is the image of the casing of the lighter to be tested.

[0095] The image segmentation module 802 is used to segment the central area of ​​the image to be tested to obtain multiple sub-areas to be tested.

[0096] The feature extraction module 803 is used to extract the R, G, and B components of each of the sub-regions to be detected to obtain a first grayscale histogram data set.

[0097] The feature matching module 804 is used to calculate the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region; the second grayscale histogram data set includes: the R, G, and B components of each standard sub-region in the central area of ​​the standard image; the standard image is an image of a sample lighter casing with a known color.

[0098] The region area determination module 805 is used to determine the region area according to the correlation coefficient; the region area is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold.

[0099] The color recognition module 806 is used to determine that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter if the area of ​​the region is greater than a set area threshold.

[0100] Specifically, a qualified lighter case sample is placed on the surface of a flat light source head, so that the lighter case forms a strong contrast with the background and highlights the outline; after the industrial camera obtains the image of the lighter case through an optical imaging lens, the edge of the lighter case is extracted based on the Sobel operator, and the position information and placement angle information of the lighter are obtained based on the edge; a lighter case with a certain color feature is selected, and the image at the center of the case is segmented, and the R, G, and B histogram data sets are obtained as a reference; during the detection process, the R, G, and B histogram data sets of the detection target are extracted, and the correlation coefficient is calculated with the reference data set; a correlation coefficient threshold is set according to statistical results or experience; when the correlation coefficient is greater than the threshold, the color is the same; within the case area, the area of ​​the region with the same color feature is counted, and the area threshold is set by statistical method or experience. When the area of ​​the region with the same color feature exceeds the threshold, it is determined that the target has the same color feature as the reference sample.

[0101] In order to reduce the labor intensity of workers, this embodiment is based on image processing technology and realizes automatic recognition of lighter casing color according to color features, so that the lighter production system can automatically sort targets according to color.

[0102] The above embodiment locates the target area and obtains the area information of the lighter casing according to the contour features; describes and extracts the color features, selects a standard reference sample, and extracts the R, G, B grayscale histogram data set of the central area of ​​the casing as reference data; realizes color feature matching, extracts the R, G, B histogram data set of the detection target, calculates the correlation coefficient with the reference data obtained above, and judges whether the color features are the same according to the correlation coefficient; counts the area of ​​the region, and counts the area of ​​the region with the same color features. When the area meets the requirements, it is judged that the color features of the detection sample are the same as the color features of the reference sample. This embodiment can realize efficient and automatic classification of lighter casings according to color features.

[0103] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store images to be tested. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for identifying the color of a lighter casing is implemented.

[0104] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0105] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0106] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0107] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0108] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0109] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, etc., but is not limited thereto.

[0110] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0111] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for identifying the color of a lighter casing, characterized in that: The lighter housing color recognition method comprises: Acquire an image to be tested; the image to be tested is an image of a casing of a lighter to be tested; Segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested; Extracting R, G, and B components of each of the sub-regions to be tested to obtain a first grayscale histogram data set; Calculating the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region; the second grayscale histogram data set includes: R, G, B components of each standard sub-region in the central region of the standard image; the standard image is an image of a sample lighter housing with a known color; Determine the area of ​​the region according to the correlation coefficient; the area of ​​the region is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold; If the area of ​​the region is greater than the set area threshold, it is determined that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter.

2. The lighter housing color recognition method according to claim 1, characterized in that: Before segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested, the lighter housing color recognition method further includes: The Sobel algorithm is used to extract the edge of the image to be measured to obtain the edge to be measured; The center position of the lighter housing to be tested is located according to the edge to be tested, and the center area of ​​the image to be tested is determined.

3. The lighter housing color recognition method according to claim 1, characterized in that: Obtain the image to be tested, including: An image acquisition platform is used to acquire the image to be tested; the image acquisition platform comprises: an industrial camera, an optical imaging lens and a planar light source; the surface of the planar light source is used to place the lighter casing to be tested; the optical imaging lens is arranged at the front end of the industrial camera; the industrial camera photographs the lighter casing to be tested through the optical imaging lens to obtain the image to be tested.

4. The lighter housing color recognition method according to claim 1, characterized in that: Before calculating the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region, the lighter housing color recognition method further includes: Get a standard image; Segmenting the central area of ​​the standard image to obtain a plurality of standard sub-areas; The R, G, and B components of each of the standard sub-regions are extracted to obtain a second grayscale histogram data set.

5. The lighter housing color recognition method according to claim 4, characterized in that: Before segmenting the central area of ​​the standard image to obtain a plurality of standard sub-areas, the lighter housing color recognition method further includes: Using the Sobel algorithm to extract the edge of the standard image to obtain a standard edge; The center position of the sample lighter housing is located according to the standard edge to determine the center area of ​​the standard image.

6. The lighter housing color recognition method according to claim 1, characterized in that: The set correlation coefficient threshold and the set area threshold are determined according to a statistical method.

7. A lighter housing color recognition device, characterized in that: The lighter housing color recognition device comprises: An image acquisition module, used for acquiring an image to be tested; the image to be tested is an image of a casing of a lighter to be tested; An image segmentation module, used for segmenting the central area of ​​the image to be tested to obtain a plurality of sub-areas to be tested; A feature extraction module, used to extract the R, G, and B components of each sub-region to be measured to obtain a first grayscale histogram data set; A feature matching module is used to calculate the correlation coefficient between the first grayscale histogram data set and the second grayscale histogram data set to obtain the correlation coefficient between each sub-region to be tested and the corresponding standard sub-region; the second grayscale histogram data set includes: R, G, B components of each standard sub-region in the central area of ​​the standard image; the standard image is an image of a sample lighter casing with a known color; A region area determination module, used to determine the region area according to the correlation coefficient; the region area is the sum of the areas of all sub-regions to be measured whose correlation coefficients are greater than a set correlation coefficient threshold; The color recognition module is used to determine that the color of the casing of the lighter to be tested is the same as the color of the casing of the sample lighter if the area of ​​the region is greater than a set area threshold.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the lighter housing color recognition method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the lighter housing color recognition method described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the lighter housing color recognition method described in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Chemical reaction control method, system and device based on solution color

    CN120631071A