CN104573687B - A kind of method and apparatus of segment encode in identification image - Google Patents

A kind of method and apparatus of segment encode in identification image Download PDF

Info

Publication number
CN104573687B
CN104573687B CN201410805525.2A CN201410805525A CN104573687B CN 104573687 B CN104573687 B CN 104573687B CN 201410805525 A CN201410805525 A CN 201410805525A CN 104573687 B CN104573687 B CN 104573687B
Authority
CN
China
Prior art keywords
value
segment
current
identification
abscissa
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410805525.2A
Other languages
Chinese (zh)
Other versions
CN104573687A (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201410805525.2A priority Critical patent/CN104573687B/en
Publication of CN104573687A publication Critical patent/CN104573687A/en
Application granted granted Critical
Publication of CN104573687B publication Critical patent/CN104573687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/09Recognition of logos

Landscapes

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

Abstract

The present invention discloses a kind of method and device for identifying the segment encode in image, this method comprises: identification device obtains the wide as maximum abscissa value of image, the height of image is obtained as maximum ordinate value, according to the color of pixel, maximum abscissa value and maximum ordinate value, obtain the first abscissa value and the second abscissa value of segment encode, according to the first abscissa value, the color of second abscissa value and pixel, obtain the first ordinate value and the second ordinate value of segment encode, according to the first abscissa value, second abscissa value, first ordinate value and the second ordinate value, obtain the coordinate of each section sampling area, it is sampled in pen section sampling area, according to the sampled result of each section sampling area, obtain the pen section distribution situation of segment encode, the number indicated according to pen section distribution situation identification burst code, what identification section code indicated Number.

Description

A kind of method and apparatus of segment encode in identification image
Technical field
The present invention relates to a kind of method and apparatus of the segment encode in field of image recognition more particularly to identification image.
Background technique
In the prior art, it identifies the coordinate for needing to preset fixation in the method for the segment encode in image, can only do in the picture Disturb it is less in the case where identify segment encode, it is this to make to identify equipment very likely in the picture by presetting fixed seat calibration method There are the segment encode range to make mistake in the case where more interference, is drawn a circle to approve, in the process for analyzing the segment encode in the segment encode range drawn a circle to approve The middle data for obtaining mistake, so as to cause the identification mistake of segment encode.
Summary of the invention
The purpose of the invention is to overcome the deficiencies of the prior art and provide it is a kind of identification image in segment encode method and Device is deposited in case of interferers in the picture independent of the coordinate of default fixation, still can correctly draw a circle to approve out segment encode Range, to guarantee the normality of data acquisition during analyzing segment encode, strong interference immunity.
The method of segment encode in a kind of identification image provided by the invention, comprising:
Step S1: identification device obtains the wide as maximum abscissa value of image, obtains the high as maximum of described image Ordinate value;
Step S2: the identification device is vertical according to the color, maximum abscissa value and maximum of the pixel in described image Coordinate value obtains the first abscissa value and the second abscissa value of the segment encode in described image;
Step S3: the identification device is according in first abscissa value, second abscissa value and described image Pixel color, obtain described image in segment encode the first ordinate value and the second ordinate value;
Step S4: the identification device is according to first abscissa value, second abscissa value, the first vertical seat Scale value and second ordinate value, obtain the coordinate of each section sampling area, are adopted in the pen section sampling area Sample;
Step S5: the identification device obtains the pen section of the segment encode according to the sampled result of each section sampling area Distribution situation identifies the number that the segment encode indicates according to the pen section distribution situation.
The present invention provides a kind of device of the segment encode in identification image, including first obtains module, second obtains module, the Three obtain module, sampling module and identification module;
Described first obtains module, for obtaining the wide as maximum abscissa value of image, obtains the high of described image and makees For maximum ordinate value;
Described second obtains module, for being obtained according to color, the first acquisition module of the pixel in described image The maximum abscissa value and maximum ordinate value got obtain the first abscissa value and the second horizontal seat of the segment encode in described image Scale value;
The third obtains module, for being obtained according to color, the second acquisition module of the pixel in described image First abscissa value and second abscissa value got, obtain described image in segment encode the first ordinate value and Second ordinate value;
The sampling module, for according to second first abscissa value that gets of acquisition module and described the Two abscissa values, the third obtain first ordinate value and second ordinate value that module is got, obtain each The coordinate of a section sampling area is sampled in the pen section sampling area;
The identification module, the sampled result of each section sampling area for being obtained according to the sampling module, obtains To the pen section distribution situation of the segment encode, the number that the segment encode indicates is identified according to the pen section distribution situation.
Compared with prior art, the present invention having the advantage that
The segment encode range in image is obtained according to the pixel color in image, the pen of segment encode is judged further according to segment encode range Section, to identify the number that segment encode indicates.There is interference in the picture in coordinate of the identification device independent of default fixation In the case of, the range of segment encode still can be correctly drawn a circle to approve out, to guarantee the normality of data acquisition during analyzing segment encode, Strong interference immunity.
Detailed description of the invention
Fig. 1 is the schematic diagram of the segment encode provided in the specific embodiment of the invention;
Fig. 2 is the flow chart of the method for the segment encode in a kind of identification image that the embodiment of the present invention 1 provides;
Fig. 3 is the flow chart of the method for the segment encode in a kind of identification image that the embodiment of the present invention 2 provides;
Fig. 4 to Fig. 8 is the schematic diagram for the segment encode that the embodiment of the present invention 2 provides;
Fig. 9 is the flow chart of the refinement for the step 102 that the embodiment of the present invention 2 provides;
Figure 10 is the flow chart of the refinement for the step 103 that the embodiment of the present invention 2 provides;
Figure 11 is the flow chart of the method for the segment encode in a kind of identification image that the embodiment of the present invention 3 provides;
Figure 12 to Figure 14 is the schematic diagram for the segment encode that the embodiment of the present invention 3 provides;
Figure 15 is the flow chart of the refinement for the step 202 that the embodiment of the present invention 3 provides;
Figure 16 is the module map of the device of the segment encode in a kind of identification image that the embodiment of the present invention 4 provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Segment encode is a kind of mode in liquid crystal screen display number, and specifically, number is in the composition of a segmentation;One number A 8-shaped is all formed by pen section, shares 7 pen sections, respectively a to g sections, as shown in Figure 1, in segment encode the top transverse direction Section is a sections;There are two vertically disposed pen sections on the right side of segment encode, wherein the vertical pen section of top is b sections, the vertical pen of lower section Section is c sections;The lateral pen section of bottom is d sections in segment encode;There are two vertically disposed pen sections on the left of segment encode, wherein top Vertical pen section is f sections, and the vertical pen section of lower section is e sections;Between a sections and d sections, i.e., the lateral pen section in segment encode center is g sections;It utilizes Above-mentioned a to g sections, segment encode can show 0 to 9 number.
Embodiment 1
The embodiment of the present invention 1 provides a kind of method for identifying the segment encode in image, as shown in Figure 2, comprising:
Step S1: identification device obtains the wide as maximum abscissa value of image, obtains the high as maximum vertical seat of image Scale value;
Step S2: identification device is obtained according to the color, maximum abscissa value and maximum ordinate value of the pixel in image Take the first abscissa value and the second abscissa value of the segment encode in image;
Step S3: identification device is obtained according to the color of the pixel in the first abscissa value, the second abscissa value and image Take the first ordinate value and the second ordinate value of the segment encode in image;
Step S4: identification device is according to the first abscissa value, the second abscissa value, the first ordinate value and the second ordinate Value, obtains the coordinate of each section sampling area, is sampled in pen section sampling area;
Step S5: identification device obtains the pen section distribution situation of segment encode according to the sampled result of each section sampling area, The number indicated according to pen section distribution situation identification burst code.
Embodiment 2
The embodiment of the present invention 2 by image there are a segment encode for provide it is a kind of identification image in segment encode side Method, as shown in Figure 3, comprising:
Step 101: identification device obtains corresponding image according to the image path received, judges whether to obtain To corresponding image, it is to obtain the wide of image to be used as maximum abscissa value, obtains the height of image as maximum ordinate value, hold Otherwise row step 102 shows error message, terminate;
For example, the image that identification device is got is as shown in Figure 4;
In step 101, identification device get image after can also include: that identification device carries out school to the image got Just;
In step 101, it can also include: in image that identification device traversal is got after image that identification device, which is got, Pixel obtains the average value of the color of the pixel in image;Color in image is greater than the pixel of average value by identification device The color of point is set as white, and the color of remaining pixel is set as black;
In addition to this, in step 101, it can also include: that identification device obtains in image that identification device, which is got after image, Pixel color maximum value, according to pre-set color value and the maximum value of the color of the pixel in the image that gets Ratio carries out etc. than amplifying the color of the pixel in image;
Preferably, pre-set color value 255;
Step 102: identification device according to the color of the pixel in image, maximum abscissa value and maximum ordinate value, Obtain the first abscissa value x of the segment encode in image1With the second abscissa value x2, execute step 103;
In the present embodiment, the first abscissa value x of segment encode1For the upper left corner abscissa value of segment encode range, the second of segment encode Abscissa value x2For the lower right corner abscissa value of segment encode range;
Specifically, step 102 includes:
Step 102-A: identification device initializes the current abscissa value of segment encode, the first abscissa value x1With the second abscissa Value x2
Preferably, the current abscissa value of segment encode and the first abscissa value x1Initial value be 3;The horizontal seat of the second of segment encode Scale value x2Initial value be maximum abscissa value;In addition to this, the current abscissa value of segment encode and the first abscissa value x1Can also Think 0;
The present embodiment, the initial value by current abscissa value are 3, can reduce the frame of image with caused by color Interference improves the efficiency of the segment encode in identification image;
Step 102-B: identification device judges the black picture element that whether there is preset quantity in the corresponding column of current abscissa Point is to then follow the steps 102-C, otherwise updates current abscissa, return step 102-B;
Specifically, in the present embodiment, preset quantity can be the quantity for being previously written the fixation of identification device, be also possible to The quantity being calculated according to the height of the image got;For example, the height of image is obtained present count divided by the 4th preset value Amount;Wherein, the 4th preset value is 40, and in addition to this, the 4th preset value may be 35 or 30 etc.;
Preferably, preset quantity 3, in addition to this, preset quantity may be 2 or 4;Updating current abscissa is that will work as Preceding abscissa value adds 1 certainly;
Step 102-C: identification device is by the first abscissa value x of segment encode1It is set as current abscissa value, is updated current horizontal Coordinate executes step 102-D;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 102-D: whether identification device judges in the corresponding column of current abscissa to be white pixel point, is to execute Step 102-E, it is no to then follow the steps 102-F;
Step 102-E: identification device is by the second abscissa value x of segment encode2It is set as current abscissa value, executes step 103;
Step 102-F: identification device judges whether current abscissa reaches maximum abscissa value, is to then follow the steps 103, Otherwise current abscissa, return step 102-D are updated;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
For example, as shown in figure 5, the first abscissa value x that identification device is got1It is 16, the second abscissa value x2It is 54;
Step 103: identification device is according to the first abscissa value x of the segment encode in image1, the second abscissa value x2And image In pixel color, obtain image in segment encode the first ordinate value y1With the second ordinate value y2, execute step 104;
In the present embodiment, the first ordinate value y of segment encode1For the upper left corner ordinate value of segment encode range, the second of segment encode Ordinate value y2For the lower right corner ordinate value of segment encode range;
Identification device gets the first abscissa value x of the segment encode in image1, the second abscissa value x2, the first ordinate value y1With the second ordinate value y2Afterwards to get the segment encode range into image;
Specifically, step 103 includes:
Step 103-A: identification device initializes the first ordinate value y of the current ordinate value of segment encode, segment encode1With second Ordinate value y2
Preferably, current ordinate value and the first ordinate value y1Initial value be 3, at the beginning of the second ordinate value of segment encode Initial value is the maximum ordinate value of image;In addition to this, current ordinate value and the first ordinate value y1Initial value can also be with It is 0;
In the present embodiment, the initial value of current ordinate value is 3, can reduce the frame of image with dry caused by color It disturbs, improves the efficiency of the segment encode in identification image;
Step 103-B: identification device judges the first abscissa value in the corresponding row of current ordinate value to the second horizontal seat The black pixel point that whether there is preset quantity in the range of scale value, is to then follow the steps 103-D, no to then follow the steps 103-C;
Specifically, in the present embodiment, preset quantity can be the quantity for being previously written the fixation of identification device, be also possible to The quantity being calculated according to the height of the image got;For example, the height of image is obtained present count divided by the 4th preset value Amount;Wherein, the 4th preset value is 40, and in addition to this, the 4th preset value may be 35 or 30 etc.;
Preferably, preset quantity 3, in addition to this, preset quantity may be 2 or 4;
Step 103-C: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, otherwise update current ordinate value, return step 103-B;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 103-D: identification device judges whether current ordinate value is greater than the first numerical value, is to then follow the steps 103-F, It is no to then follow the steps 103-E;
Preferably, the first numerical value is the 1/3 of the maximum ordinate value of image, and in addition to this, the first numerical value may be figure The 1/4 of the maximum ordinate value of picture;
Step 103-E: identification device is by the first ordinate value y of segment encode1It is updated to current ordinate value, executes step 103-F;
Step 103-F: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, current ordinate value is otherwise updated, step 103-G is executed;
Step 103-G: identification device judges the first abscissa value in the corresponding row of current ordinate value to the second horizontal seat Whether it is white pixel point in the range of scale value, is to then follow the steps 103-H, otherwise return step 103-F;
Step 103-H: identification device judges whether current ordinate value is greater than second value, is to then follow the steps 103-I, Otherwise current ordinate value, return step 103-B are updated;
Preferably, second value is the 2/3 of the maximum ordinate value of image, and in addition to this, second value may be figure The 3/4 of the maximum ordinate value of picture;
Step 103-I: identification device is by the second ordinate value y of segment encode2It is updated to current ordinate value;
Step 103-J: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, otherwise update current ordinate value, return step 103-B;
For example, as shown in fig. 6, the first ordinate value y that identification device is got1It is 11, the second ordinate value y2It is 123;
Step 104: identification device is according to the first abscissa value x of segment encode1, the second abscissa value x2, the first ordinate value y1 With the second ordinate value y2, judge whether the ratio of the height and the width of segment encode range is greater than third preset value, be to execute step Rapid 105, it is no to then follow the steps 106;
Preferably, third preset value is 3, and in addition to this, third preset value may be 4;
Step 105: identification device identifies that the segment encode indicates number 1, terminates;
For example, in the present embodiment, as shown in fig. 7, if the first abscissa value x that identification device is got1It is 29, second is horizontal Coordinate value x2It is 48;First ordinate value y1It is 20, the second ordinate value y2It is 118, then the height of segment encode range: i.e. second is vertical Coordinate value y2Subtract the first ordinate value y1It is 98, the width of segment encode range: i.e. the second abscissa value x2Subtract the first abscissa value x1It is 19, then the ratio of the height and the width of segment encode range is 5.16, and the ratio of the height and the width of segment encode range is greater than third Preset value, it is determined that the segment encode indicates number 1;
Step 106: identification device is according to the first abscissa value x of segment encode1, the second abscissa value x2, the first ordinate value y1 With the second ordinate value y2, the coordinate of each section sampling area is obtained, is sampled in pen section sampling area, judges pen section Whether the corresponding pen section of sampling area is shown, and is, a segment identification corresponding with pen section sampling area in identification device is set Position executes step 107, no to then follow the steps 107;
After the step, before execution step 107 further include: identification device judges whether deposit in each section sampling area In white pixel point, it is to then follow the steps 107, otherwise returns to error message, terminates;
The quantity for the pen section sampling area that identification device obtains is at least 7, and each of segment encode section is at least one corresponding Section sampling area;
For example, there is 7 segment identifications in identification device, respectively a segment identification to g segment identification is respectively used to mark segment encode A to g sections whether be shown;In the present embodiment, the quantity for the pen section sampling area that identification device obtains is 7, i.e. the first stroke Section sampling area is corresponding with 7 pen sections respectively to the 7th section sampling area;The initial shape of each segment identification in identification device State is to reset;
Specifically, step 106 includes:
If identification device is judged in the first stroke section sampling area in image there are the black pixel point of preset quantity, Determine that a section of segment encode is shown, identification device is by a segment identification set;
Specifically, which includes:
Step 106-1A: identification device initializes current abscissa value, current ordinate value and the first quantity;
Preferably, the initial value of the first quantity is 0;
Step 106-1B: identification device judges corresponding current pixel according to current abscissa value and current ordinate value Whether point is black pixel point, is to update the first quantity, executes step 106-1C, no to then follow the steps 106-1C;
Preferably, updating the first quantity is that the first quantity is added 1 certainly;
Step 106-1C: identification device judges whether current ordinate value reaches pen section sampling area maximum ordinate value, It is to then follow the steps 106-1D, otherwise updates current ordinate value, return step 106-1B;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 106-1D: identification device judges whether current abscissa value reaches pen section sampling area maximum abscissa value, It is to then follow the steps 106-1E, otherwise updates current abscissa value, return step 106-1B;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 106-1E: identification device judges whether the first quantity reaches preset quantity, is, identification device determines first There are the black pixel points of preset quantity in region, by a segment identification set, otherwise determine and preset quantity is not present in first area Black pixel point;
Preferably, the first stroke section sampling area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is the first ordinate value y1To the second ordinate value y2Subtract Remove the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded, i.e., Region, then preset quantity be 3;
If the first stroke section sampling area is above-mentioned region, step 106-1A is into step 106-1E: current abscissa The initial value of value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate The initial value of value is the first ordinate value y1;The first stroke section sampling area maximum ordinate value is the second ordinate value y2Subtract One ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded;The first stroke section sampling area maximum abscissa value For the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
In addition to this, the first stroke section sampling area can be with are as follows: abscissa is the first abscissa value x1In addition the second horizontal seat Scale value x2Sum 1/2 subtract 2 again after be rounded to the first abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again, I.e.Ordinate is the first ordinate value y1To the second ordinate value y2Subtract first Ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded, i.e.,Region, Then preset quantity is 10;
If the first stroke section sampling area is above-mentioned region, step 106-1A is into step 106-1E: current abscissa The initial value of value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate The initial value of value is the first ordinate value y1;The first stroke section sampling area maximum ordinate value is the second ordinate value y2Subtract One ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded;The first stroke section sampling area maximum abscissa value For the first abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again;
It should be noted that the first stroke section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that the first stroke section sampling area is at least partially overlapped with a of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in second section sampling area in image there are the black pixel point of preset quantity, Determine that the b section of segment encode is shown, identification device is by b segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, second section sampling area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded to the second abscissa value x2, i.e.,Ordinate is the second vertical seat Scale value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded, i.e.,Region, then preset quantity be 3;
If second section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After take It is whole;Second section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 again In addition the first ordinate value y1After be rounded;Region maximum abscissa value is the second abscissa value x2
In addition to this, second section sampling area can be with are as follows: abscissa is the first abscissa value x1In addition the second horizontal seat Scale value x2Sum 1/2 subtract 2 again after be rounded to the second abscissa value x2, i.e.,Ordinate For the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after subtracting 1 to the Two ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after adding 1, i.e.,Region, then preset quantity be 10;
If second section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After subtracting 1 It is rounded;Second section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 Along with the first ordinate value y1It is rounded after adding 1;Second section sampling area maximum abscissa value is the second abscissa value x2
It should be noted that second section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that second section sampling area is at least partially overlapped with the b of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in the third pen section sampling area in image there are the black pixel point of preset quantity, Determine that the c section of segment encode is shown, identification device is by c segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, third pen section sampling area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded to the second abscissa value x2, i.e.,Ordinate is the second ordinate Value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded, i.e., Region, then preset quantity be 3;
If third pen section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After take It is whole;Third pen section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 again In addition the first ordinate value y1After be rounded;Third pen section sampling area maximum abscissa value is the second abscissa value x2
In addition to this, third pen section sampling area can be with are as follows: abscissa is the first abscissa value x1In addition the second horizontal seat Scale value x2Sum 1/2 subtract 2 again after be rounded to the second abscissa value x2, i.e.,Ordinate For the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after subtracting 1 to the Two ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after adding 1, i.e.,Region, then preset quantity be 10;
If third pen section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After subtracting 1 It is rounded;Third pen section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 Along with the first ordinate value y1It is rounded after adding 1;Third pen section sampling area maximum abscissa value is the second abscissa value x2
It should be noted that third pen section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that third pen section sampling area is at least partially overlapped with the c of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in the 4th section sampling area in image there are the black pixel point of preset quantity, Determine that the d section of segment encode is shown, identification device is by d segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, the 4th section sampling area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded to the second ordinate value y2, i.e., Region, then preset quantity be 3;
If the 4th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After take It is whole;4th section sampling area maximum ordinate value is the second ordinate value y2;4th section sampling area maximum abscissa value For the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
In addition to this, the 4th section sampling area can be with are as follows: abscissa is the first abscissa value x1In addition the second horizontal seat Scale value x2Sum 1/2 subtract 2 again after be rounded to the first abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again, I.e.Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded to the second ordinate value y2, i.e.,Area Domain, then preset quantity is 10;
If the 4th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After take It is whole;4th section sampling area maximum ordinate value is the second ordinate value y2;4th section sampling area maximum abscissa value For the first abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again;
It should be noted that the 4th section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that the 4th section sampling area is at least partially overlapped with the d of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in the 5th section sampling area in image there are the black pixel point of preset quantity, Determine that the e section of segment encode is shown, identification device is by e segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, the 5th section sampling area are as follows: abscissa is the first abscissa value x1To the first abscissa value x1In addition the Two abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is the second ordinate value y2 Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded, i.e.,'s Region, then preset quantity is 3;
If the 5th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1, the initial value of current ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded;5th section sampling area maximum ordinate value is the second vertical seat Scale value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded;5th section sampling area Maximum abscissa value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
In addition to this, the 5th section sampling area can be with are as follows: abscissa is the first abscissa value x1To the first abscissa Value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is Two ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after subtracting 1 to second and indulges Coordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after adding 1, i.e.,Region, then preset quantity be 10;
If the 5th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1, the initial value of current ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after subtracting 1;5th section sampling area maximum ordinate value is second Ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded after adding 1;5th section Sampling area maximum abscissa value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
It should be noted that the 5th section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that the 5th section sampling area is at least partially overlapped with the e of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in the 6th section sampling area in image there are the black pixel point of preset quantity, Determine that the f section of segment encode is shown, identification device is by f segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, the 6th section sampling area are as follows: abscissa is the first abscissa value x1To the first abscissa value x1In addition the Two abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded, i.e., Region, then preset quantity be 3;
If the 6th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1, the initial value of current ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded;6th section sampling area maximum ordinate value is the second vertical seat Scale value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded;6th section sampling area Maximum abscissa value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
In addition to this, the 6th section sampling area can be with are as follows: abscissa is the first abscissa value x1To the first abscissa Value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is Second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after subtracting 1 to second Ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after adding 1, i.e.,Region, then preset quantity be 10;
If the 6th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1, the initial value of current ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after subtracting 1;6th section sampling area maximum ordinate value is second Ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1It is rounded after adding 1;6th section Sampling area maximum abscissa value is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded;
It should be noted that the 6th section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that the 6th section sampling area is at least partially overlapped with the f of segment encode section and not It is overlapped with other sections of segment encode;
In addition to this, step 106 further include:
If identification device is judged in the 7th section sampling area in image there are the black pixel point of preset quantity, Determine that the g section of segment encode is shown, identification device is by g segment identification set;
Specifically, the concrete methods of realizing of the step is identical to step 106-1E as step 106-1A;
Preferably, the 7th section sampling area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, i.e.,Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded to the second ordinate value y2Subtract the first ordinate value y1Difference Add the first ordinate value y in the 3/4 of value1After be rounded, i.e.,Region, Then preset quantity is 3;
If the 7th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After take It is whole;7th section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 again In addition the first ordinate value y1After be rounded;7th section sampling area maximum abscissa value is the first abscissa value x1In addition second Abscissa value x2Sum 1/2 subtract 2 again after be rounded;
In addition to this, the 7th section sampling area can be with are as follows: abscissa is the first abscissa value x1In addition the second horizontal seat Scale value x2Sum 1/2 subtract 2 again after be rounded to the first abscissa value x1To the first abscissa value x1In addition the second abscissa value x2 Sum 1/2 after be rounded, i.e.,Ordinate is the second ordinate value y2Subtract first Ordinate value y1Difference 1/4 add the first ordinate value y1After be rounded to the second ordinate value y2Subtract the first ordinate Value y1Difference 3/4 add the first ordinate value y1After be rounded, i.e., Region;
If the 7th section sampling area is above-mentioned region, in the concrete methods of realizing of the step: current abscissa value Initial value be the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded, current ordinate value Initial value be the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 add the first ordinate value y1After take It is whole;7th section sampling area maximum ordinate value is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 again In addition the first ordinate value y1After be rounded;7th section sampling area maximum abscissa value is the first abscissa value x1To the first cross Coordinate value x1In addition the second abscissa value x2Sum 1/2 be rounded again;
It should be noted that the 7th section sampling area is not limited to the above two region provided, it can also be basic herein On moved up, move down, expand or shrink, so that the 7th section sampling area is at least partially overlapped with the g of segment encode section and not It is overlapped with other sections of segment encode;
For example, as shown in figure 8, identification device sets a segment identification, c segment identification, d segment identification, f segment identification and g segment identification Position;
Step 107: identification device identifies the number that the segment encode indicates according to each segment identification, identifies segment encode expression Number, terminate;
Specifically, the original state of each segment identification in identification device is to reset;
For example, identification device is according to a segment identification, c segment identification, d segment identification, f segment identification and g segment identification set, b segment identification It is resetted with e segment identification, identifies that the number that the segment encode indicates is 5, identifying the segment encode is 5, is terminated;
Specifically, step 107 includes:
If identification device judges a segment identification, b segment identification, c segment identification, d segment identification, e segment identification and f segment identification set, And g segment identification resets, then identification device identifies that the segment encode indicates number 0;
If identification device judges a segment identification, b segment identification, d segment identification, e segment identification and g segment identification set, and c sections Mark and f segment identification reset, then identification device identifies that the segment encode indicates number 2;
If identification device judges a segment identification, b segment identification, c segment identification, d segment identification and g segment identification set, and e sections Mark and f segment identification reset, then identification device identifies that the segment encode indicates number 3;
If identification device judges b segment identification, c segment identification, f segment identification, g segment identification set, and a segment identification, d segment mark Know and e segment identification resets, then identification device identifies that the segment encode indicates number 4;
If identification device judges a segment identification, c segment identification, d segment identification, f segment identification and g segment identification set, and b sections Mark and e segment identification reset, then identification device identifies that the segment encode indicates number 5;
If identification device judges a segment identification, c segment identification, d segment identification, e segment identification, f segment identification and g segment identification set, And b segment identification resets, then identification device identifies that the segment encode indicates number 6;
If identification device judges a segment identification, b segment identification and c segment identification set, and d segment identification, e segment identification, f sections Mark and g segment identification reset, then identification device identifies that the segment encode indicates number 7;
If identification device judges a segment identification, b segment identification, c segment identification, d segment identification, e segment identification, f segment identification and g sections Equal set is identified, then identification device identifies that the segment encode indicates number 8;
If identification device judges that a segment identification, b segment identification, c segment identification, d segment identification, f segment identification and g segment identification are set Position, and e segment identification resets, then and identification device identifies that the segment encode indicates number 9;
In addition to this, step 107 further include: identification device identifies the character that the segment encode indicates according to each segment identification, Identify the character of segment encode expression;
Specifically, step 107 further include:
If identification device judges a segment identification, d segment identification, e segment identification and the equal set of f segment identification, and b segment identification, c Segment identification and g segment identification reset, then identification device identifies that the segment encode indicates character C;
If identification device judges a segment identification, d segment identification, e segment identification, f segment identification and g segment identification set, and b Segment identification and c segment identification reset, then identification device identifies that the segment encode indicates character E;
If identification device judges a segment identification, e segment identification, f segment identification and g segment identification set, and b segment identification, c Segment identification and d segment identification reset, then identification device identifies that the segment encode indicates character F;
If identification device judges b segment identification, c segment identification, e segment identification, f segment identification and g segment identification set, and a Segment identification and d segment identification reset, then identification device identifies that the segment encode indicates character H;
If identification device judges d segment identification, e segment identification and the equal set of f segment identification, and a segment identification, b segment identification, c Segment identification and g segment identification reset, then identification device identifies that the segment encode indicates character L;
If identification device judges a segment identification, b segment identification, e segment identification, f segment identification and g segment identification set, and c Segment identification and d segment identification reset, then identification device identifies that the segment encode indicates character P;
If identification device judges b segment identification, c segment identification, d segment identification, e segment identification and the equal set of f segment identification, and a Segment identification and g segment identification reset, then identification device identifies that the segment encode indicates character U;
In addition to this, step 107 further include: if identification device judges that the segment encode is not belonging to according to each segment identification Number or character are stated, then shows error message, is terminated;
In addition to this, following steps can also be performed to identify the segment encode in image in identification device:
Identification device directly executes step 106 after executing the step 103, and identification device judges a in step 107 It include: identification dress after segment identification, b segment identification, c segment identification, d segment identification, e segment identification, f segment identification and the equal set of g segment identification Set according to the first abscissa value, the second abscissa value, the first ordinate value and the second ordinate value, obtain the first inspection area and The coordinate of second inspection area is sampled in the first inspection area and the second inspection area, judge the first inspection area and It whether there is white pixel point in second inspection area, if there is white pixel in the first inspection area and the second inspection area Point, then identification device identifies to obtain segment encode as number 8;If there is no white pictures in the first inspection area and the second inspection area Vegetarian refreshments, then identification device identifies to obtain segment encode as number 1;If a region in the first inspection area and the second inspection area is deposited In white pixel point, another region is not present white pixel point, then shows error message, terminates;
Specifically, the first inspection area is the center in the region that pen section a, pen section b, pen section g and pen section f are surrounded, the first inspection Look into the center that region is the region that pen section c, pen section d, pen section e and pen section g are surrounded;
Preferably, the first inspection area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/ 2 subtract 2 again after be rounded to the first abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again, i.e.,Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 adds the first ordinate value y1After be rounded to the second ordinate value y2Subtract the first ordinate value y1Difference 1/4 again plus Upper first ordinate value y1It is rounded again plus after 2, i.e.,Region;Second Inspection area are as follows: abscissa is the first abscissa value x1In addition the second abscissa value x2Sum 1/2 subtract 2 again after be rounded to the One abscissa value x1In addition the second abscissa value x2Sum 1/2 be rounded again, i.e., Ordinate is the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1After be rounded To the second ordinate value y2Subtract the first ordinate value y1Difference 3/4 add the first ordinate value y1It is rounded again plus after 2, I.e.Region;
In the present embodiment, step 102 is as shown in figure 9, specifically include:
Step 102-1: the current abscissa value of identification device initialization segment encode and current ordinate value;
Preferably, the current abscissa value of segment encode and the initial value of current ordinate value are 3, in addition to this, current horizontal The initial value of coordinate value and current ordinate value may be 0;In the present embodiment, current abscissa value and current ordinate value Initial value is 3, can reduce the frame of image with interference caused by color, improves the efficiency of the segment encode in identification image;
Step 102-2: identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is black pixel point according to the color value of current pixel point, be to then follow the steps 102-4, it is no to then follow the steps 102-3;
Specifically, in the present embodiment, identification device according to the color value of current pixel point judge current pixel point whether be Black pixel point, specifically: identification device judges whether the color value of current pixel point is the first preset value, is then determining current Pixel is black pixel point, otherwise determines that current pixel point is not black pixel point;
Preferably, the first preset value is 0;In the present embodiment, if the color value of pixel is 0, the color of the pixel For black;
In addition to this, in the present embodiment, whether identification device judges current pixel point according to the color value of current pixel point It, can be with for black pixel point are as follows: identification device judges that the color value of current pixel point is then determining whether in the first range Current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
Preferably, the first range be 0 to 50, in addition to this, the first range may be 0 to 5,0 to 10,0 to 20,0 to 35 etc.;
Step 102-3: identification device judges whether current ordinate value reaches maximum ordinate value, is then to update current cross Coordinate value initializes current ordinate value and the first pixel quantity, otherwise return step 102-2 updates current ordinate value, Return step 102-2;
Preferably, the first pixel quantity initial value is 0;In the present embodiment, the first pixel quantity is for recording image The quantity of middle black pixel point;Updating current ordinate value is that current ordinate value is added 1 certainly;Current abscissa value is updated to incite somebody to action Current abscissa value adds 1 certainly;
Step 102-4: identification device updates the first pixel quantity, judges whether updated first pixel quantity reaches It is to then follow the steps 102-6 to the first quantity, it is no to then follow the steps 102-5;
Preferably, updating the first pixel quantity is by the first pixel quantity from adding 1, and the first quantity is 3;
Step 102-5: identification device judges whether current ordinate value reaches maximum ordinate value, is then to update current cross Coordinate value initializes current ordinate value and the first pixel quantity, otherwise return step 102-2 updates current ordinate value, Return step 102-2;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;Update current abscissa value be will be current Abscissa value adds 1 certainly;
Step 102-6: identification device is by the first abscissa value x of segment encode1It is set as current abscissa value, initialization first Pixel quantity;
Step 102-7: identification device updates current abscissa value, initializes current ordinate value;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 102-8: identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is white pixel point according to the color value of current pixel point, be to then follow the steps 102-10, it is no to then follow the steps 102-9;
Specifically, in the present embodiment, identification device according to the color value of current pixel point judge current pixel point whether be White pixel point, specifically: identification device judges whether the color value of current pixel point is the second preset value, is then determining current Pixel is white pixel point, otherwise determines that current pixel point is not white pixel point;
Preferably, the second preset value is 255;In the present embodiment, if the color value of pixel is 255, the pixel Color is white;
In addition to this, in the present embodiment, whether identification device judges current pixel point according to the color value of current pixel point It, can be with for white pixel point are as follows: identification device judges that the color value of current pixel point is then determining whether in the second range Current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point;
Preferably, the second range is 250 to 255, in addition to this, the second range may be 250 to 255,245 to 255, 235 to 255,220 to 255 etc.;
Step 102-9: identification device judges whether current abscissa reaches maximum abscissa value, is to then follow the steps S3, Otherwise current abscissa, return step 102-7 are updated;
Step 102-10: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps Otherwise 102-11 updates current ordinate value, return step 102-8;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 102-11: identification device is by the second abscissa value x of segment encode2It is set as current abscissa value, executes step 103;
In the present embodiment, step 103 as shown in Figure 10, is specifically included:
Step 103-1: identification device initialize the current abscissa value of segment encode, current ordinate value, segment encode it is first vertical Coordinate value y1With the second ordinate value y2
Preferably, current ordinate value and the first ordinate value y1Initial value be 3, current abscissa value initial value is First abscissa value x of segment encode1;Second ordinate value y of segment encode2Initial value is the maximum ordinate value of image;In addition to this, Current ordinate value and the first ordinate value y1Initial value may be 0
Step 103-2: identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is black pixel point according to the color value of current pixel point, be to then follow the steps 103-5, it is no to then follow the steps 103-3;
Specifically, the step is identical as the judgment method of step 102-2;
Step 103-3: identification device judges whether current abscissa value reaches the second abscissa value x of segment encode2, it is to hold Otherwise row step 103-4 updates current abscissa value, return step 103-2;
Preferably, the second pixel quantity initial value is 0;In the present embodiment, the second pixel quantity is for recording image The quantity of middle black pixel point;Updating current abscissa value is that current abscissa value is added 1 certainly;
Step 103-4: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, current ordinate value is otherwise updated, current abscissa value and the second pixel quantity, return step 103-2 are initialized;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 103-5: identification device updates the second pixel quantity, judges whether updated second pixel quantity reaches It is to then follow the steps 103-8 to the second quantity, it is no to then follow the steps 103-6;
Preferably, updating the second pixel quantity is by the second pixel quantity from adding 1, and the second quantity is 3;
Step 103-6: identification device judges whether current abscissa value reaches the second abscissa value x of segment encode2, it is then first The second pixel quantity of beginningization executes step 103-7, otherwise updates current abscissa value, return step 103-2;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;Update current abscissa value be will be current Abscissa value adds 1 certainly;
Step 103-7: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, current ordinate value is otherwise updated, current abscissa value, return step 103-2 are initialized;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 103-8: identification device judges whether current ordinate value is greater than the first numerical value, is to then follow the steps 103- 10, no to then follow the steps 103-9:
Preferably, the first numerical value is the 1/3 of the maximum ordinate value of image, and in addition to this, the first numerical value may be figure The 1/4 of the maximum ordinate value of picture;
Step 103-9: identification device is by the first ordinate value y of segment encode1It is updated to current ordinate value, initialization second Pixel quantity executes step 103-10;
Step 103-10: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, current ordinate value is otherwise updated, current abscissa value is initialized, executes step 103-11;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 103-11: identification device obtains corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point, is to then follow the steps 103-12, otherwise return step 103-10;
Specifically, the step is identical as the judgment method of step 102-8;
Step 103-12: identification device judges whether current abscissa value reaches the second abscissa value x of segment encode2, it is then Step 103-13 is executed, current abscissa value, return step 103-11 are otherwise updated;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 103-13: identification device judges whether current ordinate value is greater than second value, is to then follow the steps 103- 14, current ordinate value is otherwise updated, current abscissa value, return step 103-2 are initialized;
Preferably, second value is the 2/3 of the maximum ordinate value of image, and in addition to this, second value may be figure The 3/4 of the maximum ordinate value of picture;
Step 103-14: identification device is by the second ordinate value y of segment encode2It is updated to current ordinate value;
Step 103-15: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 104, current ordinate value is otherwise updated, current abscissa value, return step 103-2 are initialized;
A kind of method of the identification segment encode provided in the present embodiment obtains in image according to the pixel color in image Segment encode range, the pen section of segment encode is judged further according to segment encode range, to identify the number that segment encode indicates.Identification device does not depend on It in presetting fixed coordinate, deposits in the picture in case of interferers, still can correctly draw a circle to approve out the range of segment encode, to guarantee The normality of data acquisition, strong interference immunity during analyzing segment encode.
Embodiment 3
The embodiment of the present invention 3 by image there are multiple segment encodes for provide it is a kind of identification image in segment encode side Method, as shown in figure 11, comprising:
Step 201: identification device obtains corresponding image according to the image path received, judges whether to obtain To corresponding image, it is to obtain the long of image to be used as maximum abscissa value, obtains the height of image as maximum ordinate value, hold Otherwise row step 202 shows error message, terminate;
For example, the image that identification device is got is as shown in figure 12;
In the step, identification device get image after can also include: that identification device carries out school to the image got Just;
In step 201, it can also include: in image that identification device traversal is got after image that identification device, which is got, Pixel obtains the average value of the color of the pixel in image;Color in image is greater than the pixel of average value by identification device The color of point is set as white, and the color of remaining pixel is set as black;
In addition to this, in step 201, it can also include: that identification device obtains in image that identification device, which is got after image, The maximum value of the color of pixel, according to the ratio of the maximum value of the color of pixel in pre-set color value and the image got Value carries out etc. than amplifying the color of pixel in image;
Preferably, pre-set color value 255;
Step 202: identification device obtains the first cross of each segment encode in image according to the color of the pixel in image Coordinate value and the second abscissa value execute step 203;
For example, as shown in figure 13, the first abscissa value and second of each segment encode in the image that identification device is got Abscissa value is respectively as follows: the first abscissa value x of first segment encode11It is 16, the second abscissa value x12It is 54;Second segment encode The first abscissa value x21It is 89, the second abscissa value x22It is 108;First abscissa value x of third segment encode31It is 114, the Two abscissa value x32It is 156;First abscissa value x of the 4th segment encode41It is 170, the second abscissa value x42It is 214;5th First abscissa value x of segment encode51It is 233, the second abscissa value x52It is 266;First abscissa value x of the 6th segment encode61For 268, the second abscissa value x62It is 316;
Step 203: the first abscissa value of segment encode and the quantity of the second abscissa value that identification device judgement is got are It is no identical as preset coordinate logarithm, it is to then follow the steps 204, otherwise prompts mistake, terminates;
Preferably, preset coordinate logarithm is 6, i.e., the quantity of preset segment encode has 6 in identification device;Identification device judgement Whether the first abscissa value of the segment encode got and the quantity of the second abscissa value are 6, are to then follow the steps 204, no Mistake is then prompted, is terminated;
Step 204: identification device initializes current segment encode;
Preferably, current segment encode is initially first segment encode in image;
Step 205: identification device is according to the pixel in the first abscissa value, the second abscissa value and image of current segment encode The color of point, obtains the first ordinate value and the second ordinate value of current segment encode;
Specifically, the concrete methods of realizing of the step is identical as the implementation method of step 103 in embodiment 1;
For example, the first abscissa value x of current segment encode11It is 16, the second abscissa value x12It is 54, what is got works as leading portion First ordinate value y of code11It is 11, the second ordinate value y12It is 123;
Step 206: identification device judges whether the segment encode that the first ordinate value and the second ordinate value also has not been obtained, and is Current segment encode is then updated, return step 205 is no to then follow the steps 207;
For example, updating current segment encode is using the next segment encode of current segment encode as updated current segment encode;Such as Figure 14 institute Show, the first ordinate value and the second ordinate value of each segment encode in the image that identification device is got are respectively as follows: first First ordinate value y of segment encode11It is 11, the second ordinate value y12It is 123;First ordinate value y of second segment encode21It is 20, Second ordinate value y22It is 118;First ordinate value y of third segment encode31It is 12, the second ordinate value y32It is 123;4th First ordinate value y of a segment encode41It is 11, the second ordinate value y42It is 123;First ordinate value y of the 5th segment encode51For 11, the second ordinate value y52It is 116;First ordinate value y of the 6th segment encode61It is 11, the second ordinate value y62It is 123;
Step 207: identification device initializes current segment encode;
For example, first be initially in image the segment encode of current segment encode;
Step 208: identification device is according to the first abscissa value, the second abscissa value, the first ordinate value of current segment encode With the second ordinate value, judge whether the ratio of the height and the width of current segment encode range is greater than third preset value, is to execute Step 209, no to then follow the steps 210;
Preferably, third preset value is 3, and in addition to this, third preset value may be 4;
For example, the first abscissa value x of first segment encode11It is 16, the second abscissa value x12It is 54, the first ordinate value y11It is 11, the second ordinate value y12It is 123, then the height of segment encode range: i.e. the second ordinate value y2Subtract the first ordinate value y1It is 112, the width of segment encode range: i.e. the second abscissa value x2Subtract the first abscissa value x1It is 38, then the height of segment encode range Ratio with width is 2.95, and the ratio of the height and the width of segment encode range is less than third preset value, thens follow the steps 210;
For another example, the first abscissa value x of second segment encode21It is 89, the second abscissa value x22It is 108;First ordinate value y21It is 20, the second ordinate value y22It is 118, then the height of segment encode range: i.e. the second ordinate value y2Subtract the first ordinate value y1It is 98, the width of segment encode range: i.e. the second abscissa value x2Subtract the first abscissa value x1It is 19, then the height of segment encode range Ratio with width is 5.16, and the ratio of the height and the width of segment encode range is greater than third preset value, thens follow the steps 209;
Step 209: identification device identifies that current segment encode indicates number 1, executes step 212;
Step 210: identification device is according to the first abscissa value, the second abscissa value, the first ordinate value of current segment encode With the second ordinate value, the coordinate of each section sampling area of current segment encode is obtained, is sampled in pen section sampling area, Judge whether the corresponding pen section of pen section sampling area is shown, be, a segment identification corresponding with the region in identification device is set Position executes step 211, no to then follow the steps 211;
The step further include: identification device judges with the presence or absence of white pixel point in each section sampling area, is to hold Otherwise row step 211 returns to error message, terminate;
Specifically, the concrete methods of realizing of the step is identical as the implementation method of step 106 in embodiment 1;
Step 211: identification device identifies the number that current segment encode indicates, identifies the segment encode table according to each segment identification The number shown;
Specifically, the concrete methods of realizing of the step is identical as the implementation method of step 107 in embodiment 1;
Step 212: identification device judges whether that there are also unidentified segment encodes, is to update current segment encode, initialization identification Otherwise each segment identification in device, return step 208 terminate.
Specifically, the original state of each segment identification in identification device is to reset;
In the present embodiment, step 202 as shown in figure 15, is specifically included:
Specifically, which includes:
Step 202-1: identification device initializes current abscissa value and current ordinate value;
Preferably, the initial value of current abscissa value and current ordinate value is 3, in addition to this, current abscissa value Initial value with current ordinate value may be 0;In the present embodiment, by the initial of current abscissa value and current ordinate value Value is 3, can reduce the frame of image with interference caused by color, improves the efficiency of the segment encode in identification image;
Step 202-2: identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is black pixel point according to the color value of current pixel point, be to then follow the steps 202-5, it is no to then follow the steps 202-3;
Specifically, the step is identical as the judgment method of 1 step 102-2 of embodiment;
Step 202-3: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps 202-4;Otherwise current ordinate value, return step 202-2 are updated;
Preferably, the first pixel quantity initial value is 0;In the present embodiment, the first pixel quantity is for recording image The quantity of middle black pixel point;Updating current ordinate value is that current ordinate value is added 1 certainly;
Step 202-4: identification device judges whether current abscissa value reaches maximum abscissa value, is to then follow the steps 203, current abscissa value is otherwise updated, current ordinate value and the first pixel quantity, return step 202-2 are initialized;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 202-5: identification device updates the first pixel quantity, judges whether updated first pixel quantity reaches It is to then follow the steps 202-8 to the first quantity, it is no to then follow the steps 202-6;
Preferably, updating the first pixel quantity is by the first pixel quantity from adding 1, and the first quantity is 3;
Step 202-6: identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps Otherwise 202-7 updates current ordinate value, return step 202-2;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 202-7: identification device judges whether current abscissa value reaches maximum abscissa value, is to then follow the steps 203, current abscissa value is otherwise updated, current ordinate value and the first pixel quantity, return step 202-2 are initialized;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 202-8: identification device is by the first abscissa value x of current segment encode1It is set as current abscissa value, is initialized First pixel quantity;
Preferably, first be initially in image the segment encode of current segment encode;
Step 202-9: identification device judges whether current abscissa value reaches maximum abscissa value, is to then follow the steps 203, current abscissa value is otherwise updated, current ordinate value is initialized;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;
Step 202-10: identification device obtains corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point, is to then follow the steps 202-11, otherwise return step 202-9;
Specifically, the step is identical as the judgment method of step 102-8;
Step 202-11: judging whether current ordinate value reaches maximum ordinate value, is to then follow the steps 202-12, no Then update current ordinate value, return step 202-10;
Preferably, updating current ordinate value is that current ordinate value is added 1 certainly;
Step 202-12: the second abscissa value of current segment encode is set current abscissa value by identification device;
Step 202-13: identification device judges whether current abscissa value reaches maximum abscissa value, is to then follow the steps 203, current segment encode is otherwise updated, current abscissa value is updated, initializes current ordinate value, return step 202-2;
Preferably, updating current abscissa value is that current abscissa value is added 1 certainly;Update current segment encode be by image when Next segment encode of preceding segment encode is as updated current segment encode;
A kind of method of the segment encode in identification image provided in the present embodiment, obtains according to the pixel color in image Segment encode range in image, the pen section of segment encode is judged further according to segment encode range, to identify the number that segment encode indicates.Identification dress The coordinate independent of default fixation is set, is deposited in the picture in case of interferers, the model of segment encode still can be correctly drawn a circle to approve out It encloses, to guarantee the normality of data acquisition during analyzing segment encode, strong interference immunity.
Embodiment 4
The embodiment of the present invention 4 provides a kind of device for identifying the segment encode in image, as shown in figure 16, comprising: first It obtains module 401, second and obtains module 402, third acquisition module 403, sampling module 404 and identification module 405;
First obtains module 401, for obtaining the wide as maximum abscissa value of image, obtains the high as maximum of image Ordinate value;
Second obtains module 402, for being got according to color, the first acquisition module 401 of the pixel in image Maximum abscissa value and maximum ordinate value obtain the first abscissa value and the second abscissa value of the segment encode in image;
Third obtains module 403, for being got according to color, the second acquisition module 402 of the pixel in image First abscissa value and the second abscissa value obtain the first ordinate value and the second ordinate value of the segment encode in image;
Sampling module 404, the first abscissa value and the second abscissa for being got according to the second acquisition module 402 Value, third obtain the first ordinate value and the second ordinate value that module 403 is got, obtain the seat of each section sampling area Mark, is sampled in pen section sampling area;
Identification module 405, the sampled result of each section sampling area for being obtained according to sampling module 404, obtains The pen section distribution situation of segment encode, the number indicated according to pen section distribution situation identification burst code.
Device further includes first judgment module, for obtaining corresponding image, judgement is according to the image path received It is no to get corresponding image, it is that the first acquisition module 401 works;
Device further includes display module, for when first judgment module, which is judged, to get corresponding image, Show error message.
Device further includes correction module, for being corrected to image.
Device further includes the first setup module, for traversing the pixel in image, obtains the face of the pixel in image The color that color in image is greater than the pixel of average value is set white, the color of remaining pixel by the average value of color It is set as black.
Device further includes the second setup module, the maximum value of the color for obtaining the pixel in image, according to default The ratio of the maximum value of the color of pixel in color value and the image got carries out the color of the pixel in image Deng than amplifying.
Second acquisition module 402 includes: the first initialization unit, the first judging unit, the first updating unit, the first setting Unit, second judgment unit and third judging unit;
First initialization unit, for initializing the current abscissa value, the first abscissa value and the second abscissa of segment encode Value;
First judging unit, the black picture element for judging to whether there is preset quantity in the corresponding column of current abscissa Point;
First updating unit, for updating current abscissa after the first judging unit is judged;Judge in third When the current abscissa of unit judges is not up to maximum abscissa value, current abscissa is updated;
Second judgment unit, for sentencing after the first abscissa value is set current abscissa value by the first setting unit Whether break in the corresponding column of current abscissa is white pixel point;
First setting unit, for judging that there are preset quantities in the corresponding column of current abscissa in the first judging unit When black pixel point, current abscissa value is set by the first abscissa value;Current horizontal seat is judged in second judgment unit judgement It marks in corresponding column when being white pixel point, sets current abscissa value for the second abscissa value;
Third judging unit, for sentencing after the second abscissa value is set current abscissa value by the first setting unit Whether the current abscissa that breaks reaches maximum abscissa value.
First initialization unit is also used to initialize current ordinate value and the first pixel quantity;
First judging unit includes: the first judgment sub-unit, the second judgment sub-unit and third judgment sub-unit;
First judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is black pixel point according to the color value of current pixel point;
Second judgment sub-unit, for sentencing when it is black pixel point that the first judgment sub-unit, which judges current pixel point not, Whether the current ordinate value that breaks reaches maximum ordinate value;When third judgment sub-unit judges updated first pixel quantity When not up to the first quantity, judge whether current ordinate value reaches maximum ordinate value;
First initialization unit is also used to judge that current ordinate value reaches maximum ordinate value when the second judgment sub-unit When, initialize current ordinate value and the first pixel quantity;
First updating unit is also used to, when the second judgment sub-unit judges that current ordinate value reaches maximum ordinate value When, update current abscissa value;When the second judgment sub-unit judges that current ordinate value is not up to maximum ordinate value, update Current ordinate value;When the first judgment sub-unit judges current pixel point for black pixel point, the first pixel quantity is updated;
Third judgment sub-unit, for judging updated the after the first updating unit the first pixel quantity of update Whether one pixel quantity reaches the first quantity;
First initialization unit is also used to, and judges that there are present counts in the corresponding column of current abscissa in the first judging unit When the black pixel point of amount, current ordinate value is initialized;
Second judgment unit includes: the 4th judgment sub-unit and the 5th judgment sub-unit;
4th judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point;
5th judgment sub-unit, for judging when the 4th judgment sub-unit judges current pixel point for white pixel point Whether current ordinate value reaches maximum ordinate value;
First updating unit is also used to, when the 5th judgment sub-unit judges that current ordinate value is not up to maximum ordinate value When, update current ordinate value.
First judgment sub-unit is specifically used for judging whether the color value of current pixel point is the first preset value, is then determining Current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
Alternatively, the first judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the first range, is It then determines that current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
4th judgment sub-unit is specifically used for judging whether the color value of current pixel point is the second preset value, is then determining Current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point;
Alternatively, the 4th judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the second range, is It then determines that current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point.
When, there are when at least two segment encodes, the first judging unit further includes the 6th judgment sub-unit in image, for when the When two judgment sub-units judge that current ordinate value reaches maximum ordinate value, judge whether current abscissa value reaches maximum horizontal Coordinate value;
First updating unit is also used to judge that current abscissa value is not up to maximum abscissa value when the 6th judgment sub-unit When, update current abscissa value;
First initialization unit is also used to judge that current abscissa value is not up to maximum abscissa when the 6th judgment sub-unit When value, current ordinate value and the first pixel quantity are initialized;
Second acquisition module 402 further includes the 4th judging unit, for setting the second abscissa value when the first setting unit After being set to current abscissa value, judge whether current abscissa value reaches maximum abscissa value;
First updating unit is also used to judge that current abscissa value is not up to maximum abscissa value when the 6th judgment sub-unit When, update current abscissa value;
First initialization unit is also used to judge that current abscissa value is not up to maximum abscissa when the 6th judgment sub-unit When value, current ordinate value and the first pixel quantity are initialized.
It includes: the second initialization unit, the 5th judging unit, the 6th judging unit, the 7th judgement that third, which obtains module 403, Unit, the second updating unit, the 8th judging unit and the 9th judging unit;
Second initialization unit, for initializing the current ordinate value, the first ordinate value and the second ordinate of segment encode Value;
5th judging unit, for judging the first abscissa value in the corresponding row of current ordinate value to the second abscissa It whether there is the black pixel point of preset quantity in the range of value;
6th judging unit, for judging the first abscissa in the corresponding row of current ordinate value when the 5th judging unit When the black pixel point of preset quantity is not present in the range of being worth to the second abscissa value, judge whether current ordinate value reaches Maximum ordinate value;When the 7th judging unit judges that current ordinate value is greater than the first numerical value, judge that current ordinate value is It is no to reach maximum ordinate value;After the first ordinate value is updated to current ordinate value by the second updating unit, judgement is current Whether ordinate value reaches maximum ordinate value;When the 8th judging unit judges that first in the corresponding row of current ordinate value is horizontal It is not to judge whether current ordinate value reaches maximum vertical after white pixel point in the range of coordinate value to the second abscissa value Coordinate value;When the 9th judging unit judges that current ordinate value is greater than second value, judge whether current ordinate value reaches Maximum ordinate value;
7th judging unit, for judging the first abscissa in the corresponding row of current ordinate value when the 5th judging unit There are when the black pixel point of preset quantity, judge whether current ordinate value is greater than in the range of value to the second abscissa value One numerical value;
Second updating unit, for when the 6th judging unit judges that current ordinate value is not up to maximum ordinate value, Update current ordinate value;When the 7th judging unit judges current ordinate value no more than the first numerical value, by the first ordinate Value is updated to current ordinate value;When the 9th judging unit judges that current ordinate value is greater than second value, by the second vertical seat Scale value is updated to current ordinate value;When the 9th judging unit judges current ordinate value no more than second value, update is worked as Preceding ordinate value;
8th judging unit, for the first ordinate value to be updated to current ordinate value when the second updating unit, and When 6th judging unit judges that current ordinate value is not up to maximum ordinate value, judge in the corresponding row of current ordinate value It whether is white pixel point in the range of first abscissa value to the second abscissa value;
9th judging unit, for judging the first abscissa in the corresponding row of current ordinate value when the 8th judging unit When in the range of value to the second abscissa value being white pixel point, judge whether current ordinate value is greater than second value.
Second initialization unit is also used to initialize the current abscissa value and the second pixel quantity of segment encode;
5th judging unit includes: the 7th judgment sub-unit, the 8th judgment sub-unit and the 9th judgment sub-unit;
7th judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is black pixel point according to the color value of current pixel point;
8th judgment sub-unit, for sentencing when it is black pixel point that the 7th judgment sub-unit, which judges current pixel point not, Whether current abscissa value of breaking reaches the second abscissa value, and otherwise the second updating unit updates current abscissa value;Sentence when the 9th When disconnected subelement judges that updated second pixel quantity is not up to the second quantity, judge whether current abscissa value reaches the Two abscissa values are that then the second initialization unit initializes the second pixel quantity, and otherwise the second updating unit updates current horizontal Coordinate value;
Second updating unit is also used to when the 7th judgment sub-unit judges current pixel point for black pixel point, is updated Second pixel quantity;
9th judgment sub-unit, for judging updated the after the second updating unit the second pixel quantity of update Whether two pixel quantities reach the second quantity;
When 6th judging unit judges that current ordinate value is not up to maximum ordinate value, the initialization of the second initialization unit Current abscissa value;
8th judging unit further include: the tenth judgment sub-unit and the 11st judgment sub-unit;
Tenth judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point;
11st judgment sub-unit, for sentencing when the tenth judgment sub-unit judges current pixel point for white pixel point Whether current abscissa value of breaking reaches the second abscissa value;
Second updating unit is also used to judge that current abscissa value is not up to the second abscissa when the 11st judgment sub-unit When value, current abscissa value is updated;
When 9th judging unit judges that updated second pixel quantity is not up to the second quantity, the second initialization Unit initializes current abscissa value.
7th judgment sub-unit is specifically used for judging whether the color value of current pixel point is the first preset value, is then determining Current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
Alternatively, the 7th judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the first range, is It then determines that current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
Tenth judgment sub-unit is specifically used for judging whether the color value of current pixel point is the second preset value, is then determining Current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point;
Alternatively, the tenth judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the second range, is It then determines that current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point.
Device further includes the second judgment module, for according to second the first abscissa value for getting of acquisition module 402 and Second abscissa value, third obtain the first ordinate value and the second ordinate value that module 403 is got, judge segment encode range Whether the ratio of height and the width is greater than third preset value;
Identification module 405 is also used to judge that the ratio of the height and the width of segment encode range is greater than in the second judgment module When third preset value, identification burst code table registration word 1.
Device further includes third judgment module, for judging whether deposit in pen section sampling area that sampling module 404 obtains In white pixel point;
Device further includes display module, for judging that there is no white pixels in pen section sampling area in third judgment module When point, error message is shown.
If identification module 405 is shown specifically for the corresponding pen section of pen section sampling area, identification device will be with pen section Corresponding segment identification set of sampling area, so that the pen section distribution situation of segment encode is obtained, according to pen section distribution situation identification burst The number that code indicates, the number that identification burst code indicates.
Identification module 405 includes third initialization unit, the tenth judging unit, the 11st judging unit, the 12nd judgement Unit, the 13rd judging unit and third updating unit;
Third initialization unit, for initializing current abscissa value, current ordinate value and the first quantity;
Tenth judging unit, for judging corresponding current pixel point according to current abscissa value and current ordinate value It whether is black pixel point;
11st judging unit, for judging whether current ordinate value reaches area after the judgement of the tenth judging unit Domain maximum ordinate value;
12nd judging unit, for judging that current ordinate value reaches region maximum ordinate when the 11st judging unit When value, judge whether current abscissa value reaches region maximum abscissa value;
13rd judging unit, for judging that current abscissa value reaches region maximum abscissa when the 12nd judging unit When value, judge whether the first quantity reaches preset quantity, is that then the corresponding pen section of determining pen section sampling area is shown, otherwise really Determine the corresponding pen section of pen section sampling area not to be shown;
Third updating unit, for updating first when the tenth judging unit judges current pixel point for black pixel point Quantity;When the 11st judging unit judges that current ordinate value is not up to region maximum ordinate value, current ordinate is updated Value;When the 12nd judging unit judges that current abscissa value is not up to region maximum abscissa value, current abscissa value is updated.
If identification module 405 is specifically used for a segment identification, b segment identification, c segment identification, d segment identification, e segment identification and f segment identification Set, and g segment identification resets, then identification burst code table registration word 0;If a segment identification, b segment identification, d segment identification, e segment identification and g Segment identification set, and c segment identification and f segment identification reset, then identification burst code table registration word 2;If a segment identification, b segment identification, c sections Mark, d segment identification and g segment identification set, and e segment identification and f segment identification reset, then identification burst code table registration word 3;If b sections Mark, c segment identification, f segment identification, g segment identification set, and a segment identification, d segment identification and e segment identification reset, then identify segment encode Indicate number 4;If a segment identification, c segment identification, d segment identification, f segment identification and g segment identification set, and b segment identification and e segment identification It resets, then identification burst code table registration word 5;If a segment identification, c segment identification, d segment identification, e segment identification, f segment identification and g segment identification are set Position, and b segment identification resets, then identification burst code table registration word 6;If a segment identification, b segment identification and c segment identification set, and d sections Mark, e segment identification, f segment identification and g segment identification reset, then identification burst code table registration word 7;If a segment identification, b segment identification, c segment mark Knowledge, d segment identification, e segment identification, f segment identification and the equal set of g segment identification, then identification, which obtains segment encode, indicates number 8;If a segment identification, b Segment identification, c segment identification, d segment identification, f segment identification and the equal set of g segment identification, and e segment identification resets, then and identification burst code indicates Number 9.
Identification module 405 further includes the 4th judgment module, for working as a segment identification, b segment identification, c segment identification, d segment identification, e When segment identification, f segment identification and the equal set of g segment identification, according to the first abscissa value, the second abscissa value, the first ordinate value and Second ordinate value obtains the coordinate of the first inspection area and the second inspection area, in the first inspection area and the second test zone It is sampled, is judged with the presence or absence of white pixel point in the first inspection area and the second inspection area, if the first test zone in domain There is white pixel point in domain and the second inspection area, then identification burst code table registration word 8;If the first inspection area and the second inspection It looks into and white pixel point is not present in region, then identification burst code table registration word 1;
Identification device further includes display module, if for judging that the first inspection area and second checks when the 4th judgment module There are white pixel points for a region in region, when white pixel point is not present in another region, show error message.
Identification device is also used to the sampled result according to each section sampling area, obtains the pen section distribution situation of segment encode, The character indicated according to pen section distribution situation identification burst code.
If identification device be specifically used for a segment identification, d segment identification, e segment identification and the equal set of f segment identification, and b segment identification, C segment identification and g segment identification reset, then identification burst code indicates character C;If a segment identification, d segment identification, e segment identification, f segment identification are equal With g segment identification set, and b segment identification and c segment identification reset, then identification burst code indicates character E;If a segment identification, e segment identification, And g segment identification set, and b segment identification, c segment identification and d segment identification reset f segment identification, then identification burst code expression character F; If b segment identification, c segment identification, e segment identification, f segment identification are and g segment identification set, and a segment identification and d segment identification reset, then Identification burst code indicates character H;If d segment identification, e segment identification and the equal set of f segment identification, and a segment identification, b segment identification, c segment mark Know and g segment identification resets, then identification burst code indicates character L;If a segment identification, b segment identification, e segment identification, f segment identification and g sections Set is identified, and c segment identification and d segment identification reset, then identification burst code indicates character P;If b segment identification, c segment identification, d segment mark Knowledge, e segment identification and the equal set of f segment identification, and a segment identification and g segment identification reset, then and identification burst code indicates character U.
When, there are when at least two segment encodes, second obtains module 402 for the color according to the pixel in image in image Value obtains the first abscissa value and the second abscissa value of each segment encode in image;
Device further includes the 5th judgment module, for judging that second obtains the first of each segment encode that module 402 is got Whether the quantity of abscissa value and the second abscissa value is identical as preset coordinate logarithm;
Device further includes initialization module, for judging the first abscissa value and the of each segment encode when the 5th judgment module When the quantity of two abscissa values is identical as preset coordinate logarithm, current segment encode is initialized;
Third obtains module 403 specifically for the first abscissa value, the second abscissa value and image according to current segment encode In pixel color value, obtain image in current segment encode the first ordinate value and the second ordinate value;
Device further includes the 6th judgment module, and the first ordinate value and the second ordinate also has not been obtained for judging whether The segment encode of value;
Device further includes update module, for updating current segment encode;
Device further includes the 7th judgment module, for judging whether that there are also unidentified segment encodes;
Device further includes display module, for judging the first abscissa value and second of each segment encode when the 5th judgment module When the quantity of abscissa value is not identical as preset coordinate logarithm, error message is shown.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, Anyone skilled in the art is in technical scope disclosed by the invention, and any changes or substitutions that can be easily thought of, It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of protection of the claims Subject to.

Claims (43)

1. a kind of method of the segment encode in identification image, which is characterized in that the described method includes:
Step S1: identification device obtains the wide as maximum abscissa value of image, obtains the high as maximum vertical seat of described image Scale value;
Step S2: the identification device is according to the color of the pixel in described image, maximum abscissa value and maximum ordinate Value obtains the first abscissa value and the second abscissa value of the segment encode in described image;
Step S3: the identification device is according to the picture in first abscissa value, second abscissa value and described image The color of vegetarian refreshments obtains the first ordinate value and the second ordinate value of the segment encode in described image;
Step S4: the identification device is according to first abscissa value, second abscissa value, first ordinate value With second ordinate value, the coordinate of each section sampling area is obtained, is sampled in the pen section sampling area;
Step S5: the identification device obtains the pen section distribution of the segment encode according to the sampled result of each section sampling area Situation identifies the number that the segment encode indicates according to the pen section distribution situation.
2. the method according to claim 1, wherein include: the identification device before the step S1 according to The image path received obtains corresponding image, judges whether that corresponding image can be got, is to then follow the steps S1, Otherwise it shows error message, terminates.
3. the method according to claim 1, wherein before the step S1 further include: the identification device pair Described image is corrected.
4. the method according to claim 1, wherein before the step S2 further include: the identification device time The pixel in described image is gone through, the average value of the color of the pixel in described image is obtained, color in described image is big It is set as white in the color of the pixel of the average value, the color of remaining pixel is set as black.
5. the method according to claim 1, wherein before the step S2 further include: the identification device obtains The maximum value for taking the color of the pixel in described image, according to the pixel in pre-set color value and the described image got Color maximum value ratio, the color of the pixel in described image is carried out etc. than amplifying.
6. the method according to claim 1, wherein the step S2 specifically:
Step S2-A: the identification device initializes the current abscissa value, the first abscissa value and the second horizontal seat of the segment encode Scale value;
Step S2-B: the identification device judges the black picture element that whether there is preset quantity in the corresponding column of current abscissa Point is to then follow the steps S2-C, otherwise updates current abscissa, return step S2-B;
Step S2-C: first abscissa value is set current abscissa value by the identification device, updates current abscissa, Execute step S2-D;
Step S2-D: whether the identification device judges in the corresponding column of current abscissa to be white pixel point, is to execute Step S2-E, it is no to then follow the steps S2-F;
Step S2-E: second abscissa value is set current abscissa value by the identification device, executes step S3;
Step S2-F: the identification device judges whether current abscissa reaches the maximum abscissa value, is to then follow the steps Otherwise S3 updates current abscissa, return step S2-D.
7. according to the method described in claim 6, it is characterized in that, the step S2-A includes: the identification device initialization Current ordinate value;
The step S2-B specifically:
Step S2-B1: the identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is black pixel point according to the color value of current pixel point, be to then follow the steps S2- B3, it is no to then follow the steps S2-B2;
Step S2-B2: the identification device judges whether current ordinate value reaches the maximum ordinate value, is, update is worked as Preceding abscissa value, initializes current ordinate value and the first pixel quantity, otherwise return step S2-B1 updates current vertical seat Scale value, return step S2-B1;
Step S2-B3: the identification device updates the first pixel quantity, judges whether updated first pixel quantity reaches It is to then follow the steps S2-C to the first quantity, it is no to then follow the steps S2-B4;
Step S2-B4: the identification device judges whether current ordinate value reaches the maximum ordinate value, is, update is worked as Preceding abscissa value, initializes current ordinate value and first pixel quantity, otherwise return step S2-B1 updates current Ordinate value, return step S2-B1;
The step S2-C includes: that the identification device initializes current ordinate value;
The step S2-D specifically:
Step S2-D1: the identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is white pixel point according to the color value of current pixel point, be to then follow the steps S2- D2, it is no to then follow the steps S2-F;
Step S2-D2: the identification device judges whether current ordinate value reaches maximum ordinate value, is to then follow the steps Otherwise S2-E updates current ordinate value, return step S2-D1.
8. the method according to the description of claim 7 is characterized in that when in described image there are when at least two segment encodes, it is described In step S2-B2, after the identification device judges that current ordinate value reaches the maximum ordinate value, further includes: described Identification device judges whether current abscissa value reaches the maximum abscissa value, is to then follow the steps S3, otherwise updates current Abscissa value initializes current ordinate value and the first pixel quantity, return step S2-B1;
In the step S2-B4, after the identification device judges that current ordinate value reaches the maximum ordinate value, also wrap Include: the identification device judges whether current abscissa value reaches the maximum abscissa value, is to then follow the steps S3, otherwise more New current abscissa value, initializes current ordinate value and the first pixel quantity, return step S2-B1;
In the step S2-E, after second abscissa value is set current abscissa value by the identification device, also wrap Include: the identification device judges whether current abscissa value reaches the maximum abscissa value, is to then follow the steps S3, otherwise more New current segment encode, updates current abscissa value, initializes current ordinate value, return step S2-B.
9. the method according to claim 1, wherein the step S3 specifically:
Step S3-A: the identification device initializes the current ordinate value, the first ordinate value and the second vertical seat of the segment encode Scale value;
Step S3-B: the identification device judges first abscissa value in the corresponding row of current ordinate value to described The black pixel point that whether there is preset quantity in the range of two abscissa values, is to then follow the steps S3-D, no to then follow the steps S3-C;
Step S3-C: the identification device judges whether current ordinate value reaches the maximum ordinate value, is to execute step Otherwise rapid S4 updates current ordinate value, return step S3-B;
Step S3-D: the identification device judges whether current ordinate value is greater than the first numerical value, is to then follow the steps S3-F, no Then follow the steps S3-E;
Step S3-E: first ordinate value is updated to current ordinate value by the identification device, executes step S3-F;
Step S3-F: the identification device judges whether current ordinate value reaches the maximum ordinate value, is to execute step Otherwise rapid S4 updates current ordinate value, execute step S3-G;
Step S3-G: the identification device judges first abscissa value in the corresponding row of current ordinate value to described Whether it is white pixel point in the range of two abscissa values, is to then follow the steps S3-H, otherwise return step S3-F;
Step S3-H: the identification device judges whether current ordinate value is greater than second value, is to then follow the steps S3-I, no Then update current ordinate value, return step S3-B;
Step S3-I: second ordinate value is updated to current ordinate value by the identification device;
Step S3-J: the identification device judges whether current ordinate value reaches the maximum ordinate value, is to execute step Otherwise rapid S4 updates current ordinate value, return step S3-B.
10. according to the method described in claim 9, it is characterized in that, the step S3-A includes: the identification device initialization The current abscissa value of the segment encode;
The step S3-B specifically:
Step S3-B1: the identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is black pixel point according to the color value of current pixel point, be to then follow the steps S3- B3, it is no to then follow the steps S3-B2;
Step S3-B2: the identification device judges whether current abscissa value reaches second abscissa value, is to execute step Otherwise rapid S3-C updates current abscissa value, return step S3-B1;
Step S3-B3: the identification device updates the second pixel quantity, judges whether updated second pixel quantity reaches It is to then follow the steps S3-D to the second quantity, it is no to then follow the steps S3-B4;
Step S3-B4: the identification device judges whether current abscissa value reaches second abscissa value, is to initialize Second pixel quantity executes step S3-C, otherwise updates current abscissa value, return step S3-B1;
In the step S3-C, the identification device judges that current ordinate value is not up to after the maximum ordinate value, also It include: that the identification device initializes current abscissa value;
In the step S3-F, the identification device judges that current ordinate value is not up to after the maximum ordinate value, also It include: that the identification device initializes current abscissa value;
The step S3-G specifically:
Step S3-G1: the identification device obtains corresponding current pixel point according to current abscissa value and current ordinate value Color value, judge whether current pixel point is white pixel point according to the color value of current pixel point, be to then follow the steps S3- G2, otherwise return step S3-F;
Step S3-G2: the identification device judges whether current abscissa value reaches second abscissa value, is to execute step Otherwise rapid S3-H updates current abscissa value, return step S3-G1;
In the step S3-H, the identification device judges current ordinate value no more than after second value, further includes: described Identification device initializes current abscissa value;
In the step S3-J, the identification device judges that current ordinate value is not up to after the maximum ordinate value, also It include: that the identification device initializes current abscissa value.
11. method according to claim 6 or 9, which is characterized in that the preset quantity is to be previously written the identification dress The quantity for the fixation set;Or the preset quantity is the quantity being calculated according to the height of described image.
12. the method according to claim 7 or 10, which is characterized in that described to be judged according to the color value of current pixel point Whether current pixel point is black pixel point, specifically: the identification device judges whether the color value of current pixel point is One preset value is that then determining current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
The color value according to current pixel point judges whether current pixel point is white pixel point, specifically: the identification Device judges whether the color value of current pixel point is the second preset value, is that then determining current pixel point is white pixel point, no Then determine that current pixel point is not white pixel point.
13. the method according to claim 7 or 10, which is characterized in that described to be judged according to the color value of current pixel point Whether current pixel point is black pixel point, specifically: whether the identification device judges the color value of current pixel point In one range, it is that then determining current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
The identification device judges whether current pixel point is white pixel point according to the color value of current pixel point, specifically: The identification device judges the color value of current pixel point whether in the second range, is that then determining current pixel point is white picture Otherwise vegetarian refreshments determines that current pixel point is not white pixel point.
14. the method according to claim 1, wherein before the step S4, further includes: the identification device According to first abscissa value, second abscissa value, first ordinate value and second ordinate value, judgement Whether the ratio of the height and the width of segment encode range is greater than third preset value, is, identifies that the segment encode indicates number 1, terminates, It is no to then follow the steps S4.
15. the method according to claim 1, wherein before the step S5, further includes: the identification device Judge to be to then follow the steps S5, otherwise show error message with the presence or absence of white pixel point in the pen section sampling area, tie Beam.
16. the method according to claim 1, wherein the identification device is according to each section sampling area Sampled result obtains the pen section distribution situation of the segment encode, specifically: if the corresponding pen section of the pen section sampling area is shown Show, then the identification device will with corresponding segment identification set of the pen section sampling area, to obtain the pen of the segment encode Section distribution situation.
17. according to the method for claim 16, which is characterized in that the identification device judges the pen section sampling area pair Whether the pen section answered is shown, specifically:
Step S6-1A: the identification device initializes current abscissa value, current ordinate value and the first quantity;
Step S6-1B: the identification device judges corresponding current pixel point according to current abscissa value and current ordinate value Whether it is black pixel point, is to update first quantity, executes step S6-1C, it is no to then follow the steps S6-1C;
Step S6-1C: the identification device judges whether current ordinate value reaches region maximum ordinate value, is to execute step Otherwise rapid S6-1D updates current ordinate value, return step S6-1B;
Step S6-1D: the identification device judges whether current abscissa value reaches region maximum abscissa value, is to execute step Otherwise rapid S6-1E updates current abscissa value, return step S6-1B;
Step S6-1E: the identification device judges whether first quantity reaches preset quantity, is, the determining pen section is adopted The corresponding pen section in sample region is shown, otherwise determines that the corresponding pen section of the pen section sampling area is not shown.
18. according to the method for claim 16, which is characterized in that the segment encode include seven pen sections, respectively a sections to g Section, a section in the segment encode is the lateral pen section positioned at the segment encode the top;B section in the segment encode is positioned at described section The top vertical pen section in position in two vertically disposed pen sections on code right side;C section in the segment encode is positioned at described section The vertical pen section of position on the lower in two vertically disposed pen sections on code right side;D section in the segment encode is positioned at described section The lateral pen section of code bottom;E section in the segment encode is the position in two vertically disposed pen sections on the left of segment encode Vertical pen section on the lower;F section in the segment encode is that the position in two vertically disposed pen sections on the left of segment encode is top Vertical pen section;G section in the segment encode be positioned at described a sections and it is d sections described between, i.e., the lateral pen in the described segment encode center Section;There is a segment identification to g segment identification in the identification device, respectively corresponds a to g sections of the segment encode;
The quantity of the pen section sampling area is at least 7, and each section at least corresponds to a pen section sampling area;
The number that the segment encode indicates is identified according to the pen section distribution situation in the step S5, specifically: if the identification Device judges a segment identification, b segment identification, c segment identification, d segment identification, e segment identification and f segment identification set, and g segment identification is multiple Position, then the identification device identifies that the segment encode indicates number 0;If the identification device judges a segment identification, b segment identification, d Segment identification, e segment identification and g segment identification set, and c segment identification and f segment identification reset, then and the identification device identifies described section Code table registration word 2;If the identification device judges a segment identification, b segment identification, c segment identification, d segment identification and g segment identification set, And e segment identification and f segment identification reset, then the identification device identifies that the segment encode indicates number 3;If the identification device is sentenced Break and b segment identification, c segment identification, f segment identification, g segment identification set, and a segment identification, d segment identification and e segment identification reset, then institute It states identification device and identifies that the segment encode indicates number 4;If the identification device judges a segment identification, c segment identification, d segment identification, f Segment identification and g segment identification set, and b segment identification and e segment identification reset, then and the identification device identifies that the segment encode indicates number Word 5;If the identification device judges a segment identification, c segment identification, d segment identification, e segment identification, f segment identification and g segment identification set, And b segment identification resets, then the identification device identifies that the segment encode indicates number 6;If the identification device judges a segment mark Knowledge, b segment identification and c segment identification set, and d segment identification, e segment identification, f segment identification and g segment identification reset, then and the identification fills Setting the identification segment encode indicates number 7;If the identification device judges a segment identification, b segment identification, c segment identification, d segment identification, e Segment identification, f segment identification and the equal set of g segment identification, then the identification device identifies that the segment encode indicates number 8;If the identification Device judges a segment identification, b segment identification, c segment identification, d segment identification, f segment identification and the equal set of g segment identification, and e segment identification It resets, then the identification device identifies that the segment encode indicates number 9.
19. according to the method for claim 18, which is characterized in that the identification device judge a segment identification, b segment identification, After c segment identification, d segment identification, e segment identification, f segment identification and the equal set of g segment identification further include: the identification device is according to First abscissa value, second abscissa value, first ordinate value and second ordinate value, obtain the first inspection The coordinate in region and the second inspection area is sampled in first inspection area and second inspection area, judgement It whether there is white pixel point in first inspection area and second inspection area, if first inspection area and institute It states in the second inspection area and there is white pixel point, then the identification device identifies that the segment encode indicates number 8;If described White pixel point is not present in one inspection area and second inspection area, then the identification device identifies the segment encode table Registration word 1;If a region in first inspection area and second inspection area there are white pixel point, another White pixel point is not present in region, then shows error message, terminates.
20. according to the method for claim 18, which is characterized in that the step S5 includes: the identification device according to each The sampled result of a section sampling area obtains the pen section distribution situation of the segment encode, is identified according to the pen section distribution situation The character that the segment encode indicates.
21. according to the method for claim 20, which is characterized in that the identification device is according to each segment identification, identification The character that the segment encode indicates, specifically:
If the identification device judges a segment identification, d segment identification, e segment identification and the equal set of f segment identification, and b segment identification, c Segment identification and g segment identification reset, then the identification device identifies that the segment encode indicates character C;If the identification device judges a And g segment identification set, and b segment identification and c segment identification reset for segment identification, d segment identification, e segment identification, f segment identification, then described Identification device identifies that the segment encode indicates character E;If the identification device judge a segment identification, e segment identification, f segment identification and G segment identification set, and b segment identification, c segment identification and d segment identification reset, then and the identification device identifies that the segment encode indicates word Accord with F;If the identification device judges b segment identification, c segment identification, e segment identification, f segment identification and g segment identification set, and a Segment identification and d segment identification reset, then the identification device identifies that the segment encode indicates character H;If the identification device judges d Segment identification, e segment identification and the equal set of f segment identification, and a segment identification, b segment identification, c segment identification and g segment identification reset, then it is described Identification device identifies that the segment encode indicates character L;If the identification device judges a segment identification, b segment identification, e segment identification, f sections Equal and g segment identification set is identified, and c segment identification and d segment identification reset, then the identification device identifies that the segment encode indicates word Accord with P;If the identification device judges b segment identification, c segment identification, d segment identification, e segment identification and the equal set of f segment identification, and a Segment identification and g segment identification reset, then the identification device identifies that the segment encode indicates character U.
22. the method according to claim 1, wherein when in described image there are when at least two segment encodes, it is described Step S2 are as follows: the identification device obtains the first cross of each segment encode in image according to the color value of the pixel in image Coordinate value and the second abscissa value;
Include: before the step S3
Step S2-1: the first abscissa value and the second abscissa value for each segment encode that the identification device judgement is got Quantity it is whether identical as preset coordinate logarithm, be to then follow the steps S3-0, otherwise show error message, terminate;
Step S3-0: the identification device initializes current segment encode, executes step S3;
The step S3 are as follows: first abscissa value, second abscissa value of the identification device according to current segment encode With the color value of the pixel in described image, the first ordinate value and the second vertical seat of the current segment encode in described image are obtained Scale value;
It include: that the identification device judges whether that the first ordinate value and the second ordinate also has not been obtained before the step S4 The segment encode of value is to update current segment encode, return step S3, no to then follow the steps S4-0;
Step S4-0: the identification device initializes current segment encode, executes step S4;
After the step S5 further include: the identification device judges whether there are also unidentified segment encode, is then to update to work as leading portion Code, initializes each segment identification in identification device, otherwise return step S4 terminates.
23. it is a kind of identification image in segment encode device characterized by comprising first obtain module, second obtain module, Third obtains module, sampling module and identification module;
Described first obtains module, for obtaining the wide as maximum abscissa value of image, obtains the high as most of described image Big ordinate value;
Described second obtains module, for being got according to color, the first acquisition module of the pixel in described image Maximum abscissa value and maximum ordinate value, obtain described image in segment encode the first abscissa value and the second abscissa Value;
The third obtains module, for being got according to color, the second acquisition module of the pixel in described image First abscissa value and second abscissa value, obtain described image in segment encode the first ordinate value and second Ordinate value;
The sampling module, first abscissa value and second cross for being got according to the second acquisition module Coordinate value, the third obtain first ordinate value and second ordinate value that module is got, obtain each pen The coordinate of section sampling area, is sampled in the pen section sampling area;
The identification module, the sampled result of each section sampling area for being obtained according to the sampling module, obtains institute The pen section distribution situation for stating segment encode identifies the number that the segment encode indicates according to the pen section distribution situation.
24. device according to claim 23, which is characterized in that described device further includes first judgment module, is used for root According to the image path received, corresponding image is obtained, judges whether that corresponding image can be got, is, described first obtains Modulus block works;
Described device further includes display module, for when the first judgment module judging that corresponding image can not be got When, show error message.
25. device according to claim 23, which is characterized in that described device further includes correction module, for described Image is corrected.
26. device according to claim 23, which is characterized in that described device further includes the first setup module, for time The pixel in described image is gone through, the average value of the color of the pixel in described image is obtained, color in described image is big It is set as white in the color of the pixel of the average value, the color of remaining pixel is set as black.
27. device according to claim 23, which is characterized in that described device further includes the second setup module, for obtaining The maximum value for taking the color of the pixel in described image, according to the pixel in pre-set color value and the described image got Color maximum value ratio, the color of the pixel in described image is carried out etc. than amplifying.
28. device according to claim 23, which is characterized in that the second acquisition module includes: the first initialization list Member, the first judging unit, the first updating unit, the first setting unit, second judgment unit and third judging unit;
First initialization unit, for initializing the current abscissa value, the first abscissa value and the second cross of the segment encode Coordinate value;
First judging unit, the black picture element for judging to whether there is preset quantity in the corresponding column of current abscissa Point;
First updating unit, for updating current abscissa after first judging unit is judged;Described When third judging unit judges that current abscissa is not up to the maximum abscissa value, current abscissa is updated;
The second judgment unit, for setting current abscissa for first abscissa value in first setting unit After value, judge in the corresponding column of current abscissa whether to be white pixel point;
First setting unit, for judging that there are present counts in the corresponding column of current abscissa in first judging unit When the black pixel point of amount, current abscissa value is set by first abscissa value;Judge in the second judgment unit Judge to set current abscissa for second abscissa value when being white pixel point in the corresponding column of current abscissa Value;
The third judging unit, for setting current abscissa for second abscissa value in first setting unit After value, judge whether current abscissa reaches the maximum abscissa value.
29. device according to claim 28, which is characterized in that first initialization unit is also used to initialize currently Ordinate value and the first pixel quantity;
First judging unit includes: the first judgment sub-unit, the second judgment sub-unit and third judgment sub-unit;
First judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is black pixel point according to the color value of current pixel point;
Second judgment sub-unit, for judging that current pixel point is not black pixel point when first judgment sub-unit When, judge whether current ordinate value reaches the maximum ordinate value;When the third judgment sub-unit judge it is updated When first pixel quantity is not up to the first quantity, judge whether current ordinate value reaches the maximum ordinate value;
First initialization unit is also used to judge that current ordinate value reaches the maximum when second judgment sub-unit When ordinate value, current ordinate value and the first pixel quantity are initialized;
First updating unit is also used to, when second judgment sub-unit judges that current ordinate value reaches described maximum vertical When coordinate value, current abscissa value is updated;When second judgment sub-unit judges that current ordinate value is not up to the maximum When ordinate value, current ordinate value is updated;When first judgment sub-unit judges current pixel point for black pixel point, Update the first pixel quantity;
The third judgment sub-unit is used for after first updating unit updates the first pixel quantity, after judging update The first pixel quantity whether reach the first quantity;
First initialization unit is also used to, and judges to exist in the corresponding column of current abscissa in first judging unit pre- If when the black pixel point of quantity, initializing current ordinate value;
The second judgment unit includes: the 4th judgment sub-unit and the 5th judgment sub-unit;
4th judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point;
5th judgment sub-unit is used for when the 4th judgment sub-unit judges current pixel point for white pixel point, Judge whether current ordinate value reaches maximum ordinate value;
First updating unit is also used to, when the 5th judgment sub-unit judges that current ordinate value is not up to maximum vertical seat When scale value, current ordinate value is updated.
30. device according to claim 29, which is characterized in that it is current that first judgment sub-unit is specifically used for judgement Whether the color value of pixel is the first preset value, is that then determining current pixel point is black pixel point, otherwise determines current picture Vegetarian refreshments is not black pixel point;
Alternatively, first judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the first range, is It then determines that current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
4th judgment sub-unit is specifically used for judging whether the color value of current pixel point is the second preset value, is then determining Current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point;
Alternatively, the 4th judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the second range, is It then determines that current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point.
31. device according to claim 29, which is characterized in that when in described image there are when at least two segment encodes, institute Stating the first judging unit further includes the 6th judgment sub-unit, for judging that current ordinate value reaches when second judgment sub-unit When to the maximum ordinate value, judge whether current abscissa value reaches the maximum abscissa value;
First updating unit is also used to judge that current abscissa value is not up to the maximum when the 6th judgment sub-unit When abscissa value, current abscissa value is updated;
First initialization unit, be also used to when the 6th judgment sub-unit judge current abscissa value be not up to described in most When big abscissa value, current ordinate value and the first pixel quantity are initialized;
The second acquisition module further includes the 4th judging unit, for working as first setting unit for second abscissa After value is set as current abscissa value, judge whether current abscissa value reaches the maximum abscissa value.
32. device according to claim 23, which is characterized in that it includes: the second initialization list that the third, which obtains module, Member, the 5th judging unit, the 6th judging unit, the 7th judging unit, the second updating unit, the 8th judging unit and the 9th judgement Unit;
Second initialization unit, for initializing the current ordinate value of the segment encode, the first ordinate value and second is indulged Coordinate value;
5th judging unit, for judging first abscissa value in the corresponding row of current ordinate value to described It whether there is the black pixel point of preset quantity in the range of two abscissa values;
6th judging unit, for judging described the in the corresponding row of current ordinate value when the 5th judging unit When the black pixel point of preset quantity being not present in the range of one abscissa value to second abscissa value, current vertical seat is judged Whether scale value reaches the maximum ordinate value;When the 7th judging unit judges that current ordinate value is greater than the first numerical value When, judge whether current ordinate value reaches the maximum ordinate value;Described first is indulged when second updating unit and is sat After scale value is updated to current ordinate value, judge whether current ordinate value reaches the maximum ordinate value;When the described 8th Judging unit judges the range of first abscissa value in the corresponding row of current ordinate value to second abscissa value It is not inside to judge whether current ordinate value reaches the maximum ordinate value after white pixel point;When the 9th judgement When the current ordinate value of unit judges is greater than second value, judge whether current ordinate value reaches the maximum ordinate value;
7th judging unit, for judging described the in the corresponding row of current ordinate value when the 5th judging unit There are when the black pixel point of preset quantity in the range of one abscissa value to second abscissa value, current ordinate is judged Whether value is greater than the first numerical value;
Second updating unit, for judging that current ordinate value is not up to the maximum vertical seat when the 6th judging unit When scale value, current ordinate value is updated;It, will when the 7th judging unit judges current ordinate value no more than the first numerical value First ordinate value is updated to current ordinate value;When the 9th judging unit judges that current ordinate value is greater than second When numerical value, second ordinate value is updated to current ordinate value;When the 9th judging unit judges current ordinate When value is no more than second value, current ordinate value is updated;
8th judging unit, for first ordinate value to be updated to current ordinate when second updating unit Value, and when the 6th judging unit judge that current ordinate value is not up to the maximum ordinate value, judge current vertical seat It whether is white pixel point in the range of first abscissa value to second abscissa value in the corresponding row of scale value;
9th judging unit, for judging described the in the corresponding row of current ordinate value when the 8th judging unit When in the range of one abscissa value to second abscissa value being white pixel point, judge whether current ordinate value is greater than Second value.
33. device according to claim 32, which is characterized in that second initialization unit is also used to initialize described The current abscissa value and the second pixel quantity of segment encode;
5th judging unit includes: the 7th judgment sub-unit, the 8th judgment sub-unit and the 9th judgment sub-unit;
7th judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is black pixel point according to the color value of current pixel point;
8th judgment sub-unit, for judging that current pixel point is not black pixel point when the 7th judgment sub-unit When, judge whether current abscissa value reaches second abscissa value, otherwise second updating unit updates current horizontal seat Scale value;When the 9th judgment sub-unit judges that updated second pixel quantity is not up to the second quantity, judgement is current Whether abscissa value reaches second abscissa value, is that then second initialization unit initializes second pixel number Amount, otherwise second updating unit updates current abscissa value;
Second updating unit is also used to when the 7th judgment sub-unit judges current pixel point for black pixel point, Update the second pixel quantity;
9th judgment sub-unit is used for after second updating unit updates the second pixel quantity, after judging update The second pixel quantity whether reach the second quantity;
When 6th judging unit judges that current ordinate value is not up to the maximum ordinate value, second initialization is single Member initializes current abscissa value;
8th judging unit further include: the tenth judgment sub-unit and the 11st judgment sub-unit;
Tenth judgment sub-unit, for obtaining corresponding current pixel according to current abscissa value and current ordinate value The color value of point, judges whether current pixel point is white pixel point according to the color value of current pixel point;
11st judgment sub-unit, for judging current pixel point for white pixel point when the tenth judgment sub-unit When, judge whether current abscissa value reaches second abscissa value;
Second updating unit is also used to judge that current abscissa value is not up to second cross when the 11st judgment sub-unit When coordinate value, current abscissa value is updated;
When 9th judging unit judges that updated second pixel quantity is not up to the second quantity, at the beginning of described second Beginningization unit initializes current abscissa value.
34. device according to claim 33, which is characterized in that it is current that the 7th judgment sub-unit is specifically used for judgement Whether the color value of pixel is the first preset value, is that then determining current pixel point is black pixel point, otherwise determines current picture Vegetarian refreshments is not black pixel point;
Alternatively, the 7th judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the first range, is It then determines that current pixel point is black pixel point, otherwise determines that current pixel point is not black pixel point;
Tenth judgment sub-unit is specifically used for judging whether the color value of current pixel point is the second preset value, is then determining Current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point;
Alternatively, the tenth judgment sub-unit is specifically used for judging that the color value of current pixel point whether in the second range, is It then determines that current pixel point is white pixel point, otherwise determines that current pixel point is not white pixel point.
35. device according to claim 23, which is characterized in that described device further includes the second judgment module, is used for root First abscissa value and second abscissa value, the third got according to the second acquisition module obtains module First ordinate value and second ordinate value got, judge the height and the width of segment encode range ratio whether Greater than third preset value;
The identification module is also used to judge that the ratio of the height and the width of segment encode range is big in second judgment module When third preset value, identify that the segment encode indicates number 1.
36. device according to claim 23, which is characterized in that described device further includes third judgment module, for sentencing It whether there is white pixel point in the pen section sampling area that the sampling module that breaks obtains;
Described device further includes display module, for judging to be not present in the pen section sampling area in the third judgment module When white pixel point, error message is shown.
37. device according to claim 23, which is characterized in that if the identification module is sampled specifically for the pen section The corresponding pen section in region is shown, then the identification device will with corresponding segment identification set of the pen section sampling area, from And the pen section distribution situation of the segment encode is obtained, the number that the segment encode indicates is identified according to the pen section distribution situation, identification The number that the segment encode indicates.
38. the device according to claim 37, which is characterized in that the identification module includes third initialization unit, Ten judging units, the 11st judging unit, the 12nd judging unit, the 13rd judging unit and third updating unit;
The third initialization unit, for initializing current abscissa value, current ordinate value and the first quantity;
Tenth judging unit, for judging corresponding current pixel point according to current abscissa value and current ordinate value It whether is black pixel point;
11st judging unit, for judging whether current ordinate value reaches after the tenth judging unit judgement To region maximum ordinate value;
12nd judging unit, for judging that current ordinate value reaches region maximum and indulges when the 11st judging unit When coordinate value, judge whether current abscissa value reaches region maximum abscissa value;
13rd judging unit, for judging that current abscissa value reaches the maximum cross in region when the 12nd judging unit When coordinate value, judge whether first quantity reaches preset quantity, is the then corresponding pen section of the determining pen section sampling area It is shown, otherwise determine that the corresponding pen section of the pen section sampling area is not shown;
The third updating unit, for updating when the tenth judging unit judges current pixel point for black pixel point First quantity;When the 11st judging unit judges that current ordinate value is not up to region maximum ordinate value, more New current ordinate value;When the 12nd judging unit judges that current abscissa value is not up to region maximum abscissa value, Update current abscissa value.
39. the device according to claim 37, which is characterized in that if the identification module is specifically used for a segment identification, b sections Mark, c segment identification, d segment identification, e segment identification and f segment identification set, and g segment identification resets, then identifies that the segment encode indicates Number 0;If a segment identification, b segment identification, d segment identification, e segment identification and g segment identification set, and c segment identification and f segment identification are multiple Position then identifies that the segment encode indicates number 2;If a segment identification, b segment identification, c segment identification, d segment identification and g segment identification set, and And e segment identification and f segment identification reset, then identify that the segment encode indicates number 3;If b segment identification, c segment identification, f segment identification, g sections Set is identified, and a segment identification, d segment identification and e segment identification reset, then identifies that the segment encode indicates number 4;If a segment identification, c Segment identification, d segment identification, f segment identification and g segment identification set, and b segment identification and e segment identification reset, then identify the segment encode table Registration word 5;If a segment identification, c segment identification, d segment identification, e segment identification, f segment identification and g segment identification set, and b segment identification is multiple Position then identifies that the segment encode indicates number 6;If a segment identification, b segment identification and c segment identification set, and d segment identification, e segment mark Knowledge, f segment identification and g segment identification reset, then identify that the segment encode indicates number 7;If a segment identification, b segment identification, c segment identification, d sections Mark, e segment identification, f segment identification and the equal set of g segment identification, then identification, which obtains segment encode, indicates number 8;If a segment identification, b segment mark Knowledge, c segment identification, d segment identification, f segment identification and the equal set of g segment identification, and e segment identification resets, then identifies that the segment encode indicates Number 9.
40. device according to claim 39, which is characterized in that the identification module further includes the 4th judgment module, is used In when a segment identification, b segment identification, c segment identification, d segment identification, e segment identification, f segment identification and the equal set of g segment identification, according to described First abscissa value, second abscissa value, first ordinate value and second ordinate value, obtain the first inspection The coordinate in region and the second inspection area is sampled in first inspection area and second inspection area, judgement It whether there is white pixel point in first inspection area and second inspection area, if first inspection area and institute It states in the second inspection area and there is white pixel point, then identify that the segment encode indicates number 8;If first inspection area and White pixel point is not present in second inspection area, then identifies that the segment encode indicates number 1;
The identification device further includes display module, if for when the 4th judgment module judge first inspection area with There are white pixel points for a region in second inspection area, when white pixel point is not present in another region, display Error message.
41. device according to claim 39, which is characterized in that the identification device is also used to be sampled according to each section The sampled result in region obtains the pen section distribution situation of the segment encode, identifies the segment encode table according to the pen section distribution situation The character shown.
42. device according to claim 41, which is characterized in that if the identification device is specifically used for a segment identification, d sections Mark, e segment identification and the equal set of f segment identification, and b segment identification, c segment identification and g segment identification reset, then identify the segment encode table Show character C;If a segment identification, d segment identification, e segment identification, f segment identification are and g segment identification set, and b segment identification and c segment identification It resets, then identifies that the segment encode indicates character E;If a segment identification, e segment identification, f segment identification are and g segment identification set, and b sections Mark, c segment identification and d segment identification reset, then identify that the segment encode indicates character F;If b segment identification, c segment identification, e segment identification, f And g segment identification set, and a segment identification and d segment identification reset segment identification, then identify the segment encode expression character H;If d sections Mark, e segment identification and the equal set of f segment identification, and a segment identification, b segment identification, c segment identification and g segment identification reset, then identify institute Stating segment encode indicates character L;If a segment identification, b segment identification, e segment identification, f segment identification are and g segment identification set, and c segment identification It is resetted with d segment identification, then identifies that the segment encode indicates character P;If b segment identification, c segment identification, d segment identification, e segment identification and f sections Equal set is identified, and a segment identification and g segment identification reset, then identifies that the segment encode indicates character U.
43. device according to claim 23, which is characterized in that when in described image there are when at least two segment encodes, institute The second acquisition module is stated for the color value according to the pixel in image, obtains the first abscissa value of each segment encode in image With the second abscissa value;
Described device further includes the 5th judgment module, for judging that described second obtains each segment encode that module is got Whether the quantity of the first abscissa value and the second abscissa value is identical as preset coordinate logarithm;
Described device further includes initialization module, for judging the first horizontal seat of each segment encode when the 5th judgment module When the quantity of scale value and the second abscissa value is identical as preset coordinate logarithm, current segment encode is initialized;
The third obtain module be specifically used for according to first abscissa value of current segment encode, second abscissa value and The color value of pixel in described image obtains the first ordinate value and the second ordinate of the current segment encode in described image Value;
Described device further includes the 6th judgment module, and the first ordinate value and the second ordinate also has not been obtained for judging whether The segment encode of value;
Described device further includes update module, for updating current segment encode;
Described device further includes the 7th judgment module, for judging whether that there are also unidentified segment encodes;
Described device further includes display module, for judging the first abscissa of each segment encode when the 5th judgment module When the quantity of value and the second abscissa value is not identical as preset coordinate logarithm, error message is shown.
CN201410805525.2A 2014-12-22 2014-12-22 A kind of method and apparatus of segment encode in identification image Active CN104573687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410805525.2A CN104573687B (en) 2014-12-22 2014-12-22 A kind of method and apparatus of segment encode in identification image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410805525.2A CN104573687B (en) 2014-12-22 2014-12-22 A kind of method and apparatus of segment encode in identification image

Publications (2)

Publication Number Publication Date
CN104573687A CN104573687A (en) 2015-04-29
CN104573687B true CN104573687B (en) 2019-01-04

Family

ID=53089709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410805525.2A Active CN104573687B (en) 2014-12-22 2014-12-22 A kind of method and apparatus of segment encode in identification image

Country Status (1)

Country Link
CN (1) CN104573687B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106340014B (en) * 2016-08-29 2019-11-01 上海理工大学 Binaryzation curve processing method
CN107248375A (en) * 2017-07-20 2017-10-13 武汉华星光电半导体显示技术有限公司 Identifier benefit value method and system for quarter machine
CN112365446B (en) * 2020-10-19 2022-08-23 杭州亿奥光电有限公司 Paper bag bonding quality detection method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1064959A (en) * 1992-04-10 1992-09-30 戴二蓉 The non-lattice method of identification seven-stroke hand writing numerals
CN1763766A (en) * 2005-11-16 2006-04-26 北京交通大学 Writing and recognizing method and application for promissory hand-written machine-read number

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1064959A (en) * 1992-04-10 1992-09-30 戴二蓉 The non-lattice method of identification seven-stroke hand writing numerals
CN1763766A (en) * 2005-11-16 2006-04-26 北京交通大学 Writing and recognizing method and application for promissory hand-written machine-read number

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种采用VC++识别数字仪器七段码的方法;宁志刚 等;《工业仪表与自动化装置》;20090205;101-104页

Also Published As

Publication number Publication date
CN104573687A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
CN110059694B (en) Intelligent identification method for character data in complex scene of power industry
CN104484659B (en) A method of to Color medical and gray scale image automatic identification and calibration
CN104573687B (en) A kind of method and apparatus of segment encode in identification image
CN105913093A (en) Template matching method for character recognizing and processing
CN107833242A (en) One kind is based on marginal information and improves VIBE moving target detecting methods
CN109472761A (en) A kind of method for cell count and system based on fluorescent image
CN109886960A (en) The method of glass edge defects detection based on machine vision
CN104598907A (en) Stroke width figure based method for extracting Chinese character data from image
CN110674811B (en) Image recognition method and device
CN113096060B (en) Positioning method and device for abnormal color lamp beads and storage medium
CN105138311A (en) Method and device for improving graphic drawing efficiency
CN104281850A (en) Character area identification method and device
CN104422422A (en) Product profile deformation analysis system and method
CN105118069B (en) A kind of robot of complex environment straight-line detection and screening technique and application this method
CN106657981A (en) Method, device and system for detecting parallax glasses-free 3D display crosstalk
CN103605973B (en) A kind of image character detection and identification method
CN108898584A (en) A kind of full-automatic veneering capacitor welding equipment polarity discriminating method based on image analysis
CN104751480B (en) The field bit formula liquid crystal display detection method of rice 8 and device of view-based access control model technology
CN106682676A (en) Image test method and image test device
CN109522805B (en) Form processing method for form vote in community election
CN106097281A (en) A kind of calibration maps for projecting interactive system and demarcate detection method
CN109886911A (en) A kind of air level groove defect inspection method based on image processing techniques
CN108108863B (en) Laboratory system error allowable range evaluation method based on quality control data
CN112949666B (en) Image recognition method for fault cathode plate of zinc stripping machine
CN115359003A (en) Two-step tunnel gray image crack identification method, system, medium and equipment

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