A kind of image partition method and system of utilizing bar code recognitionTechnical field
The present invention relates to image Segmentation Technology field, be specifically related to a kind of image partition method and system of utilizing bar code recognition.
Background technology
The difficult point of current image segmentation system is that the image to cutting apart carries out correct correction, if bad to image correcting error effect, may cause image to cut apart failure, even if the image that image is cut apart after successfully cutting apart does not probably meet expection requirement yet, therefore how image correcting error effect is to improve the key problem that image is cut apart quality.
General image segmentation system is all identified and is done based on template, (cutting board and recognition mode definition procedure also can be merged into once and complete first to define a series of cutting board and recognition template, also reusable of cutting board and recognition template), then do image acquisition, the image collecting is done to template identification, the eigenwert of the eigenwert of the template that utilization defines and the image of collection compares, to determine the template of images match of current identification, and then utilize the cutting board defining to cut image.But this image segmentation system that image is carried out to template identification, depends on the result that template is identified, the success ratio of template identification is at present low compared with bar-code identification, and time-consuming is many compared with bar-code identification, and cost is high compared with bar-code identification.
Also the image segmentation system that the image segmentation system having does not carry out masterplate identification and just carries out simple image correction image, but this template of not carrying out is known in the situations such as method for distinguishing is spent at image rotation 90,180 degree, 270 degree, can cause image to cut apart failure or segmentation errors.
Summary of the invention
For the defect existing in prior art, the object of the present invention is to provide a kind of image partition method and system of utilizing bar code recognition, complete the correction to image by the method and system, improve the accuracy rate of image cutting.
For achieving the above object, the technical solution used in the present invention is as follows:
An image partition method that utilizes bar code recognition, comprises the following steps:
(1) image being set cuts apart template and preserves; With one or a class bar code, a kind of image is set and cuts apart template, and bar code and image are cut apart to template carry out associated;
(2) obtain and need to carry out the pending image that image is cut apart according to source document; Described source document refers to the file that contains bar code;
(3) pending image is carried out to bar code recognition, and carry out the correction of bar code, the anglec of rotation of record strip shape code and the bar code identifying;
(4), according to the anglec of rotation of bar code, carry out the correction of pending image;
(5) determine that according to the bar code that identifies image cuts apart template type, cut apart the pending Image Segmentation Using of template after to correction according to image.
Further, a kind of image partition method that utilizes bar code recognition as above, in step (1), described bar code is arranged by user as required, and image of a bar code correspondence cuts apart template or the corresponding image of a class bar code is cut apart template.
Further, a kind of image partition method that utilizes bar code recognition as above, in step (1), cuts apart template by the image setting and is saved in database or saves as configuration file.
Further, a kind of image partition method that utilizes bar code recognition as above, in step (2), described source document comprises original document.
Further, a kind of image partition method that utilizes bar code recognition as above, is obtained and need to be carried out the pending image that image is cut apart by image capture device; Described pending image refers to the image that contains bar code; Described image capture device comprises scanner, high instrument and the camera clapped.
Further again, a kind of image partition method that utilizes bar code recognition as above, in step (2), the bar code printing of source document is on source document or be printed on source document or stick on source document.
Further, a kind of image partition method that utilizes bar code recognition as above, in step (4), when pending image is rectified a deviation, the anglec of rotation of pending image is identical with the anglec of rotation of bar code.
An image segmentation system that utilizes bar code recognition, comprising:
Cut apart template-setup module: cut apart template and image is cut apart to template preservation for image is set; With one or a class bar code, a kind of image is set and cuts apart template, and bar code and image are cut apart to template carry out associated;
Image collection module: obtain and need to carry out the pending image that image is cut apart according to source document; Described source document refers to the file that contains bar code;
Bar code correction module: pending image is carried out to bar code recognition, and carry out the correction of bar code, the anglec of rotation of record strip shape code and the bar code identifying;
Image correcting error module: according to the anglec of rotation of bar code, carry out the correction of pending image;
Image is cut apart module: determine that according to the bar code identifying image cuts apart template type, cut apart the pending Image Segmentation Using of template after to correction according to image.
Further, a kind of image segmentation system that utilizes bar code recognition as above, described in cut apart template-setup module and comprise:
Cut apart template-setup unit: cut apart template for image being set according to bar code;
Associative cell: carry out associatedly for bar code and image being cut apart to template, and record strip shape code and image are cut apart the mapping relations of template.
Beneficial effect of the present invention is: method and system of the present invention arrange image according to bar code and cut apart template, bar code and image are cut apart to template to be associated, carrying out image while cutting apart, only need obtain the bar code of pending image, can find its corresponding image and cut apart template, thereby complete cutting apart of image.In addition, complete the correction of pending image by the angular deflection amount (anglec of rotation) of bar code, thereby further improved the accuracy of image cutting.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of a kind of image segmentation system that utilizes bar code recognition of the present invention;
Fig. 2 is the process flow diagram of a kind of image partition method that utilizes bar code recognition of the present invention;
Fig. 3 is the pending image in embodiment;
Fig. 4 completes the bar code after correction in embodiment;
Fig. 5 is the pending image completing in embodiment after correction.
Embodiment
Below in conjunction with Figure of description and embodiment, the present invention is described in further detail.
Fig. 1 shows the structured flowchart of a kind of image segmentation system that utilizes bar code recognition of the present invention, and this system has comprised that cutting apart template-setup module 11,image collection module 12, barcode correction module 13, imagecorrecting error module 14 and image cuts apart module 15.Wherein:
Cutting apart template-setup module 11 cuts apart template and image is cut apart to template preservation for image is set; With one or a class bar code, a kind of image is set and cuts apart template, and bar code and image are cut apart to template carry out associated; Cut apart template-setup module 11 and comprise for image is set according to bar code and cut apart cutting apart template-setup unit and carrying out associatedly for bar code and image being cut apart to template of template, and record strip shape code and image are cut apart the associative cell of the mapping relations of template;
Image collection module 12 is obtained and need to be carried out the pending image that image is cut apart according to source document; Described source document refers to the file that contains bar code;
Barcode correction module 13 is carried out bar code recognition to pending image, and carries out the correction of bar code, the anglec of rotation of record strip shape code and the bar code identifying;
Imagecorrecting error module 14, according to the anglec of rotation of bar code, is carried out the correction of pending image;
Image is cut apartmodule 15 and is determined that according to the bar code identifying image cuts apart template type, cuts apart the pending Image Segmentation Using of template after to correction according to image.
Fig. 2 shows a kind of process flow diagram of the image partition method that utilizes bar code recognition of image segmentation system based on utilizing bar code recognition in Fig. 1, and the method comprises the following steps:
Step S21: image is set and cuts apart template and preserve;
Image is set to be cut apart template and preserves, in present embodiment, with one or a class bar code, a kind of image is set and cuts apart template, and bar code and image are cut apart to template carry out associatedly, the image setting is cut apart to template and be saved to database or save as configuration file.Described bar code can be arranged as required by user, a corresponding image of bar code is cut apart template, or the corresponding image of a class bar code (multiple) is cut apart template, image is cut apart to template type has done associated with bar code simultaneously, when carrying out in subsequent step after bar code recognition, if find it is this time associated bar code, just find its corresponding image according to this associated bar code and cut apart just image cutting of template.
Step S22: obtain and need to carry out the pending image that image is cut apart;
Obtain and need to carry out the pending image that image is cut apart according to source document; Described source document refers to the file that contains bar code.For example source document is original document, on original document, need to have bar code, and both direction all aligns anyhow that (bar code and document general direction are consistent for bar code and original document, do not need alignment very, in step S23, carry out after bar-code identification tentatively rectifies a deviation to image by bar code, general pattern angular deviation is little, do not affect cutting territory is cut, the simultaneously follow-up image correcting error passing through that can utilize is with regard to just secondary correction of image), bar code can be printed on document, also can be printed on document, also ready-made bar code only can be attached on document.In the time obtaining the corresponding pending image of source document, use image capture device that source document (for example papery document) is gathered as picture format, image capture device can make scanner, high bat instrument or make a video recording first-class.As shown in Figure 3, collect the picture format of the papery document shown in Fig. 3 by image capture device, obtain pending image.
Step S23: pending image is carried out to bar code recognition, and carry out the correction of bar code;
Pending image is carried out to bar code recognition, can be to the bar code processing of rectifying a deviation in the process of carrying out bar code recognition, by bar code rotation to correct angle, and the anglec of rotation of record strip shape code and the bar code that identifies.As shown in Figure 4, by the processing of rectifying a deviation of the bar code shown in lower right in Fig. 3, be located at correct angle.Bar code correction is to utilize existing bar code identification technology, for example, for three nine-day periods after the winter solstice code, can regulation fine rule width be 2 pixels, wide line and fine rule ratio are 3:1, in the time doing bar code recognition, first judge the region at bar code place, then carry out image rectification, for example can adopt the various prior aries such as anti-perspective transform, obtain the RA of bar code.
Step S24: carry out the correction of pending image according to the anglec of rotation of bar code;
The anglec of rotation of the bar code obtaining according to step S23, carries out the correction of pending image, and the anglec of rotation of pending image correcting error selects the anglec of rotation identical with bar code, completes pending image after image rotation as shown in Figure 5.
Step S25: determine that image cuts apart template, cut apart the pending Image Segmentation Using of template after to correction according to image.
Determine that according to the bar code identifying image cuts apart template type, cut apart the pending Image Segmentation Using of template after to correction according to image.Cutting apart template according to image, to carry out that image cuts apart be prior art.
Method and system of the present invention, first utilize bar code recognition to rectify a deviation to image, and recycling bar code recognition determines that image cuts apart template, cuts apart thereby complete fast and accurately image.The method and system, compared with existing template recognition technology, success ratio is high, consuming time less, cost is low.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technology thereof, the present invention is also intended to comprise these changes and modification interior.