CN110348267A - A kind of horizontal and vertical parity check code detection localization method and device - Google Patents
- ️Fri Oct 18 2019
Summary of the invention
Based on the demand, the application proposes a kind of horizontal and vertical parity check code detection localization method and device, can be realized to a horizontal and vertical parity check code It is accurate detection and positioning.
A kind of horizontal and vertical parity check code detects localization method, comprising:
Binary conversion treatment is carried out to horizontal and vertical parity check code image and obtains a horizontal and vertical parity check code bianry image;
Described horizontal and vertical parity check code bianry image is filtered;
By calculating the average energy value and energy density of the described each image-region of horizontal and vertical parity check code bianry image, from the point A horizontal and vertical parity check code candidate region is selected in horizontal and vertical parity check code bianry image;
By by each sub-regions of the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code candidate region Energy density be compared, a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;
Processing is merged to described horizontal and vertical parity check code region, determines image district where the point horizontal and vertical parity check code in described horizontal and vertical parity check code image Domain.
Optionally, described pair of point horizontal and vertical parity check code image carries out binary conversion treatment and obtains a horizontal and vertical parity check code bianry image, comprising:
Binary conversion treatment is carried out to horizontal and vertical parity check code image according to the global threshold of setting, obtains a horizontal and vertical parity check code bianry image;
And/or
According to the gray average of each image-region of horizontal and vertical parity check code image, the threshold coefficient of each image-region is determined;
According to the gray average and threshold coefficient of each image-region, calculate separately to obtain the binaryzation of each image-region Threshold value;
According to the binarization threshold of each image-region, binary conversion treatment is carried out to each image-region respectively, is obtained a little Horizontal and vertical parity check code bianry image.
It is optionally, described that described horizontal and vertical parity check code bianry image is filtered, comprising:
Preset opening operation processing successively is carried out to described horizontal and vertical parity check code bianry image and dilation operation is handled.
Optionally, described the average energy value and energy by calculating the described each image-region of horizontal and vertical parity check code bianry image is close Degree, selects a horizontal and vertical parity check code candidate region from described horizontal and vertical parity check code bianry image, comprising:
Region division is carried out to described horizontal and vertical parity check code bianry image, obtains each image district of described horizontal and vertical parity check code bianry image Domain;
Calculate separately the average energy value and energy density of each image-region;
Average energy is selected from each image-region according to the average energy value and energy density of each image-region The image-region of value and energy density in preset threshold range;
Preset corrosion treatment is carried out respectively to the image-region selected;
From the image-region selected, the average energy value and energy density after selecting corrosion treatment are less than setting threshold The image-region of value, as a horizontal and vertical parity check code candidate region.
Optionally, described by by the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code candidate region The energy densities of each sub-regions be compared, a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region, comprising:
Each horizontal and vertical parity check code candidate region is divided into the subregion of setting quantity respectively;
The energy density and each horizontal and vertical parity check code candidate region for calculating separately each horizontal and vertical parity check code candidate region included each The energy density of sub-regions;
Corresponding each horizontal and vertical parity check code candidate region executes following operation respectively:
The energy density of judgement point horizontal and vertical parity check code candidate region, the energy for each sub-regions for being included with this horizontal and vertical parity check code candidate region Whether the difference of metric density is less than the difference threshold of setting, and, judge each sub-district that this horizontal and vertical parity check code candidate region is included Whether the difference of the energy density in domain is less than the difference threshold of setting;
If the energy density of this horizontal and vertical parity check code candidate region, each sub-regions for being included with this horizontal and vertical parity check code candidate region The difference of energy density is less than the difference threshold of setting, and the energy of this horizontal and vertical parity check code candidate region each sub-regions for being included The difference of density is less than the difference threshold of setting, it is determined that this horizontal and vertical parity check code candidate region is point horizontal and vertical parity check code region.
A kind of horizontal and vertical parity check code detects positioning device, comprising:
Binary conversion treatment unit obtains a horizontal and vertical parity check code bianry image for carrying out binary conversion treatment to horizontal and vertical parity check code image;
Filter processing unit, for being filtered to described horizontal and vertical parity check code bianry image;
First screening unit, for by calculating described each image-region of horizontal and vertical parity check code bianry image the average energy value and Energy density selects a horizontal and vertical parity check code candidate region from described horizontal and vertical parity check code bianry image;
Second screening unit, for by waiting the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code The energy density of each sub-regions of favored area is compared, and a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;
Merge processing unit determines in described horizontal and vertical parity check code image for merging processing to described horizontal and vertical parity check code region Image-region where point horizontal and vertical parity check code.
Optionally, the binary conversion treatment unit carries out binary conversion treatment to horizontal and vertical parity check code image and obtains a horizontal and vertical parity check code bianry image When, it is specifically used for:
Binary conversion treatment is carried out to horizontal and vertical parity check code image according to the global threshold of setting, obtains a horizontal and vertical parity check code bianry image;
And/or
According to the gray average of each image-region of horizontal and vertical parity check code image, the threshold coefficient of each image-region is determined;
According to the gray average and threshold coefficient of each image-region, calculate separately to obtain the binaryzation of each image-region Threshold value;
According to the binarization threshold of each image-region, binary conversion treatment is carried out to each image-region respectively, is obtained a little Horizontal and vertical parity check code bianry image.
Optionally, when the filter processing unit is filtered described horizontal and vertical parity check code bianry image, it is specifically used for:
Preset opening operation processing successively is carried out to described horizontal and vertical parity check code bianry image and dilation operation is handled.
Optionally, first screening unit, comprising:
Image division unit obtains described horizontal and vertical parity check code two-value for carrying out region division to described horizontal and vertical parity check code bianry image Each image-region of image;
Computing unit, for calculating separately the average energy value and energy density of each image-region;
First selecting unit, for the average energy value and energy density according to each image-region, from each image district In domain, the image-region of the average energy value and energy density in preset threshold range is selected;
Corrosion treatment unit, for carrying out preset corrosion treatment respectively to the image-region selected;
Second selecting unit, for from the image-region selected, the average energy value after selecting corrosion treatment and Energy density is less than the image-region of given threshold, as a horizontal and vertical parity check code candidate region.
Optionally, second screening unit is by by the energy density of each horizontal and vertical parity check code candidate region and each point The energy density of each sub-regions of horizontal and vertical parity check code candidate region is compared, and a horizontal and vertical parity check code area is selected from described horizontal and vertical parity check code candidate region When domain, it is specifically used for:
Each horizontal and vertical parity check code candidate region is divided into the subregion of setting quantity respectively;
The energy density and each horizontal and vertical parity check code candidate region for calculating separately each horizontal and vertical parity check code candidate region included each The energy density of sub-regions;
Corresponding each horizontal and vertical parity check code candidate region executes following operation respectively:
The energy density of judgement point horizontal and vertical parity check code candidate region, the energy for each sub-regions for being included with this horizontal and vertical parity check code candidate region Whether the difference of metric density is less than the difference threshold of setting, and, judge each sub-district that this horizontal and vertical parity check code candidate region is included Whether the difference of the energy density in domain is less than the difference threshold of setting;
If the energy density of this horizontal and vertical parity check code candidate region, each sub-regions for being included with this horizontal and vertical parity check code candidate region The difference of energy density is less than the difference threshold of setting, and the energy of this horizontal and vertical parity check code candidate region each sub-regions for being included The difference of density is less than the difference threshold of setting, it is determined that this horizontal and vertical parity check code candidate region is point horizontal and vertical parity check code region.
The point horizontal and vertical parity check code that the application proposes detects localization method, after getting a horizontal and vertical parity check code image, carries out to horizontal and vertical parity check code image Binary conversion treatment obtains a horizontal and vertical parity check code bianry image, and is filtered;Then by calculating described horizontal and vertical parity check code bianry image The average energy value and energy density of each image-region select a horizontal and vertical parity check code candidate region from described horizontal and vertical parity check code bianry image; And by by each sub-regions of the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code candidate region Energy density is compared, and a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;Finally to described horizontal and vertical parity check code region into Row merging treatment determines image-region where the point horizontal and vertical parity check code in described horizontal and vertical parity check code image.Above-mentioned technical proposal can be from a horizontal and vertical parity check code The image-region where a horizontal and vertical parity check code is detected in image, it can realize that the detection to horizontal and vertical parity check code positions, this method is applied to Point horizontal and vertical parity check code recognition, using quick detection and anchor point horizontal and vertical parity check code, so as to hoist point horizontal and vertical parity check code decoding efficiency.
Specific embodiment
The embodiment of the present application technical solution is suitable for point horizontal and vertical parity check code and distinguishes application scenarios, using the embodiment of the present application technical side Case can carry out accurate detection positioning to the point horizontal and vertical parity check code in horizontal and vertical parity check code image.
Illustratively, the embodiment of the present application technical solution can be applied to the hardware handles such as mobile phone, computer, processor and set It is standby, software program can also be encapsulated as and be performed.When above-mentioned hardware handles equipment executes the embodiment of the present application technical solution, or When the above-mentioned software program of person is run, it can be achieved to position the accurate detection of the point horizontal and vertical parity check code in a horizontal and vertical parity check code image, for a horizontal and vertical parity check code Identification provides basis.
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
As shown in Figure 1, the point horizontal and vertical parity check code that the embodiment of the present application proposes detects localization method, comprising:
S101, a horizontal and vertical parity check code bianry image is obtained to a horizontal and vertical parity check code image progress binary conversion treatment;
Specifically, above-mentioned point horizontal and vertical parity check code image, refers to the image comprising horizontal and vertical parity check code, which is by pixel according to spy What fixed array format was arranged, concrete form can be found in shown in Fig. 2.
Above-mentioned point horizontal and vertical parity check code image is gray level image, in order to improve the identification of image midpoint horizontal and vertical parity check code, the embodiment of the present application After getting the point horizontal and vertical parity check code image of gray scale, binary conversion treatment is carried out to this horizontal and vertical parity check code image, is converted into bianry image, i.e., Obtain a horizontal and vertical parity check code bianry image.
It should be noted that Digital Image Processing is usually handled gray level image, therefore in the embodiment of the present application The point horizontal and vertical parity check code image stated is gray level image, and the embodiment of the present application technical solution is to be suitable for carrying out a little the point horizontal and vertical parity check code image of gray scale The technical solution of horizontal and vertical parity check code detection positioning.It, can be first when above-mentioned point horizontal and vertical parity check code image is color image or other non-gray level images The point horizontal and vertical parity check code image that the point horizontal and vertical parity check code image of non-gray scale is first converted to gray scale, then according still further to the embodiment of the present application technical solution pair Point horizontal and vertical parity check code in the point horizontal and vertical parity check code image of gray scale carries out detection positioning.
S102, described horizontal and vertical parity check code bianry image is filtered;
Specifically, above-mentioned filtering processing can filter out the noise in a horizontal and vertical parity check code bianry image, it is embodied as to horizontal and vertical parity check code two It is worth the noise reduction process of image.
The implementation of property as an example, the embodiment of the present application uses a kind of improved morphologic filtering, to above-mentioned Point horizontal and vertical parity check code bianry image carry out noise reduction process.
When carrying out a binary conversion treatment to horizontal and vertical parity check code image and obtaining a horizontal and vertical parity check code bianry image, meeting during binary conversion treatment There is a small amount of image to contain noise, such noise spot is much smaller relative to code-point and distribution is irregular, to this embodiment of the present application An opening operation first carried out to horizontal and vertical parity check code bianry image, what the processing of this step can be eliminated in a horizontal and vertical parity check code bianry image above-mentioned makes an uproar Sound, while keeping code-point constant.
Then, the point horizontal and vertical parity check code bianry image after split calculation process carries out a dilation operation to the embodiment of the present application again, makes The code-point in code-point area becomes to enrich significant.
After successively carrying out above-mentioned opening operation processing and dilation operation processing to horizontal and vertical parity check code bianry image, dot matrix can be eliminated Noise in code bianry image obtains clearer code-point simultaneously.
Wherein, the concrete processing procedure of above-mentioned opening operation and dilation operation processing, reference can be made to common opening operation Treatment process and dilation operation treatment process realize that the embodiment of the present application is no longer described in detail.
S103, the average energy value and energy density by calculating the described each image-region of horizontal and vertical parity check code bianry image, from A horizontal and vertical parity check code candidate region is selected in described horizontal and vertical parity check code bianry image;
Specifically, above-mentioned point horizontal and vertical parity check code bianry image is divided into each image-region by the embodiment of the present application, then to each The average energy value and energy density of a image-region are analyzed.
Illustratively, when dividing image-region to above-mentioned horizontal and vertical parity check code bianry image, the form that can use sliding window is real It is existing, that is, to be slided on above-mentioned horizontal and vertical parity check code bianry image according to setting step-length using the sliding window being sized, every sliding An at time, the image-region in sliding window is set as to carry out the image that region division obtains to horizontal and vertical parity check code bianry image Region.
It on this basis, can be with while being slided in above-mentioned sliding window, and obtain each image-region divided The average energy value is carried out to the image-region that each is marked off in real time and energy density is analyzed.
According to a regulation for horizontal and vertical parity check code design standard, the average energy value and energy density of the point horizontal and vertical parity check code of a width standard should In the threshold range appraised and decided.Therefore, the embodiment of the present application calculates the average energy of the point each image-region of horizontal and vertical parity check code bianry image Value and energy density, detect each image-region the average energy value and energy density whether above-mentioned setting threshold range It is interior, that is, can determine whether image-region is a horizontal and vertical parity check code region.
According to the method described above, by horizontal and vertical parity check code bianry image, the average energy value and energy density exist the embodiment of the present application Image-region in the threshold range of above-mentioned setting is set as a horizontal and vertical parity check code candidate region.
S104, by by each of the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code candidate region The energy density of subregion is compared, and a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;
Specifically, standard point horizontal and vertical parity check code energy density be it is equally distributed, therefore, be divided into respectively when horizontal and vertical parity check code image will be put When a image-region, the energy density of the image-region really comprising point horizontal and vertical parity check code, should be also similar.
Therefore, the embodiment of the present application distinguishes each horizontal and vertical parity check code candidate region after obtaining each horizontal and vertical parity check code candidate region Sub-zone dividing is carried out, each horizontal and vertical parity check code candidate region is divided into multiple subregions, then, is directed to each horizontal and vertical parity check code candidate Region, by the energy density of this horizontal and vertical parity check code candidate region, with the energy densities of each sub-regions of this horizontal and vertical parity check code candidate region into Row compares, and judges whether it is close, that is, judges whether its difference is the threshold value of setting, if it is less than can determine energy density It is close, it thus can determine this horizontal and vertical parity check code candidate region for a horizontal and vertical parity check code region.
According to the method described above, horizontal and vertical parity check code region can really be put with identifying from each horizontal and vertical parity check code candidate region.
S105, processing is merged to described horizontal and vertical parity check code region, determines figure where the point horizontal and vertical parity check code in described horizontal and vertical parity check code image As region.
Specifically, finally, the embodiment of the present application merges the point horizontal and vertical parity check code region recognized in above-mentioned treatment process, only Have between a horizontal and vertical parity check code region has intersection that can merge in horizontal, vertical, inclined direction, finally merges obtained image district Domain, image-region as where the point horizontal and vertical parity check code in point horizontal and vertical parity check code image.
Wherein, it for the point horizontal and vertical parity check code region that can not merge, then individually records.
It should be noted that due to that when dividing image-region to horizontal and vertical parity check code bianry image, can adopt in step s 103 It is divided in real time with the mode of sliding window, therefore, the processing of above-mentioned steps S104 is also possible to for the figure often marked off As the processing that region is carried out, i.e., a horizontal and vertical parity check code candidate region is often marked off, judges whether it is a horizontal and vertical parity check code region.Accordingly , when being merged in step s105 to a horizontal and vertical parity check code region, and merge in real time, that is, whenever one new dot matrix of confirmation Code region merges the two, and the two is closed when this horizontal and vertical parity check code region can merge with the point horizontal and vertical parity check code region having been acknowledged And result is as the point horizontal and vertical parity check code region having confirmed that.
It is also just completed when confirming the last one point horizontal and vertical parity check code region to the conjunction in horizontal and vertical parity check code region according to above-mentioned processing And the real-time of scheme processing is higher.
By above-mentioned introduction as it can be seen that the point horizontal and vertical parity check code that the embodiment of the present application proposes detects localization method, a horizontal and vertical parity check code is being got After image, binary conversion treatment is carried out to horizontal and vertical parity check code image and obtains a horizontal and vertical parity check code bianry image, and is filtered;Then pass through The average energy value and energy density for calculating the described each image-region of horizontal and vertical parity check code bianry image, from described horizontal and vertical parity check code bianry image In select a horizontal and vertical parity check code candidate region;And by the way that the energy density of each horizontal and vertical parity check code candidate region and each horizontal and vertical parity check code are waited The energy density of each sub-regions of favored area is compared, and a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;Most Processing is merged to described horizontal and vertical parity check code region afterwards, determines image-region where the point horizontal and vertical parity check code in described horizontal and vertical parity check code image.It is above-mentioned Technical solution can detect the image-region where a horizontal and vertical parity check code from horizontal and vertical parity check code image, it can realize the detection to horizontal and vertical parity check code This method is applied to point horizontal and vertical parity check code recognition, using quick detection and anchor point horizontal and vertical parity check code, so as to the decoding of hoist point horizontal and vertical parity check code by positioning Efficiency.
The implementation of property as an example, another embodiment of the application disclose, above-mentioned to carry out to dot matrix image Binary conversion treatment obtains the specific implementation process of a horizontal and vertical parity check code bianry image, comprising:
Binary conversion treatment is carried out to horizontal and vertical parity check code image according to the global threshold of setting, obtains a horizontal and vertical parity check code bianry image;
Specifically, when disturbing factor is less, code-point and image in image are carried on the back when above-mentioned point horizontal and vertical parity check code image is than more visible Scape difference is larger, carries out binary conversion treatment effect preferably to a horizontal and vertical parity check code image with global threshold at this time and time-consuming is shorter.
Wherein, the size of above-mentioned global threshold is obtained by the sample experiment of a large amount of different type different scenes.
When there are be printed on background when certain disturbing factor, such as on code-point, scheme around code-point for above-mentioned point horizontal and vertical parity check code image Picture has an impact to code-point or there are noise, shades etc., and carrying out binary conversion treatment to image with global threshold at this time can not get rid of The influence of above-mentioned disturbing factor, it is unintelligible to will lead to binarization result.
To solve the above-mentioned problems, the embodiment of the present application carries out adaptive office for the above-mentioned point horizontal and vertical parity check code image that there is interference Portion's binary conversion treatment.
Specifically, dividing image-region to horizontal and vertical parity check code image, each image-region is determined.Then, for division determination Each image-region determines the threshold value system of each image-region according to the gray average of each image-region of horizontal and vertical parity check code image Number, the threshold coefficient are understood that as different threshold intervals according to set by different tonal gradations.
Further according to the gray average and threshold coefficient of each image-region, calculate separately to obtain the two-value of each image-region Change threshold value;
Illustratively, the product of the gray average of image-region and threshold coefficient, the binarization threshold as image-region.
Finally according to the binarization threshold of each image-region, binary conversion treatment is carried out to each image-region respectively, is obtained To a horizontal and vertical parity check code bianry image.
Compared with global threshold binary conversion treatment, can handle well code-point has above-mentioned adaptive threshold binary conversion treatment The point horizontal and vertical parity check code image of the disturbing factors such as complex background, shade, exposure.
The embodiment of the present application is in binary conversion treatment of the specific implementation to horizontal and vertical parity check code image, according to the matter of horizontal and vertical parity check code image Amount, selection carries out binary conversion treatment according to above-mentioned global threshold, or carries out adaptive threshold to image according to above-mentioned introduction Binaryzation effect can be improved alternatively, two kinds of binary conversion treatment modes can also be combined application in binary conversion treatment.
Shown in Figure 3 as a kind of optional implementation, another embodiment of the application discloses, described to pass through meter The average energy value and energy density for calculating the described each image-region of horizontal and vertical parity check code bianry image, from described horizontal and vertical parity check code bianry image Select a horizontal and vertical parity check code candidate region, comprising:
S303, region division is carried out to described horizontal and vertical parity check code bianry image, obtains each figure of described horizontal and vertical parity check code bianry image As region;
The implementation of property as an example, the embodiment of the present application is using the sliding window being sized, in a horizontal and vertical parity check code It is slided on bianry image according to setting step-length, is located at the picture material of sliding window after sliding every time, that is, is used as and divides The image-region arrived.
Alternatively, horizontal and vertical parity check code bianry image can also be directly divided into the image-region for being sized, setting quantity.
S304, the average energy value and energy density for calculating separately each image-region;
Illustratively, above-mentioned each image-region is calculated using quick point energy drawing method in the embodiment of the present application The average energy value and energy density.
Wherein, the specific calculating process of above-mentioned quick point energy drawing method, can refer to prior art execution, and the application is real Example is applied no longer to be described in detail.
S305, the average energy value and energy density according to each image-region are selected average from each image-region The image-region of energy value and energy density in preset threshold range;
Specifically, above-mentioned preset threshold range, refer to the average energy value and energy density of the point horizontal and vertical parity check code of standard Value range.
The embodiment of the present application is by the average energy value of above-mentioned each image-region and energy density and above-mentioned preset threshold value Range is compared, and from above-mentioned each image-region, selects the average energy value and energy density in above-mentioned preset threshold value model Enclose interior image-region.
S306, preset corrosion treatment is carried out respectively to the image-region selected;
Specifically, the image-region selected carries out corrosion treatment, the code-point in image can be eroded, enable image as drop It is low.The corrosion treatment is that common corrosion treatment process is adaptively adjusted.
S307, from the image-region selected, the average energy value and energy density after selecting corrosion treatment are less than The image-region of given threshold, as a horizontal and vertical parity check code candidate region.
Specifically, after carrying out corrosion treatment, energy can be reduced, true by many experiments for the point horizontal and vertical parity check code of standard Fixed, above-mentioned corrosion treatment can make the energy of dot matrix code be reduced to a certain threshold value, which is set as by the embodiment of the present application For determine image-region whether be a horizontal and vertical parity check code decision threshold.
When image-region elected, after above-mentioned corrosion treatment the average energy value and energy density be less than it is upper Threshold value is stated, it may be considered that the picture material of the image-region is point horizontal and vertical parity check code, determines that the image-region is candidate for point horizontal and vertical parity check code at this time Region, otherwise, that is, thinking the image-region not is a horizontal and vertical parity check code candidate region.
Step S308, S309 in the present embodiment respectively correspond step S104 in embodiment of the method shown in FIG. 1, S105, the content of particular content embodiment of the method shown in Figure 1, details are not described herein again.
The implementation of property as an example, another embodiment of the application also disclose, above-mentioned by by each point The energy density of the energy density of horizontal and vertical parity check code candidate region and each sub-regions of each horizontal and vertical parity check code candidate region is compared, A horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region, is specifically included:
Each horizontal and vertical parity check code candidate region is divided into the subregion of setting quantity respectively;And calculate separately each dot matrix The energy density for each sub-regions that the energy density of code candidate region and each horizontal and vertical parity check code candidate region are included;
Illustratively, as shown in figure 4, each of above-mentioned horizontal and vertical parity check code candidate region is divided into four by the embodiment of the present application The additional middle section of subregion totally five sub-regions.It, can be according to above-mentioned when the embodiment of the present application technical solution is embodied Actual size, the shape etc. of point horizontal and vertical parity check code candidate region, carry out flexible sub-zone dividing to it.
Then, corresponding each horizontal and vertical parity check code candidate region, calculates separately the energy density of this horizontal and vertical parity check code candidate region, Yi Jiwei The energy density for each sub-regions that this horizontal and vertical parity check code candidate region divides.
Next, corresponding each horizontal and vertical parity check code candidate region, executes following operation respectively:
The energy density of judgement point horizontal and vertical parity check code candidate region, the energy for each sub-regions for being included with this horizontal and vertical parity check code candidate region Whether the difference of metric density is less than the difference threshold of setting, and, judge each sub-district that this horizontal and vertical parity check code candidate region is included Whether the difference of the energy density in domain is less than the difference threshold of setting;
If the energy density of this horizontal and vertical parity check code candidate region, each sub-regions for being included with this horizontal and vertical parity check code candidate region The difference of energy density is less than the difference threshold of setting, and the energy of this horizontal and vertical parity check code candidate region each sub-regions for being included The difference of density is less than the difference threshold of setting, it is determined that this horizontal and vertical parity check code candidate region is point horizontal and vertical parity check code region.
Specifically, the energy density in each region is equally distributed within the scope of horizontal and vertical parity check code for the point horizontal and vertical parity check code of standard, The energy density in exactly each region is similar.
Based on this horizontal and vertical parity check code feature, the energy density of image can use to judge whether image is a horizontal and vertical parity check code image.That is, If the energy density of energy density and the image entirety of image all subregion is close, it may be considered that the image is a horizontal and vertical parity check code Image, otherwise it is assumed that the image is not a horizontal and vertical parity check code image.
According to the principle, for each of above-mentioned horizontal and vertical parity check code candidate region, the embodiment of the present application calculates separately the horizontal and vertical parity check code The difference of the energy density of candidate region and the mutual energy density of each sub-regions of this horizontal and vertical parity check code candidate region, Judge whether the difference of its mutual energy density is less than the difference threshold of setting.
If it is less than the difference threshold of setting, then it can determine that this horizontal and vertical parity check code candidate region for a horizontal and vertical parity check code region, otherwise may be used To determine that this horizontal and vertical parity check code candidate region is not a horizontal and vertical parity check code region.
Wherein, energy density and sub-regions that the difference threshold of above-mentioned setting passes through the point horizontal and vertical parity check code image to standard The difference of energy density carries out calculating determination.
According to the method described above, can judge whether above-mentioned each horizontal and vertical parity check code candidate region is a horizontal and vertical parity check code region respectively, thus Really point horizontal and vertical parity check code region can be selected from above-mentioned point horizontal and vertical parity check code candidate region.
Corresponding with above-mentioned point horizontal and vertical parity check code detection localization method, another embodiment of the application also discloses a kind of horizontal and vertical parity check code Positioning device is detected, as shown in figure 5, the device includes:
Binary conversion treatment unit 100 obtains a horizontal and vertical parity check code bianry image for carrying out binary conversion treatment to horizontal and vertical parity check code image;
Filter processing unit 110, for being filtered to described horizontal and vertical parity check code bianry image;
First screening unit 120, for the average energy by calculating the described each image-region of horizontal and vertical parity check code bianry image Value and energy density, select a horizontal and vertical parity check code candidate region from described horizontal and vertical parity check code bianry image;
Second screening unit 130, for by by the energy density and each horizontal and vertical parity check code of each horizontal and vertical parity check code candidate region The energy density of each sub-regions of candidate region is compared, and a horizontal and vertical parity check code region is selected from described horizontal and vertical parity check code candidate region;
Merge processing unit 140 determines in described horizontal and vertical parity check code image for merging processing to described horizontal and vertical parity check code region Point horizontal and vertical parity check code where image-region.
Optionally, disclosed in another embodiment of the application, 100 pairs of point horizontal and vertical parity check code images of the binary conversion treatment unit into When row binary conversion treatment obtains a horizontal and vertical parity check code bianry image, it is specifically used for:
Binary conversion treatment is carried out to horizontal and vertical parity check code image according to the global threshold of setting, obtains a horizontal and vertical parity check code bianry image;
And/or
According to the gray average of each image-region of horizontal and vertical parity check code image, the threshold coefficient of each image-region is determined;
According to the gray average and threshold coefficient of each image-region, calculate separately to obtain the binaryzation of each image-region Threshold value;
According to the binarization threshold of each image-region, binary conversion treatment is carried out to each image-region respectively, is obtained a little Horizontal and vertical parity check code bianry image.
Optionally, it is disclosed in another embodiment of the application, the filter processing unit 110 is to described horizontal and vertical parity check code two-value When image is filtered, it is specifically used for:
Preset opening operation processing successively is carried out to described horizontal and vertical parity check code bianry image and dilation operation is handled.
Optionally, it is disclosed in another embodiment of the application, first screening unit 120, comprising:
Image division unit obtains described horizontal and vertical parity check code two-value for carrying out region division to described horizontal and vertical parity check code bianry image Each image-region of image;
Computing unit, for calculating separately the average energy value and energy density of each image-region;
First selecting unit, for the average energy value and energy density according to each image-region, from each image district In domain, the image-region of the average energy value and energy density in preset threshold range is selected;
Corrosion treatment unit, for carrying out preset corrosion treatment respectively to the image-region selected;
Second selecting unit, for from the image-region selected, the average energy value after selecting corrosion treatment and Energy density is less than the image-region of given threshold, as a horizontal and vertical parity check code candidate region.
Optionally, it is disclosed in another embodiment of the application, second screening unit 130 is by by each horizontal and vertical parity check code The energy density of the energy density of candidate region and each sub-regions of each horizontal and vertical parity check code candidate region is compared, from institute It states when selecting a horizontal and vertical parity check code region in horizontal and vertical parity check code candidate region, is specifically used for:
Each horizontal and vertical parity check code candidate region is divided into the subregion of setting quantity respectively;
The energy density and each horizontal and vertical parity check code candidate region for calculating separately each horizontal and vertical parity check code candidate region included each The energy density of sub-regions;
Corresponding each horizontal and vertical parity check code candidate region executes following operation respectively:
The energy density of judgement point horizontal and vertical parity check code candidate region, the energy for each sub-regions for being included with this horizontal and vertical parity check code candidate region Whether the difference of metric density is less than the difference threshold of setting, and, judge each sub-district that this horizontal and vertical parity check code candidate region is included Whether the difference of the energy density in domain is less than the difference threshold of setting;
If the energy density of this horizontal and vertical parity check code candidate region, each sub-regions for being included with this horizontal and vertical parity check code candidate region The difference of energy density is less than the difference threshold of setting, and the energy of this horizontal and vertical parity check code candidate region each sub-regions for being included The difference of density is less than the difference threshold of setting, it is determined that this horizontal and vertical parity check code candidate region is point horizontal and vertical parity check code region.
Specifically, the specific works content of each unit in each embodiment of above-mentioned horizontal and vertical parity check code detection positioning device, is asked Referring to the content of above method embodiment, details are not described herein again.
For the various method embodiments described above, for simple description, therefore, it is stated as a series of action combinations, but Be those skilled in the art should understand that, the application is not limited by the described action sequence because according to the application, certain A little steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know that, it is retouched in specification The embodiment stated belongs to preferred embodiment, necessary to related actions and modules not necessarily the application.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
Step in each embodiment method of the application can be sequentially adjusted, merged and deleted according to actual needs.
Each embodiment kind device of the application and module in terminal and submodule can be merged according to actual needs, be drawn Divide and deletes.
In several embodiments provided herein, it should be understood that disclosed terminal, device and method, Ke Yitong Other modes are crossed to realize.For example, terminal embodiment described above is only schematical, for example, module or submodule Division, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple submodule or Module may be combined or can be integrated into another module, or some features can be ignored or not executed.Another point is shown The mutual coupling, direct-coupling or communication connection shown or discussed can be through some interfaces, between device or module Coupling or communication connection are connect, can be electrical property, mechanical or other forms.
Module or submodule may or may not be physically separated as illustrated by the separation member, as mould The component of block or submodule may or may not be physical module or submodule, it can and it is in one place, or It may be distributed on multiple network modules or submodule.Some or all of mould therein can be selected according to the actual needs Block or submodule achieve the purpose of the solution of this embodiment.
In addition, each functional module or submodule in each embodiment of the application can integrate in a processing module In, it is also possible to modules or submodule physically exists alone, it can also be integrated with two or more modules or submodule In a module.Above-mentioned integrated module or submodule both can take the form of hardware realization, can also use software function Energy module or the form of submodule are realized.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software unit or the two is implemented.Software unit can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.