The method of scanning irregular object
Technical field
The present invention relates to a kind of method of sweep object, and be particularly related to a kind of method that scans irregular object.
Background technology
Scanner is a kind of machine between duplicating machine and camera.In the past because expensive price almost is some patents as particular job persons such as artistic workings.In recent years,, squeezed into the main flow in the personal computer world finally, become the senior general of PC peripheral devices because the price that strong competition the caused downslide in scanner market is added in advancing by leaps and bounds of computer technology.
Scanner can be distinguished into some kinds of forms according to its price or function, and general scanner approximately can be distinguished into handly scanner, paper feeding scanner, business card scanner, negative film scanner and falt bed scanner etc. basically.Wherein, the similar glass platform of falt bed scanner is that file or pattern are placed on the flat glass, is moved by sensor and data is read in.Because its structure is can be too complicated, and also difficulty not too of using method, add the function extendibility that it has height, therefore become the arrange in pairs or groups main flow of scanner of computing machine user now.
At present, when the object in user's desire use scanner scanning file, can in the preview window of scanner driver, come frame to select this object usually with fixing rectangle.Yet, when this object when being irregularly shaped, this mode can not allow the user select object with the direct frame of the mode of intuition, and after the irregular object with fixing rectangle institute frame choosing is scanning, also must process via image processing software, could be identical with the actual image of irregular object.Therefore, such mode does not only have the very mode of operation of intuition, and the process of handling is quite loaded down with trivial details.
Summary of the invention
The present invention is that the imaged frame that allows the user can utilize drawing instruments such as paintbrush, straight line or curve directly preview the to be come out required object (comprising irregular object) of selecting oneself is done scanning.Therefore, when the object of institute's frame choosing was irregular object, the irregular object that scanning is come out can directly be utilized, and does not process and do not need to deliver to image processing software again.
For reaching above-mentioned and other purpose, the present invention proposes a kind of method that scans irregular object.In the method, at first in the preview window, can utilize the drawing instrument frame to select object and obtain object box, this object box has several row and several row.Then, can write down the reference position and the final position of each row.Next, can utilize the peak of this object box and the most left point and calculate the upper left point of this object box, and can utilize the minimum point of this object box and the rightest point and calculate the lower-right most point of this object box.Afterwards, scan and obtain the sweep object frame with upper left scope to lower-right most point, this sweep object frame comprises object box and background parts.At last, the background colour of background parts is removed.
In preferred embodiment of the present invention, the step that the background colour of background parts is removed comprises the following steps: at first, can remove the background colour of background parts.Then, when meet this object box these row in one row reference position the time, can stop to remove background colour.Next, can find the final position of these row.At last, can continue to remove background colour, all remove up to the background colour of background parts.In addition, the step that the background colour of background parts is removed more comprises the following steps: when the reference position of these row of not meeting this object box, the step that can get back to the background colour of removing background parts.
In preferred embodiment of the present invention, when object too hour, can utilize magnifier that object is amplified, utilize drawing instrument to come frame to select object to make things convenient for the user.
In preferred embodiment of the present invention, drawing instrument can be paintbrush, straight line or curve.
The present invention also proposes a kind of method that scans irregular object.In the method, at first in the preview window, can utilize the drawing instrument frame to select object and obtain object box, this object box has several row and several row.Then, can write down the reference position and the final position of each row.Next, can utilize the peak of this object box and the most left point and calculate the upper left point of this object box, and can utilize the minimum point of this object box and the rightest point and calculate the lower-right most point of this object box.Afterwards, scan and obtain the sweep object frame with upper left scope to lower-right most point, this sweep object frame comprises object box and background parts.At last, the background colour of background parts is removed.
In preferred embodiment of the present invention, the step that the background colour of background parts is removed comprises the following steps: at first, can remove the background colour of background parts.Then, when the reference position of delegation in these row of meeting this object box, can stop to remove background colour.Next, can find the final position of this journey.At last, can continue to remove background colour, all remove up to the background colour of background parts.In addition, the step that the background colour of background parts is removed more comprises the following steps: when the reference position of this journey of not meeting this object box, the step that can get back to the background colour of removing background parts.
In sum, the present invention is that the imaged frame that allows the user can utilize drawing instruments such as paintbrush, straight line or curve directly preview the to be come out required object (comprising irregular object) of selecting oneself is done scanning.Therefore, when the object of institute's frame choosing was irregular object, the irregular object that scanning is come out can directly be utilized, and does not process and do not need to deliver to image processing software again.Moreover the present invention allows the user come the frame required object (comprising irregular object) of selecting oneself in the mode of intuition, and no longer is to come the frame choosing to desire scanned objects with fixing rectangle.
For allowing above and other objects of the present invention, feature and advantage, can become apparent more, preferred embodiment cited below particularly, and conjunction with figs. are described below in detail:
Description of drawings
Fig. 1 is the method flow diagram according to the scanning irregular object of a preferred embodiment of the present invention.
Fig. 2 be according to a preferred embodiment of the present invention in the preview window, utilize drawing instrument frame choosing to desire the figure of scanned objects.
Fig. 3 be according to a preferred embodiment of the present invention when object too hour, utilize magnifier will desire the figure of scanned objects amplification.
Fig. 4 be according to a preferred embodiment of the present invention with upper left point (X
1, Y
1) to lower-right most point (X
2, Y
2) scope scan and obtain the figure of sweep object frame.
Fig. 5 is the method flow diagram of removing according to the background colour with background parts of a preferred embodiment of the present invention.
Description of reference numerals is as follows:
202: paintbrush
204: curve
206: straight line
208: object
210: magnifier
212: dwindle mirror
402: the sweep object frame
404: object box
406: background parts
S102-S110: the method flow diagram of the scanning irregular object of a preferred embodiment of the present invention
S502-S510: the method flow diagram that the background colour with background parts of a preferred embodiment of the present invention is removed
Embodiment
Fig. 1 is the method flow diagram according to the scanning irregular object of a preferred embodiment of the present invention.At first, when user's desire selects own desired object (comprising irregular object) to do scanning, can be in the preview window after scanner scans in advance, in the mode of intuition very, utilize the drawing instrument frame to select oneself needed object and obtain object box, and this object box has several row and several row (as step S102).For clearer understanding step S102, please refer to Fig. 2, it illustrates be according to a preferred embodiment of the present invention in the preview window, utilize the choosing of drawing instrument frame to desire the figure of scanned objects 208.In Fig. 2, the user can use the drawing instrument of paintbrush 202, curve 204 or straight line 206 to come frame to select the user to desire scanned objects 208.Only represent at this drawing instrument that is noted that Fig. 2 illustrates, but being familiar with this operator should be appreciated that drawing instrument of the present invention also can comprise the drawing instrument of other type with paintbrush 202, curve 204 and straight line 206.If allow the user be difficult to frame when selecting and object 208 is too little, the user can use magnifier 210, object 208 is amplified and allow the user be convenient to do the action of frame choosing, and according to a preferred embodiment of the present invention when object 208 too hour, utilize magnifier 210 will desire the figure that scanned objects 208 is amplified, please refer to Fig. 3 and illustrate.In addition,, can utilize and dwindle mirror 212, object is dwindled and allow the user be convenient to do the action of frame choosing if the user desires the object of frame choosing when too big.
Then, can write down reference position and final position (as the step S104) of each row (or each row) of this object box.Owing to write down the reference position and the final position of each row (or each row) of this object box, so can obtain peak, minimum point, the most left point and the rightest point of this object box.Next, can utilize the peak of this object box and the most left point and calculate the upper left point (X of this object box
1, Y
1), and can utilize the minimum point of this object box and the rightest point and calculate the lower-right most point (X of this object box
2, Y
2) (as step S106).Afterwards, scanner can be with upper left point (X
1, Y
1) to lower-right most point (X
2, Y
2) scope scan and obtain sweep object frame (as step S108), and according to a preferred embodiment of the present invention with upper left point (X
1, Y
1) to lower-right most point (X
2, Y
2) scope scan and obtain the figure of sweep object frame, please refer to Fig. 4 and illustrate.As shown in Figure 4, the zone of label 402 is the sweep object frame.Because scanner can only whenever be listed as and does scanning (or every row), therefore therefore the object box 404 of sweep object frame 402 that obtains after the scanning and the frame choosing of user institute and inequality, must remove (as step S110) with the background colour of background parts 406 at last.
Next, please refer to Fig. 5, it illustrates is the process flow diagram of the method removed according to the background colour with background parts of a preferred embodiment of the present invention.To cooperate Fig. 4 to do explanation below.At first, can carry out the action (as step S502) of the background colour of removing background parts 406.Then, can judge whether to run into the reference position (as step S504) that one of object box 404 is listed as (or delegation).Then, in the process of removing background colour, when running into the reference position of these row (or this journey) of object box 404, the action (as step S506) that can stop to remove background colour.Next, can find the final position (as step S508) of these row (or this journey).At last, can continue to remove background colour, all remove (as step S510) up to the background colour of background parts 406.And in the process of removing background colour, when not running into the reference position of these row (or this journey) of object box 404, can get back to step S502.
In sum, the present invention is that the imaged frame that allows the user can utilize drawing instruments such as paintbrush, straight line or curve directly preview the to be come out required object (comprising irregular object) of selecting oneself is done scanning.Therefore, when the object of institute's frame choosing was irregular object, the irregular object that scanning is come out can directly be utilized, and does not process and do not need to deliver to image processing software again.Moreover the present invention allows the user come the frame required object (comprising irregular object) of selecting oneself in the mode of intuition, and no longer is to come the frame choosing to desire scanned objects with fixing rectangle.
Though the present invention is exposed in preferred embodiment; right its is not in order to limit the present invention; those of ordinary skill in the art can do various changes and retouching without departing from the spirit and scope of the present invention, so protection scope of the present invention is as the criterion with the scope that claims define.