CN105740860A - Automatic detection method for Chinese character area of shop sign in natural scene - Google Patents

Automatic detection method for Chinese character area of shop sign in natural scene Download PDF

Info

Publication number
CN105740860A
CN105740860A CN201610059409.XA CN201610059409A CN105740860A CN 105740860 A CN105740860 A CN 105740860A CN 201610059409 A CN201610059409 A CN 201610059409A CN 105740860 A CN105740860 A CN 105740860A
Authority
CN
China
Prior art keywords
binary map
minimum enclosed
enclosed rectangle
connected domain
value
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
Application number
CN201610059409.XA
Other languages
Chinese (zh)
Other versions
CN105740860B (en
Inventor
张重生
赵晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan University
Original Assignee
Henan University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Henan University filed Critical Henan University
Priority to CN201610059409.XA priority Critical patent/CN105740860B/en
Publication of CN105740860A publication Critical patent/CN105740860A/en
Application granted granted Critical
Publication of CN105740860B publication Critical patent/CN105740860B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an automatic detection method for a Chinese character area of a shop sign in a natural scene. The automatic detection method comprises the following steps of: A, acquiring vectors V1 and V2 which reflect main pixel colors of a sampling region image; B, determining a background outline of an original image by using the vectors V1 and V2; C, dividing an HSV (Hue, Saturation and Value) color space into eight color spaces including black, white, red, yellow, green, cyan, blue and fuchsine; C, carrying out color separation on an original image to obtain eight color distribution binary images; carrying out Chinese character connected area analysis on the eight color distribution binary images to obtain eight text line binary images; F, filtering text lines, which do not conform to a Chinese character writing rule, in each text line binary image to obtain refined Chinese character areas; G, mixing the refined Chinese character areas of different colors to obtain a Chinese character area of the original image. By using the automatic detection method for the Chinese character area of the shop sign in the natural scene, the detection accuracy of the Chinese character area can be efficiently improved, the automatic detection method has significant importance for application of Chinese character recognition in the natural scene.

Description

Retail shop's label Chinese character region automatic testing method in natural scene
Technical field
The present invention relates to the technical field of image processing under natural scene, particularly relate to retail shop's label Chinese character region automatic testing method in a kind of natural scene.
Background technology
In recent years, along with popularizing of smart machine, people can shoot various picture easily in natural scene.Word in picture is the important information that image comprises, thus the word in image is detected and then accurately identified, and is remarkably contributing to the understanding to picture material.Although existing OCR character recognition technology has tended to ripe, but owing to the shooting under natural scene would be likely to occur uneven illumination, the angle not just and serious series of problems such as reflective, the picture background simultaneously shot is complicated, usually contain multiple fonts, font size even deformed letters so that the text detection under natural scene is not reached desirable effect by OCR.
Summary of the invention
It is an object of the invention to provide retail shop's label Chinese character region automatic testing method in a kind of natural scene, it is possible to the accurately Chinese character region on retail shop's label in detection natural scene, improve the efficiency that street view image is carried out automatic marking and image understanding.
For achieving the above object, the technical solution used in the present invention is:
Retail shop's label Chinese character region automatic testing method in natural scene, comprises the following steps:
Retail shop's label in A, scanning natural scene obtains original image, the sample region image of rectangle is intercepted from original image, and the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, respectively every a line of matrix is carried out Kmeans cluster as a three-dimensional point, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2, subsequently into step B;
B, calculate each pixel of original image distance to vector V1 and V2 respectively, and create two initialization binary map bg1s identical with original image size and bg2, initialize the pixel value of all pixels in binary map bg1 and bg2 and be 0, setpoint distance threshold X, compare the magnitude relationship of each pixel of original image distance to vector V1 and X successively, when original image pixel to vector V1 distance less than X time, in initializing binary map bg1, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtains coarse contour binary map BG1;Compare the magnitude relationship of each pixel of original image distance to vector V2 and X successively, when original image pixel to vector V2 distance less than X time, in initializing binary map bg2, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtain coarse contour binary map BG2, respectively coarse contour binary map BG1 and BG2 done Morphological scale-space and carry out connected domain analysis, from coarse contour binary map BG1 and BG2, select after the maximum connected domain of area carries out repairing and fill profile as a setting, obtain background profile binary map;
C, hsv color space being divided into black, white, redness, yellow, green, cyan, blueness, pinkish red eight pieces of color spaces, the division rule of eight pieces of color spaces is as follows:
Black space, v < 0.3or (v < 0.5ands≤0.25);
White space, v >=0.5ands≤0.25;
Red space, (h<1/12orh>=11/12) andv>0.3ands>=0.25;
Yellow space, h>=1/12andh<3/12andv>0.3ands>=0.25;
Vert space, h>=3/12andh<5/12andv>0.3ands>=0.25;
Cyan space, h>=5/12andh<7/12andv>0.3ands>=0.25;
Blue color space, h>=7/12andh<9/12andv>0.3ands>=0.25;
Pinkish red space, h>=9/12andh<11/12andv>0.3ands>=0.25;
In formula, h represents the tone in hsv color space, and the saturation in behalf hsv color space, v represents the lightness in hsv color space, subsequently into step D;
D, 8 binary map identical with original image size of establishment, and the pixel value of pixels all in every binary map is set to 0, original image is transformed into hsv color space from rgb space, then the color type belonging to each pixel of original image in hsv color space is judged, the all pixels belonging to same color type are mapped to the corresponding position of a binary map, and the pixel value of the pixel of corresponding position in binary map is set to 1, finally obtain 8 distribution of color binary map, subsequently into step E;
nullE、8 distribution of color binary map are done with background profile binary map respectively with computing after carry out Morphological scale-space again,Filter the tiny gully in 8 distribution of color binary map and fine rule,Obtain 8 thin contoured profile binary map,Respectively 8 thin contoured profile binary map are carried out connected domain scanning,Eight connectivity labelling method is utilized to obtain the labelling figure that connected graph is corresponding,And calculate the attribute of each connected domain,Then the connected domain not meeting Chinese-character stroke feature in 8 thin contoured profile binary map is filtered,Obtain 8 stroke level distribution binary map,Respectively each stroke level is distributed the connected domain meeting Chinese-character stroke feature in binary map to merge,Multiple connected domains after merging are designated as a marked region and determine mark value,For any two marked region,If the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region,Then the mark value of this marked region is set to the mark value of another marked region,It is distributed binary map finally for each stroke level,Successively marked region identical for mark value is designated as a line of text,Obtain 8 line of text binary map,Subsequently into step F;
F, for any one line of text in 8 line of text binary map, when line of text minimum enclosed rectangle height less than background profile minimum enclosed rectangle height 1/20, the ratio of width to height of the minimum enclosed rectangle of line of text less than 7/10 or the area ratio of the area of line of text and its minimum enclosed rectangle less than 1/10 or more than 4/5 time, this article one's own profession is deleted corresponding line of text binary map, 8 the character picture binary map obtained, calculate respectively in each character picture binary map the area of all line of text and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, and calculate the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively, subsequently into step G;
G, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, respectively primary being identified, the border being made up of two or more minimum enclosed rectangle in image is that the isolated area of irregular polygon is as an identification region, region is identified for each, add up the coordinate on each summit, and the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates as establishment rectangular area, summit, then identify all rectangular areas obtained region and the primary Chinese character region identifying that in image, the region of remaining minimum enclosed rectangle composition is in original image from each.
Described step A comprises the following steps:
Retail shop's label in A1, scanning natural scene obtains original image, on scanning line more than 1/3 length less than the section of 2/3 length in appoint and take a bit as basic point, centered by this basic point, point builds the rectangularly-sampled district of a R*kR, wherein R is the width in rectangularly-sampled district, the value of R is more than the 1/7 of original image width, less than original image width 1/4, k is the ratio of width to height in rectangularly-sampled district, the span of k is 1/4 < k < 4, cutting rectangularly-sampled district from original image, obtain sample region image, subsequently into step A2;
A2, the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, using every a line of matrix as a three-dimensional point, adopt Euclidean distance to carry out Kmeans cluster, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2.
Described step B comprises the following steps:
B1, each pixel in original image is labeled as 1 successively, 2, ..., n, n is the number of pixel in original image, calculate Euclidean distance L1 (x) and the L2 (x) of the pixel x and vector V1 and V2 of original image, wherein x=1,2 ..., n, subsequently into step B2;
B2, create two initialization binary map bg1s identical with original image size and bg2, and the pixel value of all pixels in two initialization binary map bg1 and bg2 is set to 0, setpoint distance threshold X, as Euclidean distance L1 (x) the < X of the pixel x and vector V1 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg1 is set to 1, obtain coarse contour binary map BG1, as Euclidean distance L2 (x) the < X of the pixel x and vector V2 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg2 is set to 1, obtain coarse contour binary map BG2, subsequently into step B3;
B3, respectively coarse contour binary map BG1 and BG2 is done Morphological scale-space, namely first pass through erosion operation and remove the fine rule of coarse contour binary map BG1 and BG2, then pass through dilation operation and the tiny gully of closed operation removal coarse contour binary map BG1 and BG2, finally coarse contour binary map BG1 and BG2 is carried out connected domain analysis, area maximum connected domain profile as a setting is selected, subsequently into step B4 from coarse contour binary map BG1 and BG2;
B4, the hole filled in background profile, and repair the depression on background profile edge, obtain background profile binary map.
Described step E comprises the following steps:
E1,8 distribution of color binary map are done and computing with background profile binary map respectively, obtain 8 coarse contours distribution binary map, subsequently into step E2;
E2, respectively 8 coarse contours are distributed binary map and do Morphological scale-space, namely each coarse contour binary map is done in vertically and horizontally both direction closed operation and the opening operation of 7 pixels, filter tiny gully and fine rule, obtain 8 thin contoured profile binary map, subsequently into step E3;
E3, respectively 8 thin contoured profile binary map are carried out 8 connected domain scannings, and calculate the area of each connected domain, center-of-mass coordinate and minimum enclosed rectangle in each thin contoured profile binary map, subsequently into step E4;
E4, for any one connected domain in each thin contoured profile binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this connected domain is set to 0, obtain 8 stroke level distribution binary map, subsequently into step E5, wherein three filterconditions are respectively as follows:
A, the area of connected domain and the area ratio of its minimum enclosed rectangle are less than 1/5;
B, connected domain minimum enclosed rectangle width less than original image width 1/200 or more than the 1/2 of original image width;
C, connected domain the ratio of width to height of minimum enclosed rectangle less than 1/10 or more than 10;
E5,8 stroke levels distribution binary map for obtaining, be distributed binary map to each stroke level and be all handled as follows:
E5-1, each connected domain that stroke level is distributed in binary map is labeled as C successively1, C2..., Ci, i is the number of connected domain in stroke level distribution binary map, respectively by C1, C2..., CiMark value be set to respective subscript value, i.e. C1Mark value be 1, C2Mark value be 2, by that analogy, CiMark value be i, and define independent communication territory set P, independent communication territory set P in initial connected domain number be 0;
E5-2, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of ordinates, obtain two vertical projection line segments, definition disH is the overlap length between two vertical projection line segments, and specifies that disH value is 0 when two vertical projection line segments do not have overlap, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of abscissas, obtain two floor projection line segments, definition dis is the beeline between two floor projection line segments, when two floor projection line segments adjacent or overlapping time dis value be 0, when two floor projection line segments do not have overlap, dis value is that the right endpoint of left side floor projection line segment is to the distance between the left end point of right side floor projection line segment;
E5-3, definition avgW are character mean breadth, and the initial value of avgW is C1The width of minimum enclosed rectangle, definition sum is character row overall width, and the initial value of sum is avgW, and definition cnt is enumerator, and the initial value of cnt is 1;
Choose C1And C2Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C2In the pixel value of all pixels be set to 0, and by C2Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C2Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C2Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C2The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C2Put in independent communication territory set P;
Choose C1And C3Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C3In the pixel value of all pixels be set to 0, and by C3Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C3Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C3Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C3The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C3Put in independent communication territory set P;
By that analogy, until choosing C1And CiTwo vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by CiIn the pixel value of all pixels be set to 0, and by CiMark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And CiTwo floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by CiMark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds CiThe width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by CiPut in independent communication territory set P, subsequently into step E5-4;
Connected domain number in E5-4, statistical iteration connected domain set P, when the connected domain number in P is gathered be more than or equal to 2 in independent communication territory, enters step E5-5, when the connected domain number in independent communication territory set P is 0 or 1, enters step E5-7;E5-5, multiple connected domains that independent communication territory is gathered in P are all taken out, independent communication territory set P is made to become empty set, then the multiple connected domains taken out are arranged in order from small to large according to subscript size, definition avgW is character mean breadth, the initial value of avgW is the width of the minimum enclosed rectangle of first connected domain, and definition sum is character row overall width, and the initial value of sum is avgW, definition cnt is enumerator, and the initial value of cnt is 1;
nullChoose two vertical projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in second connected domain is set to 0,And the mark value of second connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of second connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of second connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Second connected domain is put in independent communication territory set P;
nullChoose two articles of vertical projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in 3rd connected domain is set to 0,And the mark value of the 3rd connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two articles of floor projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of the 3rd connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of the 3rd connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,3rd connected domain is put in independent communication territory set P;
nullBy that analogy,Until two vertical projection line segments that the minimum enclosed rectangle choosing first connected domain and last connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of pixels all in last connected domain is set to 0,And the mark value of last connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and last connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of last connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of last connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Last connected domain is put in independent communication territory set P,Subsequently into step E5-6;
E5-6, according to the method in step E5-5 to independent communication territory gather P be repeated process, until independent communication territory set P in connected domain number be 0 or 1, subsequently into step E5-7;
E5-7, successively stroke level is distributed the connected domain that mark value is identical in binary map and is designated as a marked region, and using the mark value of the connected domain mark value as this marked region, then the area of each marked region, center-of-mass coordinate and minimum enclosed rectangle are calculated respectively, subsequently into step E6;
E6,8 stroke levels distribution binary map that step E5 is obtained, each stroke level is distributed binary map be all handled as follows: E6-1, for any two marked region, if the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region, then the mark value of this marked region is set to the mark value of another marked region, subsequently into step E6-2;
E6-2, successively stroke level is distributed the marked region that mark value is identical in binary map and is designated as a line of text, then calculate each line of text width, highly, area and minimum enclosed rectangle, it is thus achieved that line of text binary map.
Described step F comprises the following steps:
F1, for 8 the line of text binary map obtained, for any one line of text in each line of text binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this article one's own profession is set to 0, obtain 8 candidate image binary map, subsequently into step F2, wherein three filterconditions are respectively as follows:
D, line of text height less than background profile minimum enclosed rectangle height 1/20;
E, line of text the ratio of width to height less than 7/10;
F, the area of line of text and the area ratio of its minimum enclosed rectangle are less than 1/10 or more than 4/5;
F2, for 8 the candidate image binary map obtained, for any one line of text in each candidate image binary map, when its at least one meeting in following two filterconditions, the pixel value of all pixels in this article one's own profession is set to 0, obtain 8 character picture binary map, subsequently into step F3, two of which filtercondition is respectively as follows:
G, to the minimum enclosed rectangle of line of text by row summation, obtain a series of row projection value, row projection value exceedes 0.7 times more than minimum enclosed rectangle height of the continuous columns of the 70% of minimum enclosed rectangle height;
H, line of text area less than background profile binary map minimum enclosed rectangle area 1/1000;
F3, for 8 the character picture binary map obtained, first calculate successively all connected domains forming each line of text in each character picture binary map area and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, then calculates the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively.
Described step G comprises the following steps:
G1, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, primary is identified, and the minimum enclosed rectangle in image is labeled as R successively1, R2..., Rj, j is the primary number of minimum enclosed rectangle in image that identifies, and calculates the centre coordinate of each minimum enclosed rectangle, subsequently into step G2;
G2, judge R successively2, R3..., RjCenter and R1Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R1Internal or borderline all minimum enclosed rectangle, put into R1Merge in set;
Judge R successively1, R3..., RjCenter and R2Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R2Internal or borderline all minimum enclosed rectangle, put into R2Merge in set;
By that analogy, until judging R successively1, R2..., Rj-1Center and RjPosition relationship, from R1, R2..., RjMiddle Selection Center is positioned at RjInternal or borderline all minimum enclosed rectangle, put into RjMerge in set, subsequently into step G3;
G3, to R1Merge set, R2Merge set ..., RjMerge set and carry out condition merging, comprise the following steps:
G3-1, compare R1Merge set and R2Merge set, work as R2Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R2Merge set and seek union, work as R2Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R2Merge set to put in isolated area set Q;
Relatively R1Merge set and R3Merge set, work as R3Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R3Merge set and seek union, work as R3Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R3Merge set to put in isolated area set Q;
By that analogy, until comparing R1Merge set and RjMerge set, work as RjMerge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and RjMerge set and seek union, work as RjMerge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by RjMerge set and put in isolated area set Q, subsequently into step G3-2;
Merging set number in G3-2, statistical iteration regional ensemble Q, when the merging set number in isolated area set Q is be more than or equal to 2, enter step G3-3, when the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, enter step G4.
G3-3, multiple merging in isolated area set Q is gathered all taking-ups, isolated area set Q is made to become empty set, then the multiple merging set taken out are arranged in order from small to large according to subscript size, relatively first merges set and second merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for second, first is merged set and union is sought in second merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for second, merge set by second to put in isolated area set Q;
Relatively first merges set and the 3rd merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for the 3rd, first is merged set and union is sought in the 3rd merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for the 3rd, merge set by the 3rd and put in isolated area set Q;By that analogy, until comparing first to merge set and last merging set, when last merges at least one minimum enclosed rectangle that set comprises in first merging set, first is merged set and last merges set and seeks union, when last merges any one minimum enclosed rectangle that set does not comprise in first merging set, last is merged set and puts in isolated area set Q, subsequently into step G3-4.
G3-4, it is repeated isolated area set Q processing according to the method in step G3-3, until the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, subsequently into step G4.
G4, each union obtained in step G3 all being processed as follows, add up one and concentrate the apex coordinate of all minimum enclosed rectangle, the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates are as establishment rectangular area, summit, then from each and concentrate the Chinese character region that all rectangular areas obtained are original image.
The present invention realizes the detection to retail shop's label background profile by scanning line sampling and Kmeans cluster, is conducive to being accurately positioned retail shop's label in natural scene, it is to avoid the interference of other complex backgrounds;The present invention utilizes hsv color space to divide the colo(u)r breakup realized retail shop's label Chinese character foreground, it is possible to ensures the Chinese character region of different colours on complete detection retail shop label, reduces the misclassification rate of Chinese character detection;The present invention is by filtering the analysis of each layer of Chinese character foreground, it is achieved to the detection of shades of colour Chinese character in retail shop's label, eventually through integrating each layer Chinese character region, it is achieved to the automatic detection in retail shop's label Chinese character region in natural scene.The present invention can be effectively improved the accuracy of Chinese character region detection, and the application based on the Chinese Character Recognition under natural scene is significant.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the present invention;
Fig. 2 is black and white division schematic diagram during hsv color space of the present invention divides;
Fig. 3 is the division schematic diagram of other colors during hsv color space of the present invention divides;
Fig. 4 is the original image scanned under natural scene in the embodiment of the present invention;
Fig. 5 is the area schematic of plate with trademark background profile in the embodiment of the present invention.
Detailed description of the invention
As it is shown in figure 1, retail shop's label Chinese character region automatic testing method in a kind of natural scene of the present invention, comprise the following steps:
Retail shop's label in A, scanning natural scene obtains original image, the sample region image of rectangle is intercepted from original image, and the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, respectively every a line of matrix is carried out Kmeans cluster as a three-dimensional point, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2, subsequently into step B.
In order to ensure that vector V1 and V2 can reflect the main pixel distribution of sample region image, step A can be divided into following two steps;
Retail shop's label in A1, scanning natural scene obtains original image, on scanning line more than 1/3 length less than the section of 2/3 length in appoint and take a bit as basic point, centered by this basic point, point builds the rectangularly-sampled district of a R*kR, wherein R is the width in rectangularly-sampled district, and the value of R is more than the 1/7 of original image width, less than the 1/4 of original image width, k is the ratio of width to height in rectangularly-sampled district, the span of k is 1/4 < k < 4, cutting rectangularly-sampled district from original image, it is thus achieved that sample region image.Wherein, the restriction of rectangularly-sampled zone position and size be ensure that the main contents of original image are contained in rectangularly-sampled district, it is to avoid the missing inspection to different colours Chinese character region.
A2, the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, and N is the height of sample region image, using every a line of matrix as a three-dimensional point, Euclidean distance is adopted to carry out Kmeans cluster, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2, vector V1 and V2 reflects the main pixel distribution of sample region image, for the identification of retail shop's label background profile in natural scene.
B, calculate each pixel of original image distance to vector V1 and V2 respectively, and create two initialization binary map bg1s identical with original image size and bg2, initialize the pixel value of all pixels in binary map bg1 and bg2 and be 0, setpoint distance threshold X, compare the magnitude relationship of each pixel of original image distance to vector V1 and X successively, when original image pixel to vector V1 distance less than X time, in initializing binary map bg1, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtains coarse contour binary map BG1;Compare the magnitude relationship of each pixel of original image distance to vector V2 and X successively, when original image pixel to vector V2 distance less than X time, in initializing binary map bg2, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtain coarse contour binary map BG2, connected domain analysis is carried out after respectively coarse contour binary map BG1 and BG2 being done Morphological scale-space, from coarse contour binary map BG1 and BG2, select the maximum connected domain of area carry out repairing and filling, obtain background profile binary map.
Step B is the detection to original image background profile, for enabling the background profile binary map obtained fully to reflect the scope of retail shop's label, can be classified as following steps:
B1, each pixel in original image is labeled as 1,2 successively ..., n, n is the number of pixel in original image, calculates Euclidean distance L1 (x) and the L2 (x), wherein x=1 of the pixel x and vector V1 and V2 of original image, 2 ..., n.
B2, create two initialization binary map bg1s identical with original image size and bg2, and the pixel value of all pixels in two initialization binary map bg1 and bg2 is set to 0, setpoint distance threshold X, the span of X should be empirically determined in conjunction with L1 (x) and L2 (x), as Euclidean distance L1 (x) the < X of the pixel x and vector V1 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg1 is set to 1, obtain coarse contour binary map BG1, as Euclidean distance L2 (x) the < X of the pixel x and vector V2 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg2 is set to 1, obtain coarse contour binary map BG2.
B3, respectively coarse contour binary map BG1 and BG2 is done Morphological scale-space, namely first pass through erosion operation and remove the fine rule of coarse contour binary map BG1 and BG2, then pass through dilation operation and the tiny gully of closed operation removal coarse contour binary map BG1 and BG2, finally coarse contour binary map BG1 and BG2 is carried out connected domain analysis, from coarse contour binary map BG1 and BG2, select area maximum connected domain profile as a setting.
B4, the hole filled in background profile, and repair the depression on background profile edge, obtain background profile binary map.
C, hsv color space being divided into black, white, redness, yellow, green, cyan, blueness, pinkish red eight pieces of color spaces, the division rule of eight pieces of color spaces is as follows:
Black space, v < 0.3or (v < 0.5ands≤0.25);
White space, v >=0.5ands≤0.25;
Red space, (h<1/12orh>=11/12) andv>0.3ands>=0.25;
Yellow space, h>=1/12andh<3/12andv>0.3ands>=0.25;
Vert space, h>=3/12andh<5/12andv>0.3ands>=0.25;
Cyan space, h>=5/12andh<7/12andv>0.3ands>=0.25;
Blue color space, h>=7/12andh<9/12andv>0.3ands>=0.25;
Pinkish red space, h>=9/12andh<11/12andv>0.3ands>=0.25;
In formula, h represents the tone in hsv color space, and the saturation in behalf hsv color space, v represents the lightness in hsv color space, subsequently into step D.Hsv color space can reflect the human eye perception to color well, according to above-mentioned division rule, hsv color space is divided, it is possible to the shades of colour in reflection natural scene comprehensively.Fig. 2 is black and white division schematic diagram during hsv color space of the present invention divides, and Fig. 3 is the division schematic diagram of other colors during hsv color space of the present invention divides.
D, 8 binary map identical with original image size of establishment, and the pixel value of pixels all in every binary map is set to 0, original image is transformed into hsv color space from rgb space, then the color type belonging to each pixel of original image in hsv color space is judged, the all pixels belonging to same color type are mapped to the corresponding position of a binary map, and the pixel value of the pixel of the corresponding position of binary map is set to 1, finally obtain 8 distribution of color binary map, subsequently into step E.
nullE、8 distribution of color binary map are done with background profile binary map respectively with computing after carry out Morphological scale-space again,Filter the tiny gully in 8 distribution of color binary map and fine rule,Obtain 8 thin contoured profile binary map,Respectively 8 thin contoured profile binary map are carried out connected domain scanning,Eight connectivity labelling method is utilized to obtain the labelling figure that connected graph is corresponding,And calculate the attribute of each connected domain,Then the connected domain not meeting Chinese-character stroke feature in 8 thin contoured profile binary map is filtered,Obtain 8 stroke level distribution binary map,Respectively each stroke level is distributed the connected domain meeting Chinese-character stroke feature in binary map to merge,Multiple connected domains after merging are designated as a marked region and determine mark value,For any two marked region,If the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region,Then the mark value of this marked region is set to the mark value of another marked region,It is distributed binary map finally for each stroke level,Successively marked region identical for mark value is designated as a line of text,Obtain 8 line of text binary map,Subsequently into step F.
Each connected domain reflection in 8 distribution of color binary map is each stroke forming Chinese character, by the connected domain not meeting stroke feature in each distribution of color binary map is filtered, and the connected domain meeting stroke feature is merged, obtain 8 line of text binary map, specifically include following steps:
E1,8 distribution of color binary map are done and computing with background profile binary map respectively, obtain 8 coarse contours distribution binary map.
E2, respectively 8 coarse contours are distributed binary map and do Morphological scale-space, namely each coarse contour binary map is done in vertically and horizontally both direction closed operation and the opening operation of 7 pixels, filters tiny gully and fine rule, obtain 8 thin contoured profile binary map.
E3, respectively 8 thin contoured profile binary map are carried out 8 connected domain scannings, and calculate the area of each connected domain, center-of-mass coordinate and minimum enclosed rectangle in each thin contoured profile binary map.
E4, for any one connected domain in each thin contoured profile binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this connected domain being set to 0, obtains 8 stroke level distribution binary map, wherein three filterconditions are respectively as follows:
A, the area of connected domain and the area ratio of its minimum enclosed rectangle are less than 1/5;
B, connected domain minimum enclosed rectangle width less than original image width 1/200 or more than the 1/2 of original image width;
C, connected domain the ratio of width to height of minimum enclosed rectangle less than 1/10 or more than 10.
E5,8 the stroke levels distribution binary map obtained for step E4, be distributed binary map to each stroke level and be all handled as follows:
E5-1, each connected domain that stroke level is distributed in binary map is labeled as C successively1, C2..., Ci, i is the number of connected domain in stroke level distribution binary map, respectively by C1, C2..., CiMark value be set to respective subscript value, i.e. C1Mark value be 1, C2Mark value be 2, by that analogy, CiMark value be i, and define independent communication territory set P, independent communication territory set P in initial connected domain number be 0.
E5-2, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of ordinates, obtain two vertical projection line segments, definition disH is the overlap length between two vertical projection line segments, and specifies that disH value is 0 when two vertical projection line segments do not have overlap, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of abscissas, obtain two floor projection line segments, definition dis is the beeline between two floor projection line segments, when two floor projection line segments adjacent or overlapping time dis value be 0, when two floor projection line segments do not have overlap, dis value is that the right endpoint of left side floor projection line segment is to the distance between the left end point of right side floor projection line segment.
E5-3, definition avgW are character mean breadth, and the initial value of avgW is C1The width of minimum enclosed rectangle, definition sum is character row overall width, and the initial value of sum is avgW, and definition cnt is enumerator, and the initial value of cnt is 1;
Choose C1And C2Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C2In the pixel value of all pixels be set to 0, and by C2Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C2Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C2Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C2The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C2Put in independent communication territory set P;
Choose C1And C3Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C3In the pixel value of all pixels be set to 0, and by C3Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C3Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C3Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C3The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C3Put in independent communication territory set P;
By that analogy, until choosing C1And CiTwo vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by CiIn the pixel value of all pixels be set to 0, and by CiMark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And CiTwo floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by CiMark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds CiThe width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by CiPut in independent communication territory set P, subsequently into step E5-4.
Connected domain number in E5-4, statistical iteration connected domain set P, when the connected domain number in P is gathered be more than or equal to 2 in independent communication territory, enters step E5-5, when the connected domain number in independent communication territory set P is 0 or 1, enters step E5-7.
E5-5, multiple connected domains that independent communication territory is gathered in P are all taken out, independent communication territory set P is made to become empty set, then the multiple connected domains taken out are arranged in order from small to large according to subscript size, definition avgW is character mean breadth, the initial value of avgW is the width of the minimum enclosed rectangle of first connected domain, and definition sum is character row overall width, and the initial value of sum is avgW, definition cnt is enumerator, and the initial value of cnt is 1;
nullChoose two vertical projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in second connected domain is set to 0,And the mark value of second connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of second connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of second connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Second connected domain is put in independent communication territory set P;
nullChoose two articles of vertical projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in 3rd connected domain is set to 0,And the mark value of the 3rd connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two articles of floor projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of the 3rd connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of the 3rd connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,3rd connected domain is put in independent communication territory set P;
nullBy that analogy,Until two vertical projection line segments that the minimum enclosed rectangle choosing first connected domain and last connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of pixels all in last connected domain is set to 0,And the mark value of last connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and last connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of last connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of last connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Last connected domain is put in independent communication territory set P,Subsequently into step E5-6;
E5-6, according to the method in step E5-5 to independent communication territory gather P be repeated process, until independent communication territory set P in connected domain number be 0 or 1, subsequently into step E5-7.
E5-7, successively stroke level is distributed the connected domain that mark value is identical in binary map and is designated as a marked region, and using the mark value of the connected domain mark value as this marked region, then the area of each marked region, center-of-mass coordinate and minimum enclosed rectangle are calculated respectively, subsequently into step E6.
E6,8 stroke levels distribution binary map that step E5 is obtained, each stroke level is distributed binary map be all handled as follows: E6-1, for any two marked region, if the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region, then the mark value of this marked region is set to the mark value of another marked region, subsequently into step E6-2.
E6-2, successively stroke level is distributed the marked region that mark value is identical in binary map and is designated as a line of text, then calculate each line of text width, highly, area and minimum enclosed rectangle, it is thus achieved that line of text binary map.
F, for any one line of text in 8 line of text binary map, when line of text minimum enclosed rectangle height less than background profile minimum enclosed rectangle height 1/20, the ratio of width to height of the minimum enclosed rectangle of line of text less than 7/10 or the area ratio of the area of line of text and its minimum enclosed rectangle less than 1/10 or more than 4/5 time, this article one's own profession is deleted corresponding line of text binary map, 8 the character picture binary map obtained, calculate respectively in each character picture binary map the area of all line of text and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, and calculate the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively, subsequently into step G.
What each line of text in 8 line of text binary map reflected is the Chinese character region of different colours in retail shop's label, by the line of text not meeting Chinese-character writing rule in each line of text binary map is filtered, Chinese character region after being refined, specifically includes following steps:
F1, for 8 the line of text binary map obtained, for any one line of text in each line of text binary map, when its at least one meeting in following three filtercondition, the mark value of all pixels of each connected domain in this article one's own profession is set to 0, obtaining 8 candidate image binary map, wherein three filterconditions are respectively as follows:
D, height less than background profile minimum enclosed rectangle height 1/20;
E, one's own profession the ratio of width to height less than 7/10;
F, the area ratio of area and its minimum enclosed rectangle less than 1/10 or more than 4/5.
F2, for 8 the candidate image binary map obtained, for any one line of text in each candidate image binary map, when its at least one meeting in following two filterconditions, the mark value of all pixels of each connected domain in this article one's own profession is set to 0, obtaining 8 character picture binary map, two of which filtercondition is respectively as follows:
G, to the minimum enclosed rectangle region of line of text by row summation, obtain a series of row projection value, row projection value exceedes 0.7 times more than minimum enclosed rectangle height of the continuous columns of the 70% of minimum enclosed rectangle height;
H, line of text area less than background profile binary map minimum enclosed rectangle area 1/1000.
F3, for 8 the character picture binary map obtained, first calculate successively all connected domains forming each line of text in each character picture binary map area and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, then calculates the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively.
G, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, respectively primary being identified, the border being made up of two or more minimum enclosed rectangle in image is that the isolated area of irregular polygon is as an identification region, region is identified for each, add up the coordinate on each summit, and the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates as establishment rectangular area, summit, then identify all rectangular areas obtained region and the primary Chinese character region identifying that in image, the region of remaining minimum enclosed rectangle composition is in original image from each.
Line of text in each character picture binary map represents the Chinese character region of refining of different colours respectively, by being merged in the Chinese character region of refining of different colours, can obtain the Chinese character region in original image, specifically include following steps:
G1, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, primary is identified, and the minimum enclosed rectangle in image is labeled as R successively1, R2..., Rj, j is the primary number of minimum enclosed rectangle in image that identifies, and calculates the centre coordinate of each minimum enclosed rectangle, subsequently into step G2.
G2, judge R successively2, R3..., RjCenter and R1Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R1Internal or borderline all minimum enclosed rectangle, put into R1Merge in set;
Judge R successively1, R3..., RjCenter and R2Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R2Internal or borderline all minimum enclosed rectangle, put into R2Merge in set;
By that analogy, until judging R successively1, R2..., Rj-1Center and RjPosition relationship, from R1, R2..., RjMiddle Selection Center is positioned at RjInternal or borderline all minimum enclosed rectangle, put into RjMerge in set, subsequently into step G3.
G3, to R1Merge set, R2Merge set ..., RjMerge set and carry out condition merging, comprise the following steps:
G3-1, compare R1Merge set and R2Merge set, work as R2Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R2Merge set and seek union, work as R2Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R2Merge set to put in isolated area set Q;
Relatively R1Merge set and R3Merge set, work as R3Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R3Merge set and seek union, work as R3Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R3Merge set to put in isolated area set Q;
By that analogy, until comparing R1Merge set and RjMerge set, work as RjMerge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and RjMerge set and seek union, work as RjMerge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by RjMerge set and put in isolated area set Q, subsequently into step G3-2.
Merging set number in G3-2, statistical iteration regional ensemble Q, when the merging set number in isolated area set Q is be more than or equal to 2, enter step G3-3, when the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, enter step G4.
G3-3, multiple merging in isolated area set Q is gathered all taking-ups, isolated area set Q is made to become empty set, then the multiple merging set taken out are arranged in order from small to large according to subscript size, relatively first merges set and second merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for second, first is merged set and union is sought in second merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for second, merge set by second to put in isolated area set Q;
Relatively first merges set and the 3rd merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for the 3rd, first is merged set and union is sought in the 3rd merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for the 3rd, merge set by the 3rd and put in isolated area set Q;By that analogy, until comparing first to merge set and last merging set, when last merges at least one minimum enclosed rectangle that set comprises in first merging set, first is merged set and last merges set and seeks union, when last merges any one minimum enclosed rectangle that set does not comprise in first merging set, last is merged set and puts in isolated area set Q, subsequently into step G3-4.
G3-4, it is repeated isolated area set Q processing according to the method in step G3-3, until the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, subsequently into step G4.
G4, each union obtained in step G3 all being processed as follows, add up one and concentrate the apex coordinate of all minimum enclosed rectangle, the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates are as formation rectangular area, summit, then from each and concentrate the Chinese character region that all rectangular areas obtained are original image.
Below in conjunction with specific embodiment, retail shop's label Chinese character region automatic testing method in natural scene of the present invention is described, comprises the following steps:
A, by scanning line sampling and Kmeans cluster obtains vectorial V1 and the V2 of reflection sample region image main pixel color, comprise the following steps:
Retail shop's label in A1, scanning natural scene, obtain original image as shown in Figure 4, using the midpoint of scanning line as basic point, centered by this basic point, point builds the rectangularly-sampled district of a R*2R, wherein R is the width in rectangularly-sampled district, the value of R is the 1/6 of original image width, cutting rectangularly-sampled district from original image, it is thus achieved that sample region image.Sample region image in samples of green frame contains the color of main word and background in original image.
A2, the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, using every a line of matrix as a three-dimensional point, adopts Euclidean distance to carry out Kmeans cluster, set the classification number of cluster as 2, obtaining two cluster centre points, respectively vector V1 and V2, vector V1 and V2 reflects the pixel color that sample region image is main.
B, utilization vector V1 and V2 determine the background profile of original image, comprise the following steps:
B1, each pixel in original image is labeled as 1,2 successively ..., n, n is the number of pixel in original image, calculates Euclidean distance L1 (x) and the L2 (x), wherein x=1 of the pixel x and vector V1 and V2 of original image, 2 ..., n.
B2, create two initialization binary map bg1s identical with original image size and bg2, and the pixel value of all pixels in two initialization binary map bg1 and bg2 is set to 0, setpoint distance threshold X is 50, as Euclidean distance L1 (x) < 50 of the pixel x and vector V1 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg1 is set to 1, obtain coarse contour binary map BG1, as Euclidean distance L2 (x) < 50 of the pixel x and vector V2 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg2 is set to 1, obtain coarse contour binary map BG2.
B3, respectively coarse contour binary map BG1 and BG2 is done Morphological scale-space, namely first pass through erosion operation and remove the fine rule of coarse contour binary map BG1 and BG2, then pass through dilation operation and the tiny gully of closed operation removal coarse contour binary map BG1 and BG2, finally coarse contour binary map BG1 and BG2 is carried out connected domain analysis, from coarse contour binary map BG1 and BG2, select area maximum connected domain profile as a setting.
B4, the hole filled in background profile, and repair the depression on background profile edge, obtain background profile binary map, as shown in Figure 5.Background profile binary map can accurately reflect the position of retail shop's label in original image, is prevented effectively from the interference to Chinese character region detection of the noise outside background.
C, hsv color space being divided into black, white, redness, yellow, green, cyan, blueness, pinkish red eight pieces of color spaces, the division rule of eight pieces of color spaces is as follows:
Black space, v < 0.3or (v < 0.5ands≤0.25);
White space, v >=0.5ands≤0.25;
Red space, (h<1/12orh>=11/12) andv>0.3ands>=0.25;
Yellow space, h>=1/12andh<3/12andv>0.3ands>=0.25;
Vert space, h>=3/12andh<5/12andv>0.3ands>=0.25;
Cyan space, h>=5/12andh<7/12andv>0.3ands>=0.25;
Blue color space, h>=7/12andh<9/12andv>0.3ands>=0.25;
Pinkish red space, h>=9/12andh<11/12andv>0.3ands>=0.25;
In formula, h represents the tone in hsv color space, and the saturation in behalf hsv color space, v represents the lightness in hsv color space, subsequently into step D.Hsv color space can reflect the human eye perception to color well, according to above-mentioned division rule, hsv color space is divided, it is possible to the shades of colour in reflection natural scene comprehensively.
D, original image is carried out colo(u)r breakup, detailed process is: create 8 binary map identical with original image size, and the pixel value of pixels all in every binary map is set to 0, original image is transformed into hsv color space from rgb space, then the color type belonging to each pixel of original image in hsv color space is judged, the all pixels belonging to same color type are mapped to the corresponding position of a binary map, and the pixel value of the pixel of the corresponding position of binary map is set to 1, finally obtain 8 distribution of color binary map, subsequently into step E.
E, 8 distribution of color binary map are carried out Chinese character connected domain analysis, specifically include following steps:
E1,8 distribution of color binary map are done and computing with background profile binary map respectively, obtain 8 coarse contours distribution binary map.
E2, respectively 8 coarse contours are distributed binary map and do Morphological scale-space, namely each coarse contour binary map is done in vertically and horizontally both direction closed operation and the opening operation of 7 pixels, filters tiny gully and fine rule, obtain 8 thin contoured profile binary map.
E3, respectively 8 thin contoured profile binary map are carried out 8 connected domain scannings, and calculate the area of each connected domain, center-of-mass coordinate and minimum enclosed rectangle in each thin contoured profile binary map.
E4, for any one connected domain in each thin contoured profile binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this connected domain being set to 0, obtains 8 stroke level distribution binary map, wherein three filterconditions are respectively as follows:
A, the area of connected domain and the area ratio of its minimum enclosed rectangle are less than 1/5;
B, connected domain minimum enclosed rectangle width less than original image width 1/200 or more than the 1/2 of original image width;
C, connected domain the ratio of width to height of minimum enclosed rectangle less than 1/10 or more than 10.
E5,8 stroke levels distribution binary map for obtaining, be distributed binary map to each stroke level and be all handled as follows:
E5-1, each connected domain that stroke level is distributed in binary map is labeled as C successively1, C2..., Ci, i is the number of connected domain in stroke level distribution binary map, respectively by C1, C2..., CiMark value be set to respective subscript value, i.e. C1Mark value be 1, C2Mark value be 2, by that analogy, CiMark value be i, and define independent communication territory set P, independent communication territory set P in initial connected domain number be 0.
E5-2, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of ordinates, obtain two vertical projection line segments, definition disH is the overlap length between two vertical projection line segments, and specifies that disH value is 0 when two vertical projection line segments do not have overlap, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of abscissas, obtain two floor projection line segments, definition dis is the beeline between two floor projection line segments, when two floor projection line segments adjacent or overlapping time dis value be 0, when two floor projection line segments do not have overlap, dis value is that the right endpoint of left side floor projection line segment is to the distance between the left end point of right side floor projection line segment.
E5-3, definition avgW are character mean breadth, and the initial value of avgW is C1The width of minimum enclosed rectangle, definition sum is character row overall width, and the initial value of sum is avgW, and definition cnt is enumerator, and the initial value of cnt is 1;
Choose C1And C2Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C2In the pixel value of all pixels be set to 0, and by C2Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C2Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C2Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C2The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C2Put in independent communication territory set P;
Choose C1And C3Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C3In the pixel value of all pixels be set to 0, and by C3Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C3Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C3Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C3The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C3Put in independent communication territory set P;
By that analogy, until choosing C1And CiTwo vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by CiIn the pixel value of all pixels be set to 0, and by CiMark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And CiTwo floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by CiMark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds CiThe width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by CiPut in independent communication territory set P, subsequently into step E5-4.
Connected domain number in E5-4, statistical iteration connected domain set P, when the connected domain number in P is gathered be more than or equal to 2 in independent communication territory, enters step E5-5, when the connected domain number in independent communication territory set P is 0 or 1, enters step E5-7.
E5-5, multiple connected domains that independent communication territory is gathered in P are all taken out, independent communication territory set P is made to become empty set, then the multiple connected domains taken out are arranged in order from small to large according to subscript size, definition avgW is character mean breadth, the initial value of avgW is the width of the minimum enclosed rectangle of first connected domain, and definition sum is character row overall width, and the initial value of sum is avgW, definition cnt is enumerator, and the initial value of cnt is 1;
nullChoose two vertical projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in second connected domain is set to 0,And the mark value of second connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of second connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of second connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Second connected domain is put in independent communication territory set P;
nullChoose two articles of vertical projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in 3rd connected domain is set to 0,And the mark value of the 3rd connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two articles of floor projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of the 3rd connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of the 3rd connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,3rd connected domain is put in independent communication territory set P;
nullBy that analogy,Until two vertical projection line segments that the minimum enclosed rectangle choosing first connected domain and last connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of pixels all in last connected domain is set to 0,And the mark value of last connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and last connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of last connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of last connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Last connected domain is put in independent communication territory set P,Subsequently into step E5-6.
E5-6, according to the method in step E5-5 to independent communication territory gather P be repeated process, until independent communication territory set P in connected domain number be 0 or 1, subsequently into step E5-7.
E5-7, successively stroke level is distributed the connected domain that mark value is identical in binary map and is designated as a marked region, and using the mark value of the connected domain mark value as this marked region, then the area of each marked region, center-of-mass coordinate and minimum enclosed rectangle are calculated respectively, subsequently into step E6.
E6,8 stroke levels distribution binary map for obtaining, be distributed binary map to each stroke level and be all handled as follows:
E6-1, for any two marked region, if the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region, then the mark value of this marked region is set to the mark value of another marked region, subsequently into step E6-2.
E6-2, successively stroke level is distributed the marked region that mark value is identical in binary map and is designated as a line of text, then calculate each line of text width, highly, area and minimum enclosed rectangle, it is thus achieved that line of text binary map.
What each line of text in F, 8 line of text binary map reflected is the Chinese character region of different colours in retail shop's label, by the line of text not meeting Chinese-character writing rule in each line of text binary map is filtered, Chinese character region after being refined, specifically includes following steps:
F1, for 8 the line of text binary map obtained, for any one line of text in each line of text binary map, when its at least one meeting in following three filtercondition, the mark value of all pixels of each connected domain in this article one's own profession is set to 0, obtaining 8 candidate image binary map, wherein three filterconditions are respectively as follows:
D, line of text height less than background profile minimum enclosed rectangle height 1/20;
E, line of text the ratio of width to height less than 7/10;
F, the area of line of text and the area ratio of its minimum enclosed rectangle are less than 1/10 or more than 4/5.
F2, for 8 the candidate image binary map obtained, for any one line of text in each candidate image binary map, when its at least one meeting in following two filterconditions, the mark value of all pixels of each connected domain in this article one's own profession is set to 0, obtaining 8 character picture binary map, two of which filtercondition is respectively as follows:
G, to the minimum enclosed rectangle region of line of text by row summation, obtain a series of row projection value, row projection value exceedes 0.7 times more than minimum enclosed rectangle height of the continuous columns of the 70% of minimum enclosed rectangle height;
H, line of text area less than background profile binary map minimum enclosed rectangle area 1/1000.
F3, for 8 the character picture binary map obtained, first calculate successively all connected domains forming each line of text in each character picture binary map area and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, then calculates the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively.
Line of text in G, 8 character picture binary map represents the Chinese character region of refining of different colours respectively, by being merged in the Chinese character region of refining of different colours, can obtain the Chinese character region in original image, specifically include following steps:
G1, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, primary is identified, and the minimum enclosed rectangle in image is labeled as R successively1, R2..., Rj, j is the primary number of minimum enclosed rectangle in image that identifies, and calculates the centre coordinate of each minimum enclosed rectangle, subsequently into step G2.
G2, judge R successively2, R3..., RjCenter and R1Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R1Internal or borderline all minimum enclosed rectangle, put into R1Merge in set;
Judge R successively1, R3..., RjCenter and R2Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R2Internal or borderline all minimum enclosed rectangle, put into R2Merge in set;
By that analogy, until judging R successively1, R2..., Rj-1Center and RjPosition relationship, from R1, R2..., RjMiddle Selection Center is positioned at RjInternal or borderline all minimum enclosed rectangle, put into RjMerge in set, subsequently into step G3.
G3, to R1Merge set, R2Merge set ..., RjMerge set and carry out condition merging, comprise the following steps:
G3-1, compare R1Merge set and R2Merge set, work as R2Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R2Merge set and seek union, work as R2Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R2Merge set to put in isolated area set Q;
Relatively R1Merge set and R3Merge set, work as R3Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R3Merge set and seek union, work as R3Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R3Merge set to put in isolated area set Q;
By that analogy, until comparing R1Merge set and RjMerge set, work as RjMerge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and RjMerge set and seek union, work as RjMerge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by RjMerge set and put in isolated area set Q, subsequently into step G3-2.
Merging set number in G3-2, statistical iteration regional ensemble Q, when the merging set number in isolated area set Q is be more than or equal to 2, enter step G3-3, when the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, enter step G4.
G3-3, multiple merging in isolated area set Q is gathered all taking-ups, isolated area set Q is made to become empty set, then the multiple merging set taken out are arranged in order from small to large according to subscript size, relatively first merges set and second merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for second, first is merged set and union is sought in second merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for second, merge set by second to put in isolated area set Q;
Relatively first merges set and the 3rd merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for the 3rd, first is merged set and union is sought in the 3rd merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for the 3rd, merge set by the 3rd and put in isolated area set Q;By that analogy, until comparing first to merge set and last merging set, when last merges at least one minimum enclosed rectangle that set comprises in first merging set, first is merged set and last merges set and seeks union, when last merges any one minimum enclosed rectangle that set does not comprise in first merging set, last is merged set and puts in isolated area set Q, subsequently into step G3-4.
G3-4, it is repeated isolated area set Q processing according to the method in step G3-3, until the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, subsequently into step G4.
G4, each union obtained in step G3 all being processed as follows, add up one and concentrate the apex coordinate of all minimum enclosed rectangle, the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates are as establishment rectangular area, summit, then from each and concentrate the Chinese character region that all rectangular areas obtained are original image.
The present invention realizes the detection to retail shop's label background profile by scanning line sampling and Kmeans cluster, is conducive to being accurately positioned retail shop's label in natural scene, it is to avoid the interference of other complex backgrounds;Utilize hsv color space to divide to realize the colo(u)r breakup of retail shop's label Chinese character foreground and be analyzed each layer of Chinese character foreground filtering, it is possible to ensure the Chinese character region of different colours on complete detection retail shop label, reduce the misclassification rate of Chinese character detection;Eventually through integrating each layer Chinese character region, it is achieved to the automatic detection in retail shop's label Chinese character region in natural scene.The present invention can be effectively improved the accuracy of Chinese character region detection, and the application based on the Chinese Character Recognition under natural scene is significant.

Claims (6)

1. retail shop's label Chinese character region automatic testing method in natural scene, it is characterised in that comprise the following steps:
Retail shop's label in A, scanning natural scene obtains original image, the sample region image of rectangle is intercepted from original image, and the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, respectively every a line of matrix is carried out Kmeans cluster as a three-dimensional point, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2, subsequently into step B;
B, calculate each pixel of original image distance to vector V1 and V2 respectively, and create two initialization binary map bg1s identical with original image size and bg2, initialize the pixel value of all pixels in binary map bg1 and bg2 and be 0, setpoint distance threshold X, compare the magnitude relationship of each pixel of original image distance to vector V1 and X successively, when original image pixel to vector V1 distance less than X time, in initializing binary map bg1, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtains coarse contour binary map BG1;Compare the magnitude relationship of each pixel of original image distance to vector V2 and X successively, when original image pixel to vector V2 distance less than X time, in initializing binary map bg2, the pixel value of the pixel identical with this pixel coordinate is set to 1, obtain coarse contour binary map BG2, respectively coarse contour binary map BG1 and BG2 done Morphological scale-space and carry out connected domain analysis, from coarse contour binary map BG1 and BG2, select after the maximum connected domain of area carries out repairing and fill profile as a setting, obtain background profile binary map;
C, hsv color space being divided into black, white, redness, yellow, green, cyan, blueness, pinkish red eight pieces of color spaces, the division rule of eight pieces of color spaces is as follows:
Black space, v < 0.3or (v < 0.5ands≤0.25);
White space, v >=0.5ands≤0.25;
Red space, (h<1/12orh>=11/12) andv>0.3ands>=0.25;
Yellow space, h>=1/12andh<3/12andv>0.3ands>=0.25;
Vert space, h>=3/12andh<5/12andv>0.3ands>=0.25;
Cyan space, h>=5/12andh<7/12andv>0.3ands>=0.25;
Blue color space, h>=7/12andh<9/12andv>0.3ands>=0.25;
Pinkish red space, h>=9/12andh<11/12andv>0.3ands>=0.25;
In formula, h represents the tone in hsv color space, and the saturation in behalf hsv color space, v represents the lightness in hsv color space, subsequently into step D;
D, 8 binary map identical with original image size of establishment, and the pixel value of pixels all in every binary map is set to 0, original image is transformed into hsv color space from rgb space, then the color type belonging to each pixel of original image in hsv color space is judged, the all pixels belonging to same color type are mapped to the corresponding position of a binary map, and the pixel value of the pixel of corresponding position in binary map is set to 1, finally obtain 8 distribution of color binary map, subsequently into step E;
nullE、8 distribution of color binary map are done with background profile binary map respectively with computing after carry out Morphological scale-space again,Filter the tiny gully in 8 distribution of color binary map and fine rule,Obtain 8 thin contoured profile binary map,Respectively 8 thin contoured profile binary map are carried out connected domain scanning,Eight connectivity labelling method is utilized to obtain the labelling figure that connected graph is corresponding,And calculate the attribute of each connected domain,Then the connected domain not meeting Chinese-character stroke feature in 8 thin contoured profile binary map is filtered,Obtain 8 stroke level distribution binary map,Respectively each stroke level is distributed the connected domain meeting Chinese-character stroke feature in binary map to merge,Multiple connected domains after merging are designated as a marked region and determine mark value,For any two marked region,If the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region,Then the mark value of this marked region is set to the mark value of another marked region,It is distributed binary map finally for each stroke level,Successively marked region identical for mark value is designated as a line of text,Obtain 8 line of text binary map,Subsequently into step F;
F, for any one line of text in 8 line of text binary map, when line of text minimum enclosed rectangle height less than background profile minimum enclosed rectangle height 1/20, the ratio of width to height of the minimum enclosed rectangle of line of text less than 7/10 or the area ratio of the area of line of text and its minimum enclosed rectangle less than 1/10 or more than 4/5 time, this article one's own profession is deleted corresponding line of text binary map, 8 the character picture binary map obtained, calculate respectively in each character picture binary map the area of all line of text and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, and calculate the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively, subsequently into step G;
G, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, respectively primary being identified, the border being made up of two or more minimum enclosed rectangle in image is that the isolated area of irregular polygon is as an identification region, region is identified for each, add up the coordinate on each summit, and the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates as establishment rectangular area, summit, then identify all rectangular areas obtained region and the primary Chinese character region identifying that in image, the region of remaining minimum enclosed rectangle composition is in original image from each.
2. retail shop's label Chinese character region automatic testing method in natural scene as claimed in claim 1, it is characterised in that described step A comprises the following steps:
Retail shop's label in A1, scanning natural scene obtains original image, on scanning line more than 1/3 length less than the section of 2/3 length in appoint and take a bit as basic point, centered by this basic point, point builds the rectangularly-sampled district of a R*kR, wherein R is the width in rectangularly-sampled district, the value of R is more than the 1/7 of original image width, less than original image width 1/4, k is the ratio of width to height in rectangularly-sampled district, the span of k is 1/4 < k < 4, cutting rectangularly-sampled district from original image, obtain sample region image, subsequently into step A2;
A2, the RGB triple channel of sample region image is launched, form the matrix of M*N row 3 row, wherein M is the width of sample region image, N is the height of sample region image, using every a line of matrix as a three-dimensional point, adopt Euclidean distance to carry out Kmeans cluster, set the classification number of cluster as 2, obtain two cluster centre points, respectively vector V1 and V2.
3. retail shop's label Chinese character region automatic testing method in natural scene as claimed in claim 1, it is characterised in that described step B comprises the following steps:
B1, each pixel in original image is labeled as 1 successively, 2, ..., n, n is the number of pixel in original image, calculate Euclidean distance L1 (x) and the L2 (x) of the pixel x and vector V1 and V2 of original image, wherein x=1,2 ..., n, subsequently into step B2;
B2, create two initialization binary map bg1s identical with original image size and bg2, and the pixel value of all pixels in two initialization binary map bg1 and bg2 is set to 0, setpoint distance threshold X, as Euclidean distance L1 (x) the < X of the pixel x and vector V1 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg1 is set to 1, obtain coarse contour binary map BG1, as Euclidean distance L2 (x) the < X of the pixel x and vector V2 of original image, the pixel value initializing pixel identical with pixel x position in binary map bg2 is set to 1, obtain coarse contour binary map BG2, subsequently into step B3;
B3, respectively coarse contour binary map BG1 and BG2 is done Morphological scale-space, namely first pass through erosion operation and remove the fine rule of coarse contour binary map BG1 and BG2, then pass through dilation operation and the tiny gully of closed operation removal coarse contour binary map BG1 and BG2, finally coarse contour binary map BG1 and BG2 is carried out connected domain analysis, area maximum connected domain profile as a setting is selected, subsequently into step B4 from coarse contour binary map BG1 and BG2;
B4, the hole filled in background profile, and repair the depression on background profile edge, obtain background profile binary map.
4. retail shop's label Chinese character region automatic testing method in natural scene as claimed in claim 1, it is characterised in that: described step E comprises the following steps:
E1,8 distribution of color binary map are done and computing with background profile binary map respectively, obtain 8 coarse contours distribution binary map, subsequently into step E2;
E2, respectively 8 coarse contours are distributed binary map and do Morphological scale-space, namely each coarse contour binary map is done in vertically and horizontally both direction closed operation and the opening operation of 7 pixels, filter tiny gully and fine rule, obtain 8 thin contoured profile binary map, subsequently into step E3;
E3, respectively 8 thin contoured profile binary map are carried out 8 connected domain scannings, and calculate the area of each connected domain, center-of-mass coordinate and minimum enclosed rectangle in each thin contoured profile binary map, subsequently into step E4;
E4, for any one connected domain in each thin contoured profile binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this connected domain is set to 0, obtain 8 stroke level distribution binary map, subsequently into step E5, wherein three filterconditions are respectively as follows:
A, the area of connected domain and the area ratio of its minimum enclosed rectangle are less than 1/5;
B, connected domain minimum enclosed rectangle width less than original image width 1/200 or more than the 1/2 of original image width;
C, connected domain the ratio of width to height of minimum enclosed rectangle less than 1/10 or more than 10;
E5,8 stroke levels distribution binary map for obtaining, be distributed binary map to each stroke level and be all handled as follows:
E5-1, each connected domain that stroke level is distributed in binary map is labeled as C successively1, C2..., Ci, i is the number of connected domain in stroke level distribution binary map, respectively by C1, C2..., CiMark value be set to respective subscript value, i.e. C1Mark value be 1, C2Mark value be 2, by that analogy, CiMark value be i, and define independent communication territory set P, independent communication territory set P in initial connected domain number be 0;
E5-2, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of ordinates, obtain two vertical projection line segments, definition disH is the overlap length between two vertical projection line segments, and specifies that disH value is 0 when two vertical projection line segments do not have overlap, from C1, C2..., CiIn choose the minimum enclosed rectangle of any two connected domain and project on axis of abscissas, obtain two floor projection line segments, definition dis is the beeline between two floor projection line segments, when two floor projection line segments adjacent or overlapping time dis value be 0, when two floor projection line segments do not have overlap, dis value is that the right endpoint of left side floor projection line segment is to the distance between the left end point of right side floor projection line segment;
E5-3, definition avgW are character mean breadth, and the initial value of avgW is C1The width of minimum enclosed rectangle, definition sum is character row overall width, and the initial value of sum is avgW, and definition cnt is enumerator, and the initial value of cnt is 1;
Choose C1And C2Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C2In the pixel value of all pixels be set to 0, and by C2Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C2Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C2Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C2The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C2Put in independent communication territory set P;
Choose C1And C3Two vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by C3In the pixel value of all pixels be set to 0, and by C3Mark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And C3Two floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by C3Mark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds C3The width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by C3Put in independent communication territory set P;
By that analogy, until choosing C1And CiTwo vertical projection line segments obtaining to axis of ordinates upslide movie queen of minimum enclosed rectangle, the overlap length disH when between two vertical projection line segments is less than C1Minimum enclosed rectangle height 1/4 time, by CiIn the pixel value of all pixels be set to 0, and by CiMark value be set to 0, the overlap length disH when between two vertical projection line segments is be more than or equal to C1Minimum enclosed rectangle height 1/4 time, choose C1And CiTwo floor projection line segments obtaining to axis of abscissas upslide movie queen of minimum enclosed rectangle, when the beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW, by CiMark value be set to C1Mark value 1, the value simultaneously updating sum is that sum adds CiThe width of minimum enclosed rectangle, then the value of cnt is added 1, and when the value updating avgW is sum divided by cnt, the beeline dis when between two floor projection line segments more than 1.5 times of avgW, by CiPut in independent communication territory set P, subsequently into step E5-4;
Connected domain number in E5-4, statistical iteration connected domain set P, when the connected domain number in P is gathered be more than or equal to 2 in independent communication territory, enters step E5-5, when the connected domain number in independent communication territory set P is 0 or 1, enters step E5-7;E5-5, multiple connected domains that independent communication territory is gathered in P are all taken out, independent communication territory set P is made to become empty set, then the multiple connected domains taken out are arranged in order from small to large according to subscript size, definition avgW is character mean breadth, the initial value of avgW is the width of the minimum enclosed rectangle of first connected domain, and definition sum is character row overall width, and the initial value of sum is avgW, definition cnt is enumerator, and the initial value of cnt is 1;
nullChoose two vertical projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in second connected domain is set to 0,And the mark value of second connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and second connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of second connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of second connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Second connected domain is put in independent communication territory set P;
nullChoose two articles of vertical projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of all pixels in 3rd connected domain is set to 0,And the mark value of the 3rd connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two articles of floor projection line segments that the minimum enclosed rectangle of first connected domain and the 3rd connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of the 3rd connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of the 3rd connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,3rd connected domain is put in independent communication territory set P;
nullBy that analogy,Until two vertical projection line segments that the minimum enclosed rectangle choosing first connected domain and last connected domain obtains to axis of ordinates upslide movie queen,Overlap length disH when between two vertical projection line segments less than first connected domain minimum enclosed rectangle height 1/4 time,The pixel value of pixels all in last connected domain is set to 0,And the mark value of last connected domain is set to 0,Overlap length disH when between two vertical projection line segments be more than or equal to first connected domain minimum enclosed rectangle height 1/4 time,Choose two floor projection line segments that the minimum enclosed rectangle of first connected domain and last connected domain obtains to axis of abscissas upslide movie queen,When beeline dis when between two floor projection line segments is less than or equal to 1.5 times of avgW,The mark value of last connected domain is set to the mark value of first connected domain,The value simultaneously updating sum is the sum width adding the minimum enclosed rectangle of last connected domain,Then the value of cnt is added 1,And the value updating avgW is that sum is divided by cnt,When beeline dis when between two floor projection line segments is more than 1.5 times of avgW,Last connected domain is put in independent communication territory set P,Subsequently into step E5-6;
E5-6, according to the method in step E5-5 to independent communication territory gather P be repeated process, until independent communication territory set P in connected domain number be 0 or 1, subsequently into step E5-7;
E5-7, successively stroke level is distributed the connected domain that mark value is identical in binary map and is designated as a marked region, and using the mark value of the connected domain mark value as this marked region, then the area of each marked region, center-of-mass coordinate and minimum enclosed rectangle are calculated respectively, subsequently into step E6;
E6,8 the stroke levels distribution binary map obtained for step E5, be distributed binary map to each stroke level and be all handled as follows:
E6-1, for any two marked region, if the center-of-mass coordinate of a marked region is positioned at the minimum enclosed rectangle of another marked region, then the mark value of this marked region is set to the mark value of another marked region, subsequently into step E6-2;
E6-2, successively stroke level is distributed the marked region that mark value is identical in binary map and is designated as a line of text, then calculate each line of text width, highly, area and minimum enclosed rectangle, it is thus achieved that line of text binary map.
5. retail shop's label Chinese character region automatic testing method in natural scene as claimed in claim 1, it is characterised in that: described step F comprises the following steps:
F1, for 8 the line of text binary map obtained, for any one line of text in each line of text binary map, when its at least one meeting in following three filtercondition, the pixel value of all pixels in this article one's own profession is set to 0, obtain 8 candidate image binary map, subsequently into step F2, wherein three filterconditions are respectively as follows:
D, line of text height less than background profile minimum enclosed rectangle height 1/20;
E, line of text the ratio of width to height less than 7/10;
F, the area of line of text and the area ratio of its minimum enclosed rectangle are less than 1/10 or more than 4/5;
F2, for 8 the candidate image binary map obtained, for any one line of text in each candidate image binary map, when its at least one meeting in following two filterconditions, the pixel value of all pixels in this article one's own profession is set to 0, obtain 8 character picture binary map, subsequently into step F3, two of which filtercondition is respectively as follows:
G, to the minimum enclosed rectangle of line of text by row summation, obtain a series of row projection value, row projection value exceedes 0.7 times more than minimum enclosed rectangle height of the continuous columns of the 70% of minimum enclosed rectangle height;
H, line of text area less than background profile binary map minimum enclosed rectangle area 1/1000;
F3, for 8 the character picture binary map obtained, first calculate successively all connected domains forming each line of text in each character picture binary map area and, when calculated area and less than background profile binary map minimum enclosed rectangle area 1/200 time, corresponding character picture binary map is deleted, then calculates the coordinate of the minimum enclosed rectangle of all line of text in remaining character picture binary map respectively.
6. retail shop's label Chinese character region automatic testing method in natural scene as claimed in claim 1, it is characterised in that: described step G comprises the following steps:
G1, one blank image identical with original image size of establishment, successively the minimum enclosed rectangle of all line of text in remaining character picture binary map is marked at the corresponding position of blank image, obtain primary identification image, primary is identified, and the minimum enclosed rectangle in image is labeled as R successively1, R2..., Rj, j is the primary number of minimum enclosed rectangle in image that identifies, and calculates the centre coordinate of each minimum enclosed rectangle, subsequently into step G2;
G2, judge R successively2, R3..., RjCenter and R1Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R1Internal or borderline all minimum enclosed rectangle, put into R1Merge in set;
Judge R successively1, R3..., RjCenter and R2Position relationship, from R1, R2..., RjMiddle Selection Center is positioned at R2Internal or borderline all minimum enclosed rectangle, put into R2Merge in set;
By that analogy, until judging R successively1, R2..., Rj-1Center and RjPosition relationship, from R1, R2..., RjMiddle Selection Center is positioned at RjInternal or borderline all minimum enclosed rectangle, put into RjMerge in set, subsequently into step G3;G3, to R1Merge set, R2Merge set ..., RjMerge set and carry out condition merging, comprise the following steps:
G3-1, compare R1Merge set and R2Merge set, work as R2Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R2Merge set and seek union, work as R2Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R2Merge set to put in isolated area set Q;
Relatively R1Merge set and R3Merge set, work as R3Merge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and R3Merge set and seek union, work as R3Merge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by R3Merge set to put in isolated area set Q;
By that analogy, until comparing R1Merge set and RjMerge set, work as RjMerge set and comprise R1When merging at least one minimum enclosed rectangle in set, to R1Merge set and RjMerge set and seek union, work as RjMerge set and do not comprise R1When merging any one minimum enclosed rectangle in set, by RjMerge set and put in isolated area set Q, subsequently into step G3-2;
Merging set number in G3-2, statistical iteration regional ensemble Q, when the merging set number in isolated area set Q is be more than or equal to 2, enter step G3-3, when the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, enter step G4.
G3-3, multiple merging in isolated area set Q is gathered all taking-ups, isolated area set Q is made to become empty set, then the multiple merging set taken out are arranged in order from small to large according to subscript size, relatively first merges set and second merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for second, first is merged set and union is sought in second merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for second, merge set by second to put in isolated area set Q;
Relatively first merges set and the 3rd merging set, when merging at least one minimum enclosed rectangle that set comprises in first merging set for the 3rd, first is merged set and union is sought in the 3rd merging set, when merging any one minimum enclosed rectangle that set does not comprise in first merging set for the 3rd, merge set by the 3rd and put in isolated area set Q;By that analogy, until comparing first to merge set and last merging set, when last merges at least one minimum enclosed rectangle that set comprises in first merging set, first is merged set and last merges set and seeks union, when last merges any one minimum enclosed rectangle that set does not comprise in first merging set, last is merged set and puts in isolated area set Q, subsequently into step G3-4.
G3-4, it is repeated isolated area set Q processing according to the method in step G3-3, until the merging set number in isolated area set Q is 0 or 1, using the merging set in isolated area set Q as a union, subsequently into step G4.
G4, each union obtained in step G3 all being processed as follows, add up one and concentrate the apex coordinate of all minimum enclosed rectangle, the minima selecting x coordinate from apex coordinate is designated as xmin, the maximum selecting x coordinate is designated as xmax, the minima selecting y-coordinate is designated as ymin, the maximum selecting y-coordinate is designated as ymax, with (xmin, ymin), (xmax, ymin), (xmin, ymax), (xmax, ymax) four coordinates are as establishment rectangular area, summit, then from each and concentrate the Chinese character region that all rectangular areas obtained are original image.
CN201610059409.XA 2016-01-28 2016-01-28 Retail shop's label Chinese character region automatic testing method in natural scene Active CN105740860B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610059409.XA CN105740860B (en) 2016-01-28 2016-01-28 Retail shop's label Chinese character region automatic testing method in natural scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610059409.XA CN105740860B (en) 2016-01-28 2016-01-28 Retail shop's label Chinese character region automatic testing method in natural scene

Publications (2)

Publication Number Publication Date
CN105740860A true CN105740860A (en) 2016-07-06
CN105740860B CN105740860B (en) 2018-04-06

Family

ID=56246822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610059409.XA Active CN105740860B (en) 2016-01-28 2016-01-28 Retail shop's label Chinese character region automatic testing method in natural scene

Country Status (1)

Country Link
CN (1) CN105740860B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107564015A (en) * 2017-08-24 2018-01-09 佛山市国方商标软件有限公司 A kind of segmentation and labeling method and device based on polychrome level image connectivity domain
WO2018040342A1 (en) * 2016-08-31 2018-03-08 百度在线网络技术(北京)有限公司 Method and device for identifying text area in image
WO2018137612A1 (en) * 2017-01-25 2018-08-02 武汉极目智能技术有限公司 Road sign recognition method and system
CN108629238A (en) * 2017-03-21 2018-10-09 高德软件有限公司 A kind of method and apparatus of identification Chinese character label
CN108827181A (en) * 2018-03-14 2018-11-16 浙江大学山东工业技术研究院 A kind of plate surface detection method of view-based access control model
CN109345551A (en) * 2018-09-18 2019-02-15 清华大学 Detection method, system and the computer storage medium of image outer profile concave envelope
CN109558876A (en) * 2018-11-20 2019-04-02 浙江口碑网络技术有限公司 Character recognition processing method and device
CN110135426A (en) * 2018-02-09 2019-08-16 北京世纪好未来教育科技有限公司 Sample mask method and computer storage medium
CN110188764A (en) * 2019-05-31 2019-08-30 浙江口碑网络技术有限公司 Character color identifying processing method and device
CN110569835A (en) * 2018-06-06 2019-12-13 北京搜狗科技发展有限公司 Image identification method and device and electronic equipment
CN110929664A (en) * 2019-11-29 2020-03-27 汉海信息技术(上海)有限公司 Image recognition method and device
CN111104936A (en) * 2019-11-19 2020-05-05 泰康保险集团股份有限公司 Text image recognition method, device, equipment and storage medium
CN111666824A (en) * 2020-05-14 2020-09-15 浙江工业大学 Color attribute and machine learning-based indicator light identification method for mobile robot
CN111738250A (en) * 2020-08-26 2020-10-02 北京易真学思教育科技有限公司 Text detection method and device, electronic equipment and computer storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4607633B2 (en) * 2005-03-17 2011-01-05 株式会社リコー Character direction identification device, image forming apparatus, program, storage medium, and character direction identification method
CN101697201B (en) * 2009-09-25 2012-05-30 华南理工大学 Handwritten Chinese character identification method irrelevant to rotation direction
CN102890783B (en) * 2011-07-20 2015-07-29 富士通株式会社 The method and apparatus in the direction of word in recognition image block
CN104951741A (en) * 2014-03-31 2015-09-30 阿里巴巴集团控股有限公司 Character recognition method and device thereof

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018040342A1 (en) * 2016-08-31 2018-03-08 百度在线网络技术(北京)有限公司 Method and device for identifying text area in image
CN107784301A (en) * 2016-08-31 2018-03-09 百度在线网络技术(北京)有限公司 Method and apparatus for identifying character area in image
CN107784301B (en) * 2016-08-31 2021-06-11 百度在线网络技术(北京)有限公司 Method and device for recognizing character area in image
US10803338B2 (en) 2016-08-31 2020-10-13 Baidu Online Network Technology (Beijing) Co., Ltd. Method and device for recognizing the character area in a image
WO2018137612A1 (en) * 2017-01-25 2018-08-02 武汉极目智能技术有限公司 Road sign recognition method and system
US10990835B2 (en) 2017-01-25 2021-04-27 Wuhan Jimu Intelligent Technology Co., Ltd. Road sign recognition method and system
CN108629238B (en) * 2017-03-21 2020-07-10 阿里巴巴(中国)有限公司 Method and device for identifying Chinese character mark
CN108629238A (en) * 2017-03-21 2018-10-09 高德软件有限公司 A kind of method and apparatus of identification Chinese character label
CN107564015A (en) * 2017-08-24 2018-01-09 佛山市国方商标软件有限公司 A kind of segmentation and labeling method and device based on polychrome level image connectivity domain
CN110135426A (en) * 2018-02-09 2019-08-16 北京世纪好未来教育科技有限公司 Sample mask method and computer storage medium
CN108827181A (en) * 2018-03-14 2018-11-16 浙江大学山东工业技术研究院 A kind of plate surface detection method of view-based access control model
CN110569835A (en) * 2018-06-06 2019-12-13 北京搜狗科技发展有限公司 Image identification method and device and electronic equipment
CN110569835B (en) * 2018-06-06 2024-03-05 北京搜狗科技发展有限公司 Image recognition method and device and electronic equipment
CN109345551B (en) * 2018-09-18 2020-11-20 清华大学 Method and system for detecting concave envelope in image outer contour and computer storage medium
CN109345551A (en) * 2018-09-18 2019-02-15 清华大学 Detection method, system and the computer storage medium of image outer profile concave envelope
CN109558876A (en) * 2018-11-20 2019-04-02 浙江口碑网络技术有限公司 Character recognition processing method and device
CN110188764A (en) * 2019-05-31 2019-08-30 浙江口碑网络技术有限公司 Character color identifying processing method and device
CN111104936A (en) * 2019-11-19 2020-05-05 泰康保险集团股份有限公司 Text image recognition method, device, equipment and storage medium
CN110929664A (en) * 2019-11-29 2020-03-27 汉海信息技术(上海)有限公司 Image recognition method and device
CN110929664B (en) * 2019-11-29 2023-05-30 汉海信息技术(上海)有限公司 Image recognition method and device
CN111666824A (en) * 2020-05-14 2020-09-15 浙江工业大学 Color attribute and machine learning-based indicator light identification method for mobile robot
CN111666824B (en) * 2020-05-14 2023-12-15 浙江工业大学 Indicator light identification method of mobile robot based on color attribute and machine learning
CN111738250A (en) * 2020-08-26 2020-10-02 北京易真学思教育科技有限公司 Text detection method and device, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
CN105740860B (en) 2018-04-06

Similar Documents

Publication Publication Date Title
CN105740860A (en) Automatic detection method for Chinese character area of shop sign in natural scene
CN102426649B (en) Simple steel seal digital automatic identification method with high accuracy rate
CN114820627B (en) Textile quality detection method based on optical means
CN107784301A (en) Method and apparatus for identifying character area in image
CN104899586B (en) Method and device is identified to the word content for including in image
CN1312625C (en) Character extracting method from complecate background color image based on run-length adjacent map
CN106096601B (en) The method and system of character types in a kind of automatic detection bill
CN108596166A (en) A kind of container number identification method based on convolutional neural networks classification
CN104463138B (en) The text positioning method and system of view-based access control model structure attribute
CN106228157B (en) Coloured image word paragraph segmentation and recognition methods based on image recognition technology
CN102043950A (en) Vehicle outline recognition method based on canny operator and marginal point statistic
CN105095892A (en) Student document management system based on image processing
CN106228545A (en) A kind of automatic division method of figure of buddha class Tangka&#39;s concordance damaged area
CN104598907B (en) Lteral data extracting method in a kind of image based on stroke width figure
CN109685788A (en) A kind of flooring defect image automatic testing method based on morphological feature
JP2003242505A (en) Automatic method for determining illuminant of digital color image
CN113158977B (en) Image character editing method for improving FANnet generation network
CN107730508A (en) Color documents images multichannel binary processing method
CN103049756A (en) Method for automatically extracting and removing words in color image on basis of CEMA (Cellular Message Encryption Algorithm) and texture matching repairing technology
CN108038458B (en) Method for automatically acquiring outdoor scene text in video based on characteristic abstract diagram
CN113392819B (en) Batch academic image automatic segmentation and labeling device and method
CN106558044A (en) The resolution measuring method of image module
CN101425143B (en) Image positioning method and device
CN112070684B (en) Method for repairing characters of a bone inscription based on morphological prior features
CN110046618B (en) License plate recognition method based on machine learning and maximum extremum stable region

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