The method for searching that the image black and white is had a common boundary
Technical field
The invention relates to the method for searching that a kind of image black and white is had a common boundary, and particularly relevant for a kind of applicable to difference test map and break away from the method for searching that image black and white that a kind of testing software can only be applicable to a kind of yoke of map is had a common boundary.
Background technology
Please refer to Fig. 1, it illustrates the vertical view of the base that is general scanner.In Fig. 1, scanner 100 comprises a base 101, and base 101 comprises a loam cake 102, one scan platform 104 and a ray machine 106.Scanning platform 104 is disposed in the loam cake 102, and in order to put a test map 108, the side of test map 108 is aligned in the intersection of loam cake 102 and scanning platform 104, and promptly datum line 112.Wherein, test map 108 has a map black and white and has a common boundary 110, in order to map 108 is divided into black region and white area, and the map black and white have a common boundary 110 with datum line 112 between distance be defined as border reference (side edge reference, SER) distance X is as 10 millimeters (mm).In addition, ray machine 106 is to be disposed in a movable manner in the base 101, in order to sweep test map 108 and obtain an image.
The purpose of putting test map 108 is to check have a common boundary distance between the border with image of the image black and white of the image that ray machine 106 captured whether to equal SER distance X between map black and white boundary 110 and the datum line 112, if expression ray machine 106 scans the zone of right-hand scanning platform 104 of datum line 112 really; Otherwise, representing exactly that ray machine 106 has scans loam cake 102 or only scans subregion in the scanning platform 104.Like this, must carry out the correction adjustment of scanner 100 at the distance between the border of image black and white boundary and image and the deviation number of SER distance X.The method for searching that has a common boundary as for general image black and white is a lot, enumerates two kinds of methods with as a reference at this.
Please refer to Fig. 2, it illustrates is according to the intact part enlarged diagram of testing the image 200 that is captured behind the map of the optical mechaical scanning of Fig. 1.First method is to take out several vertical lines in the image 200, and takes out several points on vertical line again.Obtaining GTG values, and get rid of singular value, screen the average GTG value that obtains this vertical line at last in various mode of getting a little with respect to these a little points.For example, in Fig. 2, suppose that the A point coordinates in the upper left corner of image 200 is (0,0), and this method is taken out B arbitrarily on arbitrary vertical line of image 200,3 points such as C and D are respectively (4,4) as its coordinate, (4,5) and (4,6).Continue and obtain B, the GTG value that C and D etc. are 3 is to obtain the average GTG value of this vertical picture line.By that analogy, when the average GTG value of two adjacent vertical lines differs a lot of, just represent that image black and white boundary is between these two adjacent vertical lines.
Second method is, scan a black and white junctional area after, according to the most black GTG value of bletilla, GTG value in the middle of the interpolation one, position of GTG value is the position that the image black and white is had a common boundary in the middle of this.
Yet these two kinds of methods must be grasped the kenel and the relevant position of test map when writing testing software, and promptly a kind of testing software can only be applicable to a kind of restriction of map.When changing different test maps, just need revise testing software again, quite trouble.In addition, the problem of above-mentioned first method be the to take a sample decision of number of times and the objectivity of sampling point can't be got rid of because of being the bad erroneous judgement that causes of system.In addition, above-mentioned second method is applicable to perfect condition, when little as if the most black and the whitest difference, produces the phenomenon of erroneous judgement most probably.
Summary of the invention
Supervise in this, purpose of the present invention is exactly at the method for searching that provides a kind of image black and white to have a common boundary, and applicable to difference test map, breaks away from a kind of must arrange in pairs or groups yoke of a kind of testing software and method for searching of map of testing, and avoids producing the phenomenon of erroneous judgement.
According to purpose of the present invention, the method for searching that a kind of image black and white is had a common boundary is proposed, be used for the one scan device, it is characterized in that this method comprises:
Scanning one test map, and obtain an image;
Distinguishing this image is a plurality of row, and respectively has a plurality of imagery zones in this row, and each imagery zone has a GTG value;
Those GTG values of average respectively this row are to obtain with respect to a grey scale average value of this row respectively;
Average those grey scale average value are to obtain a grey scale reference value;
Judge that respectively whether this grey scale average value is greater than this grey scale reference value, if setting this grey scale average value is a white grey scale reference value, otherwise, setting this grey scale average value is a black grey scale reference value;
Add up all this white grey scale reference value and this black grey scale reference value to obtain a grey scale critical value;
Judge respectively should the white grey scale reference value and respectively this black grey scale reference value whether greater than this grey scale critical value, if, setting this white grey scale reference value or this black grey scale reference value is a white GTG conclusion value, otherwise, setting this white grey scale reference value or this black grey scale reference value is a black grey scale conclusion value;
Definition is with respect to white the going or a black row of the behavior one of this white GTG conclusion value or this black grey scale conclusion value; And
The boundary that defines adjacent row in vain and this black row is that an image black and white is had a common boundary.
Wherein this scanner comprises: a loam cake; The one scan platform is to be disposed in this loam cake, and in order to putting this test map, and the intersection of this scanning platform and this loam cake is a datum line; And a ray machine, in order to scan this test map and to obtain this image.
Comprise again: set an Optical Resolution.
Comprise again: put this test map on this scanning platform, make the side of this test map align with this datum line; And according to a map black and white of this test map have a common boundary and the distance of this datum line to set a border reference distance.
Wherein respectively the width of this row equals this SER distance.
Wherein respectively the length of side of this imagery zone equals this SER distance.
Comprise again: the black and white area ratio according to this test map amasss flexible strategy to set black area flexible strategy and a fine flour.
Wherein adding up all this white grey scale reference value and this black grey scale reference value in this comprises again in the step that obtains a grey scale critical value: statistics respectively should the white grey scale reference value multiply by the long-pending flexible strategy of this fine flour and the summation after respectively this black grey scale reference value multiply by these black area flexible strategy average to be weighted, and obtain this grey scale critical value.
Wherein in this definition adjacent should white row and boundary of this black row step of having a common boundary for this black and white in comprise again: if this I behavior should black row and this (I+1) behavior should white row or this I behavior should white row and this (I+1) behavior should black row, note down the value of I; Calculate { [(I * 25.4)/this Optical Resolution]-this SER distance }, to obtain at least one SER calculated value; And take out this minimum SER calculated value with have a common boundary as this image black and white and the border of this image between distance.
A kind of scanner of the present invention has the method for searching that an image black and white is had a common boundary, and it is characterized in that this method comprises:
Scanning one test map, and obtain an image;
Distinguishing this image is a plurality of row, and respectively has a plurality of imagery zones in this row, and each imagery zone has a GTG value;
Those GTG values of average respectively this row are to obtain with respect to a grey scale average value of this row respectively;
Average those grey scale average value are to obtain a grey scale reference value;
Judge that respectively whether this grey scale average value is greater than this grey scale reference value, if setting this grey scale average value is a white grey scale reference value, otherwise, setting this grey scale average value is a black grey scale reference value;
Add up all this white grey scale reference value and this black grey scale reference value to obtain a grey scale critical value;
Judge respectively should the white grey scale reference value and respectively this black grey scale reference value whether greater than this grey scale critical value, if, setting this white grey scale reference value or this black grey scale reference value is a white GTG conclusion value, otherwise, setting this white grey scale reference value or this black grey scale reference value is a black grey scale conclusion value;
Definition is with respect to white the going or a black row of the behavior one of this white GTG conclusion value or this black grey scale conclusion value; And
The boundary that defines adjacent row in vain and this black row is that an image black and white is had a common boundary.
Comprise again: a loam cake; The one scan platform is to be disposed in this loam cake, and in order to putting this test map, and the intersection of this scanning platform and this loam cake is a datum line; And a ray machine, in order to scan this test map and to obtain this image.
Comprise again: set an Optical Resolution.
Comprise again: put this test map on this scanning platform, make the side of this test map align with this datum line; And according to a map black and white of this test map have a common boundary and the distance of this datum line to set a border reference distance.
Wherein respectively the width of this row equals this SER distance.
Wherein respectively the length of side of this imagery zone equals this SER distance.
Comprise again: the black and white area ratio according to this test map amasss flexible strategy to set black area flexible strategy and a fine flour.
Wherein adding up all this white grey scale reference value and this black grey scale reference value in this comprises again in the step that obtains a grey scale critical value; Statistics respectively should the white grey scale reference value multiply by the long-pending flexible strategy of this fine flour and respectively the summation that multiply by after these black area flexible strategy of this black grey scale reference value is average to be weighted, and obtains this grey scale critical value.
Wherein in this definition adjacent should white row and boundary of this black row step of having a common boundary for this black and white in comprise again: if this I behavior should black row and this (I+1) behavior should white row or this I behavior should white row and this (I+1) behavior should blackly go, the value of record I: calculate { [(I * 25.4)/this Optical Resolution]-this SER distance }, to obtain at least one SER calculated value; And take out this minimum SER calculated value with have a common boundary as this image black and white and the border of this image between distance.
The method for searching that a kind of image black and white of the present invention is had a common boundary.At first, the sweep test map, and obtain image.Then, distinguish image and be the number row, and have several imagery zones in each row, and each imagery zone has the GTG value.Then, on average these a little GTG values of each row to obtain grey scale average value with respect to each row.Then, on average these a little grey scale average value to obtain grey scale reference value.Then, whether judge each grey scale average value, if setting grey scale average value is white grey scale reference value greater than grey scale reference value; Otherwise, setting grey scale average value is black grey scale reference value.Then, add up all white grey scale reference value and black grey scale reference value to obtain grey scale critical value.Then, judge that whether look grey scale reference value and each black grey scale reference value are greater than grey scale critical value, if setting white grey scale reference value or black grey scale reference value is white GTG conclusion value separately; Otherwise, setting white grey scale reference value or black grey scale reference value is black grey scale conclusion value.Then, definition is with respect to white row of the behavior of white GTG conclusion value or black grey scale conclusion value or black row.Then, adjacent white row and the black boundary of going of definition is that the image black and white is had a common boundary.
Description of drawings
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, a preferred embodiment cited below particularly, and cooperate appended graphicly, be described in detail below, wherein:
Fig. 1 illustrates the vertical view of the base that is general scanner.
It is according to the intact part enlarged diagram of testing the image that is drawn behind the map of the optical mechaical scanning of Fig. 1 that Fig. 2 illustrates.
It is the flow chart of the method for searching that has a common boundary according to the image black and white of preferred embodiment of the present invention that Fig. 3 illustrates.
Embodiment
The special design one of the present invention is applicable to the method for searching that the image black and white of different test maps is had a common boundary, be used for the one scan device, allow and make an image black and white of having a common boundary behind the test map on the scanning platform in the optical mechaical scanning loam cake of scanner and have a common boundary with respect at least one map black and white in the test map.The present invention breaks away from the yoke that a kind of testing software can only be applicable to a kind of map, avoids producing the phenomenon of erroneous judgement, more can further be applied on the image location at user interface (user interface).Wherein, the title of being quoted in the preferred embodiment is identical with aforesaid content, is no longer given unnecessary details explanation at this.
Please refer to Fig. 3, it illustrates is the flow chart of the method for searching that has a common boundary according to the image black and white of preferred embodiment of the present invention.In Fig. 3, at first, in step 302, scanning one test map, and obtain an image.Wherein, the user will test on the scanning platform in the loam cake that map is placed in scanner, use the optical mechaical scanning for scanner.And set the required Optical Resolution of sweep test map, as 30dpi, to obtain to test relatively the image of map.Wherein, must the align intersection of scanning platform and loam cake, i.e. datum line of the side of test map.According to the map black and white of test map have a common boundary and the distance of datum line to set a border with reference to (side edge reference, SER) distance is as 10mm.In addition, amass flexible strategy to set black area flexible strategy and a fine flour, and the test map has a common boundary can have several map black and white according to the black and white area ratio of testing map.
Then, enter in the step 304, distinguish image and be number row (columns), and have several imagery zones in each row, and each imagery zone has a GTG value.Wherein, the width of each row equals the SER distance, as 10mm; The length of side of each imagery zone equals the SER distance, as 10mm.Then, enter in the step 306, on average these a little GTG values of each row are to obtain the grey scale average value with respect to each row.Then, enter in the step 308, on average these a little grey scale average value are to obtain a grey scale reference value.
Then, enter in the step 310, whether judge each grey scale average value greater than grey scale reference value, if, enter in the step 312, setting grey scale average value is a white grey scale reference value; Otherwise, enter in the step 314, setting grey scale average value is a black grey scale reference value.
After treating that all grey scale average value are configured to white grey scale reference value or black grey scale reference value, enter in the step 315, add up all white grey scale reference value and black grey scale reference value to obtain a grey scale critical value.Wherein, adding up each white grey scale reference value, to multiply by the summation that the long-pending flexible strategy of fine flour and each black grey scale reference value multiply by after the black area flexible strategy average to be weighted, i.e. [(institute's adularescent GTG value summation) * fine flour amasss flexible strategy+(all black grey scale reference value summations) * black area flexible strategy]/(with respect to the summation of the long-pending flexible strategy of the fine flour of each white GTG value and with respect to the summation of the black area flexible strategy of each black grey scale value), and obtain a grey scale critical value.So the present invention avoids choosing of critical value improperly in the mode of weighting, produce with the result who prevents to judge by accident.
Then, enter in the step 316, whether judge each white grey scale reference value and each black grey scale reference value greater than grey scale critical value, if, enter in the step 318, setting white grey scale reference value or black grey scale reference value is a white GTG conclusion value; Otherwise, enter in the step 320, setting white grey scale reference value or black grey scale reference value is a black grey scale conclusion value.
After treating that all white grey scale reference value and black grey scale reference value are set to white GTG conclusion value or black grey scale conclusion value, enter in the step 322, definition is with respect to this behavior one white row or a black row of white GTG conclusion value or black grey scale conclusion value.Then, enter in the step 324, the boundary that defines adjacent white row and black row is that an image black and white is had a common boundary, and this method comes to an end eventually at this.
It should be noted that in step 322 and 324,, then note down the value of I if the black row of the 1st behavior and (I+1) behavior are gone in vain or white row of I behavior and the black row of (I+1) behavior.Wherein, I is a positive integer.Then, calculate { [(I * 25.4)/Optical Resolution]-SER distance }, to obtain at least one SER calculated value.Then, take out minimum SER calculated value with have a common boundary as the image black and white and the border of image between distance.Certainly, other SER calculated value be that other image black and white are had a common boundary and the border of image between distance.
The method for searching that the disclosed image black and white of the above embodiment of the present invention is had a common boundary has following advantage:
1. applicable to various test map, need not change testing software, break away from the yoke that a kind of testing software can only be applicable to a kind of map.
2. can avoid producing the phenomenon of erroneous judgement, so with a high credibility.
3. it is few to insert parameter, total as Optical Resolution, SER distance and black and white area.
In sum; though the present invention discloses as above with a preferred embodiment; right its is not in order to limit the present invention; anyly be familiar with this skill person; without departing from the spirit and scope of the present invention; when can being used for a variety of modifications and variations, so protection scope of the present invention is when looking accompanying being as the criterion that claim defines.