[go: up one dir, main page]

CN1361500A - Image automatic cropping method - Google Patents

Image automatic cropping method Download PDF

Info

Publication number
CN1361500A
CN1361500A CN 00137170 CN00137170A CN1361500A CN 1361500 A CN1361500 A CN 1361500A CN 00137170 CN00137170 CN 00137170 CN 00137170 A CN00137170 A CN 00137170A CN 1361500 A CN1361500 A CN 1361500A
Authority
CN
China
Prior art keywords
pattern
image
pattern unit
rgb
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 00137170
Other languages
Chinese (zh)
Other versions
CN1200389C (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.)
Hongyou Science & Technology Co Ltd
Original Assignee
Mustek Systems Inc
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 Mustek Systems Inc filed Critical Mustek Systems Inc
Priority to CN 00137170 priority Critical patent/CN1200389C/en
Publication of CN1361500A publication Critical patent/CN1361500A/en
Application granted granted Critical
Publication of CN1200389C publication Critical patent/CN1200389C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Input (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

A method for automatically cutting out the scanned object with irregular edge is disclosed. The scanner is provided with a pattern of fixed pattern on the bottom plate of the upper cover, which is used as a reference coordinate when cutting an object. When the scanner is first installed, the pattern is scanned in advance, and the coordinates of the pattern, the RGB mean and variance are analyzed to establish a base plate pattern database. Then, when the image is automatically cut, the data established by the bottom plate pattern database and the RGB chroma difference of the front scanning image of the scanning object are compared in sequence according to a pattern unit. And judging the position of the scanned object according to the comparison result. Then, the background part of the edge of the scanned object is processed with transparent color, and the required pattern can be obtained.

Description

Automatic image cutting out method
The present invention relates to a kind of automatic image cutting out method of scan image, relate in particular to a kind of cutting automatically and have the method for the scanned object of broken edge.
Scanner in the market provides in advance mostly sweeps the function that the file of image is swept in (pre-scan) and automatic search in advance.Yet the automatic method of cutting out of known scanned object is all got the square frame of figure periphery based on frame.With Fig. 1 is example.If the object of scanning is a star, the real image that institute's frame is got is but for square.Therefore, actual institute image to be processed has just comprised a large amount of gibberish in star periphery.The user must cut and handle the data that institute's frame is got, and just can obtain desired mulle.And the algorithm of general cutting is not good, and the speed of make handling is slower, just can see the result after the cutting process after usually will waiting for a period of time.
For figure with fine arts purposes, for example be applied to the pattern of webpage, its edge is generally irregular shape, if utilize known automatic method of cutting out, must cut out the periphery of figure earlier with square frame, be solid color with unwanted background transitions again, utilize the instrument of other application program then, in manual mode this solid color is set at Transparent color, is stored as specific file layout again, just can obtain wherein desired figure.Because this kind method depends on art designing professional person's processing, not only use inconvenience, and time-consuming consumption power.If scanning often and the data volume of handling when big, the apprentice is increased cost.And, with regard to the function that scanner provided, the regret of blemish in an otherwise perfect thing is also arranged.
Based on the problems referred to above, fundamental purpose of the present invention provides a kind of automatic image cutting out method, has the object image of broken edge with automatic cutting, and then improves the using value of scanner.
Another object of the present invention provides a kind of high efficiency automatic image cutting out method, the scope of cutting can be approached the actual size of broken edge, reducing the data volume of required processing, and then improves the efficient of handling.
Another purpose of the present invention provides a kind ofly can directly remove the method for the background image of object by scanner, so that scanner is widely used in the processing of graph data.
In order to achieve the above object, a kind of automatic image cutting out method of being applied on the one scan device of the present invention comprises step at least: set up a loam cake base plate style database; Read the preposition scan image of scanned object; According to a pattern unit that sets, compare the reference data of this base plate style database and the RGB colour difference of this preposition scan image successively; When the RGB colour difference of judging two pattern units is in a setting range, judge the image that does not comprise this scanned object in this pattern unit; When the RGB colour difference of judging two pattern units exceeds in the setting range, judge the image that comprises this scanned object in this pattern unit, and write down the position of this pattern unit; After the comparison of finishing entire image, in the pattern unit of this record, link adjacent pattern unit, to form the array graph data; And, read this graph data according to this array graph data edge.
In order to achieve the above object, the another kind of automatic image cutting out method that the present invention is applied on the one scan device comprises step at least: the base plate style of a loam cake is provided, and this base plate style is made of several identical pattern units of size; Carry out the scanning in advance of this base plate style, to produce the preposition scan image of this base plate style; Seek the actual coordinate of the pattern unit of this base plate style; Calculate and store the reference coordinate of each pattern unit, and RGB mean value reaches the wherein coordinate position of each pixel; Read the preposition scan image of scanned object; According to this pattern unit, compare the rgb value of RGB mean value and this preposition scan image of the pattern unit of this base plate style successively; When the RGB colour difference of judging two pattern units exceeds in the setting range, judge the image that comprises this scanned object in this pattern unit, and write down the position of this pattern unit; After the comparison of finishing entire image, in the pattern unit of this record, link adjacent pattern unit, to form the array graph data; Reach graph data edge, read this graph data according to this array.
Based on above-mentioned purpose, the present invention proposes a kind of cutting automatically and has the method for the scanned object of broken edge.The present invention provides to have the fixedly pattern of style at the loam cake base plate of scanner, the reference coordinate when getting object to be used as frame, and as the usefulness of the comparison of color.When scanner is installed for the first time, just scan the pattern of base plate in advance, with position and RGB mean value and the variance (variance) of analyzing each pattern, and set up the database of this base plate style.Afterwards, all when carrying out the automatic cutting of scanned object image, as long as according to a pattern unit, in turn compare the data of being stored in this base plate style database and the RGB colour difference of this preposition scan image, just whether include the view data of scanned object in each pattern unit of decidable.If the RGB colour difference of judging two pattern units in a scope of setting the time, does not then comprise the image of this scanned object in this pattern unit of decidable.Otherwise, the position of then writing down this pattern unit.After the judgement of entire image is finished in wait, linking adjacent pattern unit, just is the image-region of scanned object.Prolong the cutting in addition of its edge then, just can obtain the image of scanned object.The present invention not only can be applicable to the automatic cutting of irregular figure, also can accelerate known frame for the square chart picture and get speed.
The synoptic diagram that Fig. 1 gets for known automated graphics frame;
Fig. 2 A is the synoptic diagram of a kind of base plate style of the present invention;
Fig. 2 B is the pattern unit's enlarged diagram in the base plate style of Fig. 2 A;
Fig. 3 is a process flow diagram of setting up base plate style database of the present invention;
Fig. 4 utilizes base plate style database, the process flow diagram that carries out the automatic cutting of image for the present invention.
For addressing the above problem, the present invention provides one to have the fixedly pattern of style, shown in Fig. 2 A at the loam cake base plate of scanner.Reference coordinate when the purpose of this pattern is to be used as the cutting object, and as the usefulness of the comparison of color.As long as pattern itself has style and size is consistent, and the characteristic of queueing discipline gets final product, and is not limited to use the pattern of trellis.And should reduce overlapping fuzzy area between the pattern, the accuracy when increasing cutting.
Because the loam cake base plate of every scanner has error when mounted, therefore for trying to achieve reference coordinate accurately, must when the initial start-up scanner, read the pattern of base plate, debate the coordinate of knowing pattern, to set the database of a base plate style.Pattern with Fig. 2 A is an example, and the database building method of its base plate style as shown in Figure 3.
Step 31: with the low resolution of 50dpi, the style of run-down base plate in advance is to produce the preposition view data (pre-scanned image) of base plate style.
Step 32: seek the actual coordinate of pattern then, i.e. the position at pixel place.From the image of preposition scanning, begin to be used as the block of sampling by the upper left corner with a pocket.Then, from wherein looking for the most black block of gray scale.After finding,, make the coordinate of upper left corner black pattern, and find out the position (size of known pattern is all identical) of all black patterns according to this coordinate as the normal size of all black patterns.Then, find out the position (known have only two kinds of different gray scales) of all grey colored patterns with the same manner.The mode of looking for of pattern has many known algorithms to use, and repeats no more.
Step 33: reference coordinate and the RGB reference value of setting each pattern.Setting each pattern is a unit, because in each black pattern or grey colored pattern unit of being found out, therefore constituted by many pixels, with the RGB mean value and the variance of all pixels in this pattern unit, as the RGB reference value of this pattern unit.For example, have 20 pixels in each black pattern, just after the difference summation with the value of the red, green, blue colourity of 20 pixels in this unit, again respectively divided by 20, to be used as the RGB mean value of this black pattern unit, square margin then is that the red, green, blue chromatic value of 20 pixels in each pattern unit is subtracted each other back square with mean value respectively, in addition average again value.
Then, be used as a unit, to set its reference coordinate with the block of black pattern or grey colored pattern.With the enlarged drawing of Fig. 2 B is the example explanation, in the black pattern of finding out and grey colored pattern, set successively with reference to coordinate be (i, j).Because greater than its actual coordinate, the pattern comparison after therefore can making it is more quick effective with reference to the scope of coordinate.
Step 34: store the reference data of each pattern unit then, comprise: the position of each pixel in RGB reference value, this pattern unit, and the reference coordinate of this pattern unit.
So, just, set up base plate style data of database.The foundation of database only needs to set when scanner is installed for the first time once to get final product.Afterwards, just can carry out the processing of automatic cutting to the graph data of Any shape.
The principle of the automatic cutting of image of the present invention is that the reference data of the preposition scan image of scanned object and base plate style database is compared.The user can the punishment of the side of selection frames images get, or select a frame to get desired irregular figure.
The method of automatic cutting of the present invention is as shown in Figure 4:
Step 401: the reference data that is written into base plate style database.
Step 402: with same resolution,, carry out the program of sweeping in advance of scanned object, to produce the preposition view data of scanned object as 50dpi.
Step 403: according to the pattern unit that sets, in the position of comparison same units, the RGB colourity difference of the preposition image reference data of base plate pattern and the preposition scan image of scanned object.The purpose of this comparison is to find out the position at scanned object place.Because be not scanned the part that object hides, the feature of necessary meeting display backpanel type pattern.In like manner, the part of the pattern characteristics of display backpanel pattern just is not the position at scanned object place.And the color in the same pattern unit is all very approaching, and the image of general scanned object does not then have this characteristic.In addition, the mean flow rate data in the same pattern unit are also close, the reference when can be used for as filtration.
During comparison be reference coordinate with pattern be unit relatively.In the position of same pattern unit, compare the RGB mean value and the variance (variance) of the preposition scan image of scanned object, with the RGB reference value of this pattern unit.
Step 404: if both RGB colour differences in a default error amount, execution in step 405; Otherwise, execution in step 406.
Step 405: judge the image that does not comprise institute's scanned object in this pattern unit.
Step 406:, represent that this pattern unit comprises the image of scanned object if both colourity difference exceeds a default error amount.So, the position of writing down this pattern unit.
Step 407: after finishing the comparison of whole pattern units, in the pattern unit that is write down, link adjacent pattern unit, to become same group figure.If the image of single pass three pictures, just have three groups figure.
Step 408: at this moment, if select square frame to get mode, just according to the reference coordinate of the pattern unit in the upper left corner and the lower right corner, the scope of calculation block, comparison is to actual figure primitive unit cell, with the view data in the cutting square frame then.
Step 409: if select a frame to get wherein irregular pattern, just need find out record pattern unit on, down, a left side, right reference coordinate cuts out the irregular figure that will read.The mode of cutting can utilize present existing many algorithms to carry out.
After having cut,, can take out desired figure as long as carry out the processing of Transparent color at the data at scanned object edge.The fineness of the irregular area that cuts out is relevant with the style size of base plate pattern.If pattern is less, cutting area is comparatively meticulous, and the required block scope of handling again is also little, and data volume is also less.But, then be difficult to find out feature, and can't effectively compare with scanned object if style is too little.
So, use method of the present invention, not only can be applicable to cutting out of any irregular figure, also can improve the using value of scanner, any such as art designing's figure all can be by the cutting out of scanner, and be applied to the processing of webpage, or other Flame Image Process.And method of the present invention is not limited to the figure quantity of single pass, therefore can significantly improve the efficient that scanner uni is cut out.
The above only is the preferred embodiments of the present invention, and has reached practical effect widely, and all equalizations of doing according to claims of the present invention change and distortion, within the scope that all still belongs to patent of the present invention and contained.

Claims (12)

1.一种图像自动裁剪方法,应用于一扫描器上,至少包含步骤:1. A method for automatic cropping of images, applied to a scanner, at least comprising steps: 建立一上盖底板式样数据库;Establish a database of top cover and bottom plate styles; 读取扫描物件的前置扫描图像;Read the pre-scanned image of the scanned object; 依据一设定的图案单位,依次比对该底板式样数据库的参考数据及该前置扫描图像的RGB色度差;According to a set pattern unit, sequentially compare the RGB chromaticity difference between the reference data of the base plate pattern database and the pre-scanned image; 当判定两个图案单位的RGB色度差在一设定范围内时,判定该图案单位中不包含该扫描物件的图像;When it is determined that the RGB chromaticity difference between the two pattern units is within a set range, it is determined that the image of the scanned object is not included in the pattern unit; 当判定两个图案单位的RGB色度差超出一设定范围内时,判定该图案单位中包含该扫描物件的图像,并记录该图案单位的位置;When it is determined that the RGB chromaticity difference between the two pattern units exceeds a set range, it is determined that the image of the scanned object is included in the pattern unit, and the position of the pattern unit is recorded; 当完成整个图像的比对后,在该记录的图案单位中,连结相邻的图案单位,以形成数组图形数据;及After the comparison of the entire image is completed, in the pattern unit of the record, connect adjacent pattern units to form an array of pattern data; and 依据该数组图形数据边缘,读取该图形数据。Read the graphic data according to the edge of the array graphic data. 2.如权利要求1所述的方法,其中上述建立底板式样数据库的步骤至少包含:2. The method as claimed in claim 1, wherein the above-mentioned step of establishing a base plate pattern database comprises at least: 提供一上盖的底板式样,该底板式样由数个大小相同的图案单位所构成;Provide a bottom plate pattern of the upper cover, the bottom plate pattern is composed of several pattern units of the same size; 执行该底板式样的预先扫描,以产生该底板式样的前置扫描图像;performing a pre-scan of the floor pattern to generate a pre-scan image of the floor pattern; 寻找该底板式样的图案单位的实际坐标;Find the actual coordinates of the pattern unit of the base pattern; 计算每一个图案单位的参考坐标及RGB参考值;及Calculating reference coordinates and RGB reference values for each pattern unit; and 存储每一个图案单位的参考数据。Reference data is stored for each pattern unit. 3.如权利要求2所述的方法,其中上述图案单位的参考数据包含:3. The method of claim 2, wherein the reference data of the above-mentioned pattern units comprises: 图案单位的RGB参考值、每一个图素的坐标位置、及图案单位的参考坐标。The RGB reference value of the pattern unit, the coordinate position of each pixel, and the reference coordinate of the pattern unit. 4.如权利要求2所述的方法,其中上述底板式样的前置扫描图像与上述扫描物件的前置扫描图像的分辨率相同。4. The method of claim 2, wherein the pre-scanned image of the substrate pattern has the same resolution as the pre-scanned image of the scanned object. 5.如权利要求3所述的方法,其中上述RGB参考值为上述图案单位中RGB的平均值。5. The method as claimed in claim 3, wherein the RGB reference value is an average value of RGB in the pattern unit. 6.如权利要求3所述的方法,其中上述图案单位的参考坐标范围至少大于一个图素的范围。6. The method as claimed in claim 3, wherein the reference coordinate range of the pattern unit is at least larger than the range of one pixel. 7.如权利要求3所述的方法,其中上述图案单位的实际坐标为上述图案单位中的图素坐标。7. The method of claim 3, wherein the actual coordinates of the pattern units are pixel coordinates in the pattern units. 8.如权利要求1所述的方法,还包含步骤:8. The method of claim 1, further comprising the steps of: 以透明色处理上述数组图形数据边缘。The above-mentioned array graphic data edges are processed with a transparent color. 9.一种图像自动裁剪方法,应用于一扫描器上,至少包含步骤:9. A method for automatic cropping of an image, applied to a scanner, at least comprising steps: 提供一上盖的底板式样,该底板式样由数个大小相同的图案单位所构成;Provide a bottom plate pattern of the upper cover, the bottom plate pattern is composed of several pattern units of the same size; 执行该底板式样的预先扫描,以产生该底板式样的前置扫描图像;performing a pre-scan of the floor pattern to generate a pre-scan image of the floor pattern; 寻找该底板式样的图案单位的实际坐标;Find the actual coordinates of the pattern unit of the base pattern; 计算并存储每一个图案单位的参考坐标,及RGB平均值及其中每一个图素的坐标位置;Calculate and store the reference coordinates of each pattern unit, the average value of RGB and the coordinate position of each pixel; 读取扫描物件的前置扫描图像;Read the pre-scanned image of the scanned object; 依据该图案单位,依次比对该底板式样的图案单位的RGB平均值与该前置扫描图像的RGB值;According to the pattern unit, sequentially compare the RGB average value of the pattern unit of the base plate style with the RGB value of the pre-scanned image; 当判定两个图案单位的RGB色度差超出一设定范围内时,判定该图案单位中包含该扫描物件的图像,并记录该图案单位的位置;When it is determined that the RGB chromaticity difference between the two pattern units exceeds a set range, it is determined that the image of the scanned object is included in the pattern unit, and the position of the pattern unit is recorded; 当完成整个图像的比对后,在该记录的图案单位中,连结相邻的图案单位,以形成数组图形数据;及After the comparison of the entire image is completed, in the pattern unit of the record, connect adjacent pattern units to form an array of pattern data; and 依据该数组的图形数据边缘,读取该图形数据。Read the graphic data according to the graphic data edge of the array. 10.如权利要求9所述的方法,还包含步骤:10. The method of claim 9, further comprising the steps of: 当判定两个图案单位的RGB色度差在一设定范围内时,判定该图案单位中不包含上述扫描物件的图像。When it is determined that the RGB chromaticity difference between the two pattern units is within a set range, it is determined that the image of the scanned object is not included in the pattern unit. 11.如权利要求9所述的方法,还包含步骤:11. The method of claim 9, further comprising the steps of: 以透明色处理上述数组图形数据边缘。The above-mentioned array graphic data edges are processed with a transparent color. 12.如权利要求9所述的方法,其中上述底板式样的前置扫描图像与上述扫描物件的前置扫描图像的分辨率相同。12. The method of claim 9, wherein the pre-scanned image of the substrate pattern has the same resolution as the pre-scanned image of the scanned object.
CN 00137170 2000-12-29 2000-12-29 Image automatic cropping method Expired - Fee Related CN1200389C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 00137170 CN1200389C (en) 2000-12-29 2000-12-29 Image automatic cropping method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 00137170 CN1200389C (en) 2000-12-29 2000-12-29 Image automatic cropping method

Publications (2)

Publication Number Publication Date
CN1361500A true CN1361500A (en) 2002-07-31
CN1200389C CN1200389C (en) 2005-05-04

Family

ID=4597695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 00137170 Expired - Fee Related CN1200389C (en) 2000-12-29 2000-12-29 Image automatic cropping method

Country Status (1)

Country Link
CN (1) CN1200389C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1324874C (en) * 2004-03-25 2007-07-04 宇东电浆科技股份有限公司 Image scanning device with position line designed on covering plate
US9413912B2 (en) 2012-10-26 2016-08-09 Abbyy Development Llc Scanning device having a bed cover including a pattern of repeated design elements

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1324874C (en) * 2004-03-25 2007-07-04 宇东电浆科技股份有限公司 Image scanning device with position line designed on covering plate
US9413912B2 (en) 2012-10-26 2016-08-09 Abbyy Development Llc Scanning device having a bed cover including a pattern of repeated design elements

Also Published As

Publication number Publication date
CN1200389C (en) 2005-05-04

Similar Documents

Publication Publication Date Title
US7565028B2 (en) Digital composition of a mosaic image
US6738154B1 (en) Locating the position and orientation of multiple objects with a smart platen
US7433518B2 (en) Image selection support system for supporting selection of well-photographed image from plural images
US6898316B2 (en) Multiple image area detection in a digital image
CN1129091C (en) Antialiasing of silhouette edges
US20040114829A1 (en) Method and system for detecting and correcting defects in a digital image
US6556721B1 (en) Method for image auto-cropping
US5892854A (en) Automatic image registration using binary moments
CN111145105A (en) Image rapid defogging method and device, terminal and storage medium
CN110533583A (en) A kind of adapting to image augmented system based on cervical liquid-based cells
CN108460833A (en) A kind of information platform building traditional architecture digital protection and reparation based on BIM
CN113284218A (en) Particle animation realization method, device, equipment and storage medium
CN114723601B (en) Model structured modeling and rapid rendering method under virtual scene
CN107527277A (en) A kind of intelligent curtain Art Design system based on mobile terminal
CN113392819B (en) Batch academic image automatic segmentation and labeling device and method
CN1361500A (en) Image automatic cropping method
EP1058912B1 (en) Subsampled texture edge antialiasing
CN113436206A (en) Pathological tissue section scanning area positioning method based on cluster segmentation
CN1148946C (en) Automatic image cutting method
GB2360919A (en) Appearance modelling
TW469732B (en) Auto-crop method of image
EP0975146B1 (en) Locating the position and orientation of multiple objects with a smart platen
CN115578333A (en) Domestic ceramic surface defect detection method based on region division and yolo5
JP2006031688A (en) Image processing device, method, and program
CN1397915A (en) Overlay screen transparent processing device and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: YUDONG OPTICAL CO., LTD.

Free format text: FORMER OWNER: HONGYOU SCIENCE AND TECHNOLOGY CO LTD

Effective date: 20070119

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20070119

Address after: Delaware

Patentee after: Hongyou Science & Technology Co., Ltd.

Address before: Hsinchu Science Industrial Park, Taiwan

Patentee before: Hongyou Science and Technology Co., Ltd.

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20050504

Termination date: 20121229