CN105430218A - Image color recognition method and device - Google Patents
Image color recognition method and device Download PDFInfo
- Publication number
- CN105430218A CN105430218A CN201510846646.6A CN201510846646A CN105430218A CN 105430218 A CN105430218 A CN 105430218A CN 201510846646 A CN201510846646 A CN 201510846646A CN 105430218 A CN105430218 A CN 105430218A
- Authority
- CN
- China
- Prior art keywords
- color
- image
- area
- colors
- recognition
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/00002—Diagnosis, testing or measuring; Detecting, analysing or monitoring not otherwise provided for
- H04N1/00005—Diagnosis, testing or measuring; Detecting, analysing or monitoring not otherwise provided for relating to image data
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B41—PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
- B41J—TYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
- B41J29/00—Details of, or accessories for, typewriters or selective printing mechanisms not otherwise provided for
- B41J29/38—Drives, motors, controls or automatic cut-off devices for the entire printing mechanism
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/46—Colour picture communication systems
- H04N1/56—Processing of colour picture signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/46—Colour picture communication systems
- H04N1/56—Processing of colour picture signals
- H04N1/60—Colour correction or control
- H04N1/603—Colour correction or control controlled by characteristics of the picture signal generator or the picture reproducer
- H04N1/6033—Colour correction or control controlled by characteristics of the picture signal generator or the picture reproducer using test pattern analysis
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- General Health & Medical Sciences (AREA)
- Image Analysis (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
The embodiments of the invention relate to an image color recognition method and device. The method comprises: detecting the edge of a preprocessed image to obtain edge pixels; determining a first area according to the edge pixels; calculating the distance between the color values of any two colors in the first area; determining the two colors between which the distance is smaller than a first preset threshold as a group of similar colors; recognizing the color with more pixels in each group of similar colors as a target color; and setting the sum of pixels of each group of similar colors as the number of pixels of the target color. The image color recognition method is simple to implement and the image color recognition device is high in color recognition precision, and can meet the requirement of printing cost accounting.
Description
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of image color recognition methods and device.
Background technology
Porous printing is called as four large printing processes together with flat stamping, convex print, gravure.Porous printing comprises stencil, engraves hole flower version, spraying decoration and silk screen printing etc.The principle of porous printing is: forme (the version base of paper film version or other edition being produced the eyelet by ink) is when printing, make the eyelet of ink passing hole version transfer on stock (paper, pottery etc.) by certain pressure, form image or word.By the extruding of scraper plate during printing, make ink transfer on stock by the mesh of areas, form the picture and text the same with original copy.
In porous printing, screen printing apparatus is simple, easy to operate, print, make a plate simple and easy and with low cost, strong adaptability.Silk screen printing applied range, common print comprises: colored oil painting, pictorial poster, business card, binding and layout front cover, product tag and printed textile etc.When carrying out silk screen printing, the factor affecting silk screen printing cost is the number of colours of pattern.Therefore, when carrying out silk screen printing cost accounting, needing the number of colours identifying printed pattern, thus calculating printing cost according to the number of colours identified.
In prior art, the precision for pattern color identification is not high, cannot realize the accurate Calculation of printing cost.
Summary of the invention
The object of this invention is to provide a kind of image color recognition methods and device, not high with the precision solving pattern color identification, the problem of the accurate Calculation of printing cost cannot be realized.
For achieving the above object, the invention provides a kind of image color recognition methods, described method comprises:
Rim detection is carried out to pretreatment image, obtains edge pixel point;
First area is determined according to described edge pixel point;
Calculate the distance of the color value of any two kinds of colors in described first area;
The two kinds of colors described distance being less than default first threshold are defined as one group of Similar color;
Be color of object by often organizing the more colour recognition of pixel count in Similar color;
The pixel count sum often organizing Similar color is set to the pixel count of described color of object.
On the other hand, the invention provides a kind of image color recognition device, described device comprises:
Detecting unit, for carrying out rim detection to pretreatment image, obtains edge pixel point;
First determining unit, for determining first area according to described edge pixel point;
Computing unit, for calculating the distance of the color value of any two kinds of colors in described first area;
Second determining unit, is defined as one group of Similar color for the two kinds of colors described distance being less than default first threshold;
Recognition unit, for being color of object by often organizing the more colour recognition of pixel count in Similar color;
Setting unit, for being set to the pixel count of described color of object by the pixel count sum often organizing Similar color.
The image color recognition methods that the embodiment of the present invention provides and device, method realizes simple, and color recognition precision is high, can meet the needs that printing cost is adjusted.
Accompanying drawing explanation
The flow chart of the image color recognition methods that Fig. 1 provides for the embodiment of the present invention;
The schematic diagram of the image color recognition device that Fig. 2 provides for the embodiment of the present invention.
Embodiment
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
The color that the naked eyes that the color that technical solution of the present invention is applicable to identify is behaved can be discovered.The image that technical solution of the present invention is applicable to identify is the image of clear-cut, only have the image of clear-cut just to support silk screen printing, and cost is relevant with color.
The flow chart of the image color recognition methods that Fig. 1 provides for the embodiment of the present invention.As shown in Figure 1, the image color recognition methods of the embodiment of the present invention comprises:
Step 101, carries out rim detection to pretreatment image, obtains edge pixel point.
For the imperceptible color of human eye, major part is all present in the marginal portion of image, therefore needs to detect that the edge pixel point of image is to carry out subsequent treatment.Image Edge-Detection is prior art, is not described in detail herein.
Before step 101, described method also comprises:
Image to be identified is carried out denoising, obtains pretreatment image.
In addition, the image after denoising can be converted to the image of rgb space.For image image to be identified being converted to rgb space, now from the identification degree of human eye, conversion before and after image completely as broad as long, the object of conversion to reduce the difficulty of computer recognizing color, make algorithm can in the space that color is less identification colors.
Step 102, determines first area according to described edge pixel point.
Particularly, centered by edge pixel point, the region around beyond presetted pixel number is defined as first area.
Such as, after edge pixel point being detected, centered by edge pixel point, getting presetted pixel number is 3, then the region of 3 × 3 pixels around edge pixel point is considered as edge pixel point region, the region beyond edge pixel point region is defined as first area, namely non-edge pixels point region.The RGB color value in edge pixel point region can be set to (255,255,255), be convenient to subsequent treatment non-edge pixels point.
After determining first area according to edge pixel point, described method also comprises:
The color value of all pixels and the pixel count of correspondence in statistics non-edge pixels point region, and from more to less color value is sorted according to pixel count, for four of rgb color space kinds of colors, as shown in table 1.
Color value | Pixel count |
RGB(255,123,44) | 198 |
RGB(4,113,54) | 122 |
RGB(34,223,144) | 34 |
RGB(67,123,87) | 33 |
Table 1
Step 103, calculates the distance of the color value of any two kinds of colors in described first area.
Such as, the color value of all colours of rgb space can be converted to the color value in LAB space, and then calculate the Euclidean distance of any two kinds of color values.After conversion, the pixel count of often kind of color is constant.LAB color space than rgb color space closer to human vision.Rgb color space calculates, the prerequisite of colour recognition can be met to greatest extent, namely identify the number of colours meeting eye recognition.
In non-edge pixels point region, according to the distance of the color value of any two kinds of colors in color value order computation LAB space from more to less.According to formula
according to the LAB value (L of any two kinds of colors in color value order computation first area from more to less
1 *, a
1 *, b
1 *) and (L
2 *, a
2 *, b
2 *) distance, wherein, L
1 *, a
1 *, b
1 *and L
1 *, a
1 *, b
1 *be respectively the value of three passages of the LAB color space of two kinds of colors.
It should be noted that, LAB, HSB; the color spaces such as YUV are all that human eye can the color space of perception; therefore in these spaces, calculate distance to weigh the close degree of color, be within scope, should do not think to depart from technological thought of the present invention.
Step 104, the two kinds of colors described distance being less than default first threshold are defined as one group of Similar color.
Such as, the first threshold preset is 0.004, as kind of the color (L of two on LAB color space
1 *, a
1 *, b
1 *) and (L
2 *, a
2 *, b
2 *) distance
Then (L
1 *, a
1 *, b
1 *) and (L
2 *, a
2 *, b
2 *) be one group of Similar color.
It should be noted that, utilize the color value in different color space to calculate distance, the predetermined threshold value weighing color similarity degree is different.
Step 105 is color of object by often organizing the more colour recognition of pixel count in Similar color.
Such as, the LAB value of one group of Similar color is respectively (L
1 *, a
1 *, b
1 *) and (L
2 *, a
2 *, b
2 *), corresponding pixel count is respectively c
1 *and c
2 *(c
1 *﹥ c
2 *), then the color of object finally identified is LAB value is (L
1 *, a
1 *, b
1 *) color.
Step 106, is set to the pixel count of described color of object by the pixel count sum often organizing Similar color.
As the example in step 105, the LAB value of the color of object finally identified is (L
1 *, a
1 *, b
1 *), pixel count is c
1 *+ c
2 *.
The image color recognition methods that the embodiment of the present invention provides, realize simple, color recognition precision is high, can meet the needs that printing cost is adjusted.
The schematic diagram of the image color recognition device that Fig. 2 provides for the embodiment of the present invention.As shown in Figure 2, the image color recognition device of the embodiment of the present invention comprises: detecting unit 201, first determining unit 202, computing unit 203, second determining unit 204, recognition unit 205 and setting unit 206.
Detecting unit 201, for carrying out rim detection to pretreatment image, obtains edge pixel point;
First determining unit 202, for determining first area according to described edge pixel point;
Computing unit 203, for calculating the distance of the color value of any two kinds of colors in described first area;
Second determining unit 204, is defined as one group of Similar color for the two kinds of colors described distance being less than default first threshold;
Recognition unit 205, for being color of object by often organizing the more colour recognition of pixel count in Similar color;
Setting unit 206, for being set to the pixel count of described color of object by the pixel count sum often organizing Similar color.
Alternatively, described device also comprises:
Pretreatment unit 207, carrying out preliminary treatment for treating recognition image, obtaining described pretreatment image.
Alternatively, the first determining unit 202 specifically for:
Centered by described edge pixel point, the region around beyond presetted pixel number is defined as first area.
Alternatively, described device also comprises:
Statistic unit 208, for adding up the color value of all pixels in described first area and corresponding pixel count, and sorts to color value from more to less according to pixel count.
Alternatively, described computing unit 203 specifically for:
Calculate the Euclidean distance of the color value of any two kinds of colors in described first area.
The device that the embodiment of the present application two provides implants the method that the embodiment of the present application one provides, and therefore, the specific works process of the device that the application provides, does not repeat again at this.
The image color recognition device that the embodiment of the present invention provides, realize simple, color recognition precision is high, can meet the needs that printing cost is adjusted.
Professional should recognize further, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe composition and the step of each example in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random asccess memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
Above-described embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only the specific embodiment of the present invention; the protection range be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (10)
1. an image color recognition methods, is characterized in that, described method comprises:
Rim detection is carried out to pretreatment image, obtains edge pixel point;
First area is determined according to described edge pixel point;
Calculate the distance of the color value of any two kinds of colors in described first area;
The two kinds of colors described distance being less than default first threshold are defined as one group of Similar color;
Be color of object by often organizing the more colour recognition of pixel count in Similar color;
The pixel count sum often organizing Similar color is set to the pixel count of described color of object.
2. image color recognition methods according to claim 1, is characterized in that, is carrying out rim detection to pretreatment image, and before obtaining edge pixel point, described method also comprises:
Treat recognition image and carry out preliminary treatment, obtain described pretreatment image.
3. image color recognition methods according to claim 1, is characterized in that, describedly determines that first area specifically comprises according to described edge pixel point:
Centered by described edge pixel point, the region around beyond presetted pixel number is defined as first area.
4. image color recognition methods according to claim 1, is characterized in that, after determining first area according to described edge pixel point, described method also comprises:
Add up the color value of all pixels in described first area and corresponding pixel count, and from more to less color value is sorted according to pixel count.
5. image color recognition methods according to claim 1, is characterized in that, in the described first area of described calculating, the distance of the color value of any two kinds of colors specifically comprises:
Calculate the Euclidean distance of the color value of any two kinds of colors in described first area.
6. an image color recognition device, is characterized in that, described device comprises:
Detecting unit, for carrying out rim detection to pretreatment image, obtains edge pixel point;
First determining unit, for determining first area according to described edge pixel point;
Computing unit, for calculating the distance of the color value of any two kinds of colors in described first area;
Second determining unit, is defined as one group of Similar color for the two kinds of colors described distance being less than default first threshold;
Recognition unit, for being color of object by often organizing the more colour recognition of pixel count in Similar color;
Setting unit, for being set to the pixel count of described color of object by the pixel count sum often organizing Similar color.
7. image color recognition device according to claim 6, is characterized in that, described device also comprises pretreatment unit, carrying out preliminary treatment, obtaining described pretreatment image for treating recognition image.
8. image color recognition device according to claim 6, is characterized in that, described first determining unit specifically for:
Centered by described edge pixel point, the region around beyond presetted pixel number is defined as first area.
9. image color recognition device according to claim 6, it is characterized in that, described device also comprises statistic unit, for adding up the color value of all pixels in described first area and corresponding pixel count, and sorts to color value from more to less according to pixel count.
10. image color recognition device according to claim 6, is characterized in that, described computing unit specifically for:
Calculate the Euclidean distance of the color value of any two kinds of colors in described first area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510846646.6A CN105430218B (en) | 2015-11-27 | 2015-11-27 | Image color recognition methods and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510846646.6A CN105430218B (en) | 2015-11-27 | 2015-11-27 | Image color recognition methods and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105430218A true CN105430218A (en) | 2016-03-23 |
CN105430218B CN105430218B (en) | 2018-07-24 |
Family
ID=55508143
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510846646.6A Expired - Fee Related CN105430218B (en) | 2015-11-27 | 2015-11-27 | Image color recognition methods and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105430218B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106057167A (en) * | 2016-07-21 | 2016-10-26 | 京东方科技集团股份有限公司 | Method and device for character edge darkening processing |
CN108460806A (en) * | 2018-02-09 | 2018-08-28 | 西京学院 | A kind of metal parts surface color visible detection method |
CN109800772A (en) * | 2019-01-30 | 2019-05-24 | 广州市载道信息科技有限公司 | A kind of data identification method |
CN109856051A (en) * | 2019-01-30 | 2019-06-07 | 广州市载道信息科技有限公司 | A kind of image color acquisition device |
CN110335257A (en) * | 2019-06-20 | 2019-10-15 | 东莞理工学院 | A kind of image color detection method and mobile terminal |
CN110458173A (en) * | 2019-08-16 | 2019-11-15 | 京东数字科技控股有限公司 | Method and apparatus for generating article color value |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1234569A (en) * | 1998-02-06 | 1999-11-10 | 富士通株式会社 | Apparatus of treating colour pictures and pattern extracting device |
CN102096822A (en) * | 2010-12-24 | 2011-06-15 | 华为终端有限公司 | Color discrimination method and device |
CN102473278A (en) * | 2009-07-01 | 2012-05-23 | 佳能株式会社 | Image processing apparatus, image processing method, and storage medium |
CN104091353A (en) * | 2014-06-20 | 2014-10-08 | 浙江大学 | Method for extracting image color labels |
-
2015
- 2015-11-27 CN CN201510846646.6A patent/CN105430218B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1234569A (en) * | 1998-02-06 | 1999-11-10 | 富士通株式会社 | Apparatus of treating colour pictures and pattern extracting device |
CN102473278A (en) * | 2009-07-01 | 2012-05-23 | 佳能株式会社 | Image processing apparatus, image processing method, and storage medium |
CN102096822A (en) * | 2010-12-24 | 2011-06-15 | 华为终端有限公司 | Color discrimination method and device |
CN104091353A (en) * | 2014-06-20 | 2014-10-08 | 浙江大学 | Method for extracting image color labels |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106057167A (en) * | 2016-07-21 | 2016-10-26 | 京东方科技集团股份有限公司 | Method and device for character edge darkening processing |
CN106057167B (en) * | 2016-07-21 | 2019-04-05 | 京东方科技集团股份有限公司 | A kind of method and device of pair of edge darkening processing of text |
CN108460806A (en) * | 2018-02-09 | 2018-08-28 | 西京学院 | A kind of metal parts surface color visible detection method |
CN109800772A (en) * | 2019-01-30 | 2019-05-24 | 广州市载道信息科技有限公司 | A kind of data identification method |
CN109856051A (en) * | 2019-01-30 | 2019-06-07 | 广州市载道信息科技有限公司 | A kind of image color acquisition device |
CN110335257A (en) * | 2019-06-20 | 2019-10-15 | 东莞理工学院 | A kind of image color detection method and mobile terminal |
CN110458173A (en) * | 2019-08-16 | 2019-11-15 | 京东数字科技控股有限公司 | Method and apparatus for generating article color value |
Also Published As
Publication number | Publication date |
---|---|
CN105430218B (en) | 2018-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105430218A (en) | Image color recognition method and device | |
CN106096610B (en) | A kind of file and picture binary coding method based on support vector machines | |
US9251614B1 (en) | Background removal for document images | |
CN108509992B (en) | Seal imprint intelligent identification anti-counterfeiting method based on machine learning technology | |
CN104156921A (en) | Self-adaptive low-illuminance or non-uniform-brightness image enhancement method | |
CN109993161B (en) | Text image rotation correction method and system | |
CN109886914B (en) | Paper defect detection method based on local brightness invariance prior | |
CN107358184A (en) | The extracting method and extraction element of document word | |
CN105320970A (en) | Potato disease diagnostic device, diagnostic system and diagnostic method | |
CN107944252B (en) | Method for extracting uniqueness characteristic of seal impression of information seal | |
CN107451987B (en) | System and method for detection and removal of thin lines in a graphical image | |
Shobha Rani et al. | Restoration of deteriorated text sections in ancient document images using atri-level semi-adaptive thresholding technique | |
CN117830315A (en) | Real-time monitoring method and system for printing machine based on image processing | |
CN110991318A (en) | Method and system for identifying color laser printing file secret mark | |
CN111890781B (en) | Printing plate manufacturing process | |
Pfeifer et al. | Detection of commercial offset printing in counterfeited banknotes | |
CN107766014A (en) | Word information process method and device | |
CN103604754B (en) | A kind of measuring method of character ink color of newspaper printing | |
US8068669B2 (en) | Text and graphic separation method and text enhancement method | |
CN111047669B (en) | Color taking method and device | |
CN106408021B (en) | Handwriting and print form identification method based on stroke thickness | |
CN105718933A (en) | Edge detection method and edge detection device | |
CN112633289A (en) | Method and system for segmenting sticky characters | |
US20160110319A1 (en) | URI Font in print material processing method and apparatus thereof | |
CN105741283A (en) | Computer color contrast quantitative evaluation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180724 Termination date: 20181127 |