Summary of the invention
The object of the embodiment of the present invention has been to provide a kind of method for drafting and device of image outline, Neng GougengDrawing image profile exactly.
In order to achieve the above object, the invention discloses a kind of method for drafting of image outline, be applied to and haveThe electronic equipment of display screen, described method comprises:
A. in the time detecting that image outline is drawn instruction, in the picture for the treatment of draw outline, adopt edge inspectionMethod of determining and calculating is determined the coordinate of pixel in image outline;
B. according to the position of the coordinate of pixel in described image outline and active user's input, take turns at imageIn exterior feature, determine the starting point that profile is drawn;
C. draw the direction of operation according to active user, determine in image outline corresponding to this starting point and carry outThe drafting direction of drawing, and in image outline, determine and set a quantity pixel according to described drafting direction;
D. whether judge last pixel corresponding to this drafting direction in a described setting quantity pixelFor the terminating point of described image outline, if so, according to the pixel in the target image profile of preserving,And the pixel in the image outline between starting point and ending point in described image outline, determine target imageProfile, otherwise the pixel using a described setting quantity pixel in target image profile is also preserved,Described last pixel is performed step to C as starting point.
Preferably, described according to the position of the coordinate of pixel in described image outline and active user's input,In image outline, determine that the starting point that profile is drawn comprises:
According to the position of active user's input, obtain the coordinate of described position;
According to the coordinate of pixel in the coordinate of described position and described image outline, determine described position and instituteState the distance between each pixel in image outline;
By the pixel in image outline corresponding minimum range, be defined as the starting point that profile is drawn.
Preferably, described by the pixel in image outline corresponding minimum range, be defined as profile drawStarting point comprises:
Judge whether described minimum range is less than default the first distance threshold, if so, by minimum range correspondenceImage outline in pixel, be defined as profile draw starting point.
Preferably, described method also comprises:
In the time that described minimum range is not less than default the first distance threshold, output information.
Preferably, described direction of drawing operation according to active user, determines the image wheel that this starting point is correspondingThe drafting direction of drawing in exterior feature, comprising:
Draw the direction of operation according to active user, determine that active user draws the angle corresponding to direction of operationDegree;
According to each angular range corresponding to each drafting direction of preserving for this starting point, determine this angleThe angular range at place is image wheel corresponding to this starting point by drafting orientation determination corresponding this angular rangeThe drafting direction of drawing in exterior feature.
Preferably, last picture corresponding to this drafting direction in the described setting quantity pixel of described judgementWhether vegetarian refreshments is the terminating point of described image outline, comprising:
Determine the coordinate of last pixel corresponding to this drafting direction in a described setting quantity pixel;
Between the coordinate of the starting point that the coordinate of described last pixel of judgement and described profile are drawnWhether distance is less than default second distance threshold value;
If so, determine that described last pixel is terminating point, otherwise, determine described last pictureVegetarian refreshments nonterminal point.
Preferably, described according to the position of the coordinate of pixel in described image outline and active user's input,Determine the starting point of profile drafting in image outline before, described method also comprises:
According to the coordinate of pixel in definite image outline, generate with the picture for the treatment of draw outline contour wideThe black and white picture of binaryzation, described in comprising in the black and white picture of described binaryzation, treat the picture of draw outlineImage outline.
Preferably, described using a described setting quantity pixel pixel in target image profile and protectDeposit, comprising:
Judge in target image profile whether preserve a described setting quantity pixel, if not, by instituteState and set a quantity pixel as the pixel in target image profile and preserve.
Preferably, described method also comprises:
If preserved a described setting quantity pixel in target image profile, delete preserve described inSet a quantity pixel.
Preferably, described edge detection algorithm comprises triumphant Buddhist nun Canny edge detection algorithm.
In order to achieve the above object, the invention also discloses a kind of drawing apparatus of image outline, be applied to toolHave the electronic equipment of display screen, described device comprises:
Image outline detection module, for when detecting that image outline draws when instruction, is treating draw outlineIn picture, adopt edge detection algorithm to determine the coordinate of pixel in image outline;
Starting point determination module, for inputting according to the coordinate of described image outline pixel and active userPosition, in image outline determine profile draw starting point;
Draw orientation determination module, for draw the direction of operation according to active user, determine this starting point pairThe drafting direction of drawing in the image outline of answering, and determine in image outline according to described drafting directionSet a quantity pixel;
Terminating point judge module is corresponding for judging described this drafting direction of a setting quantity pixelWhether a rear pixel is the terminating point of described image outline;
Target image profile determination module, if for described this drafting direction pair of a setting quantity pixelLast pixel of answering is the terminating point of described image outline, according in the target image profile of preservingPixel, and the pixel in the image outline between starting point and ending point in described image outline, reallyImage outline sets the goal;
Pixel is preserved module, if corresponding for described this drafting direction of a setting quantity pixelA rear terminating point that pixel is not described image outline, using a described setting quantity pixel as orderPixel in mark image outline is also preserved, and using described last pixel as starting point, triggering is paintedOrientation determination module processed.
Preferably, described starting point determination module comprises:
Coordinate obtains submodule, for according to the position of active user's input, obtains the coordinate of described position;
Distance is determined submodule, for according to the seat of the coordinate of described position and described image outline pixelMark, determines the distance between each pixel in described position and described image outline;
Starting point is determined submodule, for by the pixel of image outline corresponding minimum range, is defined asThe starting point that profile is drawn.
Preferably, described starting point determine submodule specifically for:
Judge whether described minimum range is less than default the first distance threshold, if so, by minimum range correspondenceImage outline in pixel, be defined as profile draw starting point.
Preferably, described device also comprises:
Information output module, while presetting the first distance threshold for being not less than when described minimum range, defeatedGo out information.
Preferably, described drafting orientation determination module comprises:
Angle is determined submodule, for draw the direction of operation according to active user, determines that active user drawsThe angle corresponding to direction of operation;
Draw orientation determination submodule, for corresponding according to each drafting direction of preserving for this starting pointEach angular range, determines the angular range at this angle place, by true drafting direction corresponding this angular rangeBe decided to be the drafting direction of drawing in image outline corresponding to this starting point.
Preferably, described terminating point judge module comprises:
Pixel coordinate is determined submodule, for determining described this drafting direction pair of a setting quantity pixelThe coordinate of last pixel of answering;
Coordinate distance judges submodule, paints for the coordinate and the described profile that judge described last pixelWhether the distance between the coordinate of the starting point of system is less than default second distance threshold value;
Terminating point is determined submodule, if for coordinate and the described image outline of described last pixelDistance between the starting point coordinate that middle profile is drawn is less than default second distance threshold value, determines described lastA pixel is terminating point, otherwise, determine described last pixel nonterminal point.
Preferably, before described starting point determination module, described device also comprises:
Binaryzation picture determination module, for according to the coordinate of definite image outline pixel, generate withThe black and white picture for the treatment of the contour wide binaryzation of picture of draw outline, wraps in the black and white picture of described binaryzationDescribed in containing, treat the image outline of the picture of draw outline.
Preferably, described pixel preserve module specifically for:
Judge in target image profile whether preserve a described setting quantity pixel, if not, by instituteState and set a quantity pixel as the pixel in target image profile and preserve.
Preferably, described device also comprises:
Pixel removing module, if preserved a described setting quantity pixel for target image profilePoint, deletes a described setting quantity pixel of preserving.
As seen from the above technical solution, the embodiment of the present invention first adopts edge detection algorithm to determine image outlineThe coordinate of middle pixel, then according to the direction of the position of user's input and drafting operation, true from image outlineMake the pixel coordinate of target image profile, therefore drawing image profile more accurately, improves userExperience.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearlyChu, complete description. Obviously, described embodiment is only a part of embodiment of the present invention, and notWhole embodiment. Based on the embodiment in the present invention, those of ordinary skill in the art are not making woundThe every other embodiment obtaining under the prerequisite of the property made work, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of method for drafting and device of image outline, can draw more accuratelyImage outline, improves user and experiences. The method that the present embodiment provides and application of installation are in the electricity with display screenIn subset, comprise the electronic equipments such as desktop computer, notebook computer, panel computer pad, mobile phone,The mode of user's operation of catching can be the sliding action of mouse action and/or finger.
Below by specific embodiment, the present invention is described in detail.
The schematic flow sheet of the method for drafting of a kind of image outline that Fig. 1 provides for the embodiment of the present invention, its bagDraw together following steps:
Step S101: in the time detecting that image outline is drawn instruction, in the picture for the treatment of draw outline, adoptDetermine the coordinate of pixel in image outline with edge detection algorithm.
Be understandable that, the edge of image refers to the part that image local area brightness is changed significantly, imageThe shape that forms of edge be the profile of image. In one pictures, the profile of image may be crisscross multipleIntersect, may be also separate several profiles assortedly.
In actual applications, can adopt edge detection algorithm to determine the coordinate of pixel in image outline. AdoptThe coordinate of determining image outline pixel with edge detection algorithm belongs to prior art, in embodiments of the present inventionThis process is not repeated.
In order effectively to determine the coordinate of pixel in image outline, can adopt in embodiments of the present invention triumphantBuddhist nun Canny edge detection algorithm. Canny rim detection is actually a kind of first order differential operator detection algorithm,It has also increased non-maximum and has suppressed and two improvement of dual threshold on the basis of first order differential operator. UtilizeNon-maximum suppresses not only effectively to suppress multiple response edge, but also can improve the positioning accurate at edgeDegree; Utilize dual threshold, i.e. high threshold and low threshold value, can effectively reduce the loss at edge. By regulatingCorresponding parameter, Canny edge detection algorithm can identify the image outline of different fine degree. Due toDo not adopt Canny edge detection algorithm to determine that the pixel in image outline belongs to prior art, therefore not hereinRepeat again.
Step S102: according to the position of the coordinate of pixel in this image outline and active user's input,In image outline, determine the starting point that profile is drawn.
In order to obtain the positional information of active user's input, can provide corresponding information, prompting userPosition input initial drawing in screen time, as " please clicking in screen, to input initial position ",Or provide input frame, and prompting user inputs the coordinate (x, y) of initial position, and the coordinate system using is passableTaking the current upper left corner for the treatment of draw outline picture as the origin of coordinates, level is to the right x axle positive direction, vertically toBe down y axle positive direction, in reference axis, provide corresponding unit length, certainly adopt other coordinate system to be alsoPassable.
After having determined the position of active user's input, can adopt various ways to obtain from step S101To image outline in determine the starting point that profile is drawn, for example, according to the horizontal stroke of the position of active user inputCoordinate, by identical with this abscissa in image outline, apart from the nearest pixel in position of active user's inputPoint is defined as the starting point that profile is drawn, or according to the ordinate of the position of active user's input, by imageIdentical with this ordinate in profile, be defined as profile apart from the nearest pixel in position of active user's inputThe starting point of drawing.
Step S103: draw the direction of operation according to active user, determine the image wheel that this starting point is correspondingThe drafting direction of drawing in exterior feature, and in image outline, determine and set quantity according to described drafting directionPixel.
After having determined the starting point that profile is drawn, in order to determine target image profile from image outline,In the embodiment of the present invention, need in the process of drawing, obtain active user and draw the direction of operation. In order to obtainActive user draws the direction of operation, can point out user to input the direction of drawing operation. Particularly, userThe mode of direction of operating is drawn in input, can be to pin right mouse button in the enterprising line slip of screen, can be alsoSlide on screen with pointing, therefore corresponding information can be for " please pin left mouse button on screenSlide " or " please on screen, sliding ", also can provide input frame, user is according to showing on screen in promptingAt least two coordinate points of coordinate input, utilize these coordinate points to obtain the direction of drawing operation.
User's drafting operation may be along any one direction, and the direction that user draws operation has determined thisThe drafting direction of drawing in image outline. In this image outline, the multiple sides corresponding with this starting pointUpwards may there is the pixel of image outline. Draw the direction of operation according to active user, determine that this is initialPut the drafting direction of drawing in corresponding image outline, can have different modes, for example, can be trueDetermine active user and draw the each direction comprising in the direction of operation and the image outline corresponding with this starting pointBetween angle, by the orientation determination in image outline corresponding minimum angle for draw direction.
This setting quantity pixel can be 4~10 pixels, and other quantity pixel is also certainlyPassable. The value difference of this setting quantity, the speed that corresponding profile is drawn and effect also can be different.
Step S104: judge last picture corresponding to this drafting direction in a described setting quantity pixelWhether vegetarian refreshments is the terminating point of described image outline.
In the present embodiment, this step can comprise different embodiments. For example, can judge that this is lastWhether a pixel is less than a threshold with the distance of starting point in abscissa direction or in ordinate directionValue, when the distance between this last pixel and starting point in one of them direction of horizontal stroke, ordinate directionWhen being less than setting threshold, just can determine that this last pixel is terminating point. For fear of maloperation,This setting threshold is generally less than the distance of setting between a quantity pixel.
Step S105: if last picture corresponding to this drafting direction in a described setting quantity pixelVegetarian refreshments is the terminating point of described image outline, according to the pixel in the target image profile of preserving, and instituteState the pixel in the image outline between starting point and ending point in image outline, determine target image wheelWide.
Step S106: if last picture corresponding to this drafting direction in a described setting quantity pixelVegetarian refreshments is not the terminating point of described image outline, a described setting quantity pixel is taken turns as target imagePixel in exterior feature is also preserved, using described last pixel as starting point, and execution step S103.
Draw the direction of operation according to active user, in image outline, determine paints corresponding with starting pointDirection processed, and in image outline, determine and set a quantity pixel according to this drafting direction. If this settingIn a quantity pixel, last pixel corresponding to this drafting direction is not the termination of described image outlinePoint, using this last pixel as starting point, then carries out the drafting of target image profile. Therefore everyOnce such operation just can be regarded a drafting cycle as, if in this drafting cycle with this drafting direction pairLast pixel of answering is not the terminating point of image outline, so these pixels preserved, andUsing this last pixel as starting point, start the next drafting cycle. Often determine a drafting cycle,Whether be all the termination of image outline to last pixel corresponding with drawing direction in this drafting cyclePoint judges.
As shown in the above, the embodiment of the present invention first adopts edge detection algorithm to determine in image outline to look likeThe coordinate of vegetarian refreshments, then according to the direction of the position of user's input and drafting operation, from image outline, determineThe pixel coordinate of target image profile, the therefore profile of drawing image more accurately, improves user's bodyTest.
In another embodiment of the present invention, the step S102 in the embodiment of the method shown in Fig. 1, according toIn this image outline, the position of the coordinate of pixel and active user's input, determines that in image outline, profile is drawnStarting point before, described method can also comprise:
According to the coordinate of pixel in definite image outline, generate with the picture for the treatment of draw outline contour wideThe black and white picture of binaryzation, described in comprising in the black and white picture of described binaryzation, treat the picture of draw outlineImage outline.
Suppose to treat the picture of draw outline as shown in Figure 2, target image is the region in the upper left corner in Fig. 2. AdoptEdge detection algorithm is determined the coordinate of pixel in the image outline in Fig. 2, and according to looking like in this image outlineThe coordinate of vegetarian refreshments generate one with the black and white picture of the contour wide binaryzation of Fig. 2, i.e. Fig. 3, comprises in Fig. 3Image outline in Fig. 2.
Obtaining after the black and white picture of the binaryzation that includes image outline information, inputting according to active userWhen the starting point that profile draws is determined in position in image outline, can be directly from the image of this binaryzation pictureIn profile, determine the starting point that profile is drawn, thereby the process that simplified image profile is drawn improves drawing processEfficiency.
In another embodiment of the present invention, the step S102 in the embodiment of the method shown in Fig. 1, according toThe position of the coordinate of pixel and active user's input in this image outline, in image outline, definite profile is paintedThe starting point of system, can comprise the steps:
Step 1: according to the position of active user's input, obtain the coordinate of described position;
Step 2: according to the coordinate of pixel in the coordinate of described position and described image outline, described in determiningDistance in position and described image outline between each pixel;
Step 3: by the pixel in image outline corresponding minimum range, be defined as the initial of profile draftingPoint.
In the present embodiment, by determining the coordinate of user's input position, by with the institute of this coordinate distance minimumState the coordinate of pixel in image outline and be defined as the starting point that profile is drawn, can make the drafting of image outlineProcess is more accurate.
Further, by the pixel in image outline corresponding minimum range, be defined as taking turns in image outlineWide starting point of drawing, can comprise: judge whether described minimum range is less than default the first distance threshold,If so,, by the pixel in image outline corresponding minimum range, be defined as profile in image outline and paintThe starting point of system, in the time that described minimum range is not less than default the first distance threshold, output information, carriesShow that the pixel in the current described image outline of input position distance of user is too far away, should adjust input positionPut, make input position near the pixel in described image outline, can make like this drawing process more accurate.
In another embodiment of the present invention, the step S103 in the embodiment of the method shown in Fig. 1, according toActive user draws the direction of operation, determines the drafting side of drawing in image outline corresponding to this starting pointTo, can comprise the steps:
Step 1: draw the direction of operation according to active user, determine that active user draws the direction pair of operationThe angle of answering;
Step 2: according to each angular range corresponding to each drafting direction of preserving for this starting point, reallyThe angular range at fixed this angle place is this starting point correspondence by drafting orientation determination corresponding this angular rangeImage outline in the drafting direction of drawing.
Suppose, current starting point is the A point in Fig. 3, sets up coordinate system in Fig. 3. In step S101While determining the coordinate of pixel in image outline, preserve two and drawn directions, be respectively A1 and A2 direction,The angular range that this both direction is corresponding is respectively 0~180 degree ,-180~0 degree. Suppose that active user draws behaviourThe direction of doing is U1, and determines that angle corresponding to this U1 direction is-130 degree, therefore determines that this angle is inIn-180~0 degree angular range, be to draw in the image outline corresponding with starting point A by A2 orientation determinationDrafting direction.
In the present embodiment, determine that user draws the angular range at the angle place of the direction of operation, shouldThe drafting orientation determination that angular range is corresponding is the drafting of drawing in image outline corresponding to this starting pointDirection, can simplify the deterministic process of drawing direction, reduces amount of calculation.
In another embodiment of the present invention, the step S104 in the embodiment of the method shown in Fig. 1, judgementIn a described setting quantity pixel, whether last pixel corresponding to this drafting direction is described imageThe terminating point of profile, can comprise the steps:
Step 1: determine last pixel corresponding to this drafting direction in a described setting quantity pixelCoordinate;
Step 2: the coordinate of the starting point that the coordinate of described last pixel of judgement and described profile are drawnBetween distance whether be less than default second distance threshold value;
Step 3: if, determine that described last pixel is terminating point, otherwise, described in determiningA rear pixel nonterminal point.
In the present embodiment, the distance between the coordinate of last pixel and starting point coordinate is less than in advanceIf second distance threshold value, as the standard of determining terminating point, can be determined termination when profile is drawn more accuratelyPoint.
After using a described setting quantity pixel, the pixel in target image profile is preserved, if inspectionMeasure user's deletion action, the pixel of preservation can also be deleted, specifically can comprise step:
Judge in target image profile whether preserve a described setting quantity pixel, if not, by instituteState and set a quantity pixel as the pixel in target image profile and preserve; If target image profileIn preserved a described setting quantity pixel, delete preserve a described setting quantity pixel.
In the present embodiment, if preserved a described setting quantity pixel in target image profile, canTo illustrate that this drafting operation belongs to a kind of deletion action. Particularly, user may want to change the wheel of drawingExterior feature, or due to user's maloperation, drawn wrong profile. If belonging to, this drafting operation deletes behaviourDo, delete a described setting quantity pixel of having preserved. This deleting visible, this embodiment providesExcept can improving user, operation experiences.
The schematic flow sheet of the method for drafting of the another kind of image outline that Fig. 4 provides for the embodiment of the present invention, itsComprise the steps:
Step S401: in the time detecting that image outline is drawn instruction, in the picture for the treatment of draw outline, adoptEdge detection algorithm is determined the coordinate of pixel in image outline.
Step S402: according to the coordinate of pixel in definite image outline, generate and the figure that treats draw outlineThe black and white picture of the contour wide binaryzation of sheet, waits to draw wheel in the black and white picture of described binaryzation described in comprisingThe image outline of wide picture.
Step S403: according to the position of active user's input, obtain the coordinate of described position; According to institute's rhemeThe coordinate of pixel in the coordinate of putting and described image outline, determines in described position and described image outline everyDistance between individual pixel, and determine the minimum range in this distance.
Step S404: judge that whether described minimum range is less than default the first distance threshold, if so, holdsRow step S405, otherwise, S406 carried out.
Step S405: in the time that described minimum range is not less than default the first distance threshold, output information.
Step S406: in the time that described minimum range is less than default the first distance threshold, minimum range is correspondingPixel in image outline, is defined as the starting point that profile is drawn.
Step S407: draw the direction of operation according to active user, determine the image outline that this starting point is correspondingIn the drafting direction of drawing, and in image outline, determine that according to described drafting direction setting quantity looks likeVegetarian refreshments.
Step S408: determine last pixel corresponding to this drafting direction in a described setting quantity pixelThe coordinate of point.
Step S409: the seat of the starting point that the coordinate of described last pixel of judgement and described profile are drawnWhether the distance between mark is less than default second distance threshold value, if so, performs step S410, otherwise,Execution step S412.
Step S410: when the coordinate of the coordinate of described last pixel and the starting point of described profile draftingBetween distance while being less than default second distance threshold value, determine that described last pixel is terminating point.
Step S411: according to the pixel in the target image profile of preserving, and initial in described image outlinePixel in image outline between point and terminating point, determines target image profile.
Step S412: when the coordinate of the coordinate of described last pixel and the starting point of described profile draftingBetween distance while being not less than default second distance threshold value, determine described last pixel nonterminal point.
Step S413: judge in target image profile, whether to preserve a described setting quantity pixel, ifBe, perform step S414, otherwise, execution step S415.
Step S414: in the time having preserved described setting quantity pixel in target image profile, deleteA described setting quantity pixel of preserving, and by first pixel corresponding with this drafting direction of preservingAs starting point, execution step S407.
Step S415: in the time not preserving described setting quantity pixel in target image profile, will described inSet a quantity pixel as the pixel in target image profile and preserve, and by described last pictureVegetarian refreshments, as starting point, performs step S407.
As shown in the above, the embodiment of the present invention first adopts edge detection algorithm to determine in image outline to look likeThe coordinate of vegetarian refreshments, then according to the direction of the position of user's input and drafting operation, from image outline, determineThe pixel coordinate of target image profile. In the time that user's input position range image profile is far away, all rightProvide information, prompting user adjusts input position, therefore drawing image profile more accurately. WithTime, user can also delete the pixel in drawn profile in drawing process, improves user and experiences.
The structural representation of the drawing apparatus of a kind of image outline that Fig. 5 provides for the embodiment of the present invention, with Fig. 1Shown in embodiment of the method corresponding, described device comprises:
Image outline detection module 501, in the time detecting that image outline is drawn instruction, is waiting to draw wheelIn wide picture, adopt edge detection algorithm to determine the coordinate of pixel in image outline;
Starting point determination module 502, for according to the coordinate of described image outline pixel and active userThe starting point that profile is drawn is determined in the position of input in image outline;
Draw orientation determination module 503, for draw the direction of operation according to active user, determine that this is initialPut the drafting direction of drawing in corresponding image outline, and the described drafting direction of foundation is in image outlineDetermine and set a quantity pixel;
Terminating point judge module 504, for judging this drafting direction correspondence of a described setting quantity pixelLast pixel whether be the terminating point of described image outline;
Target image profile determination module 505, if for described setting quantity this drafting side of pixelThe terminating point of described image outline to last pixel of correspondence, according to the target image wheel of preservingPixel in exterior feature, and the pixel in the image outline between starting point and ending point in described image outlinePoint, determines target image profile;
Pixel is preserved module 506, if for this drafting direction correspondence of a described setting quantity pixelLast pixel be not the terminating point of described image outline, described setting quantity pixel is doneFor the pixel in target image profile preservation, and using described last pixel as starting point, touchSend out and draw orientation determination module 503.
Concrete, the edge detection algorithm that image outline detection module 501 adopts can comprise triumphant Buddhist nun CannyEdge detection algorithm.
In another embodiment of the present invention, the starting point determination module in the device embodiment shown in Fig. 5502 specifically can comprise:
Coordinate obtains submodule (not shown), for according to the position of active user's input, obtains instituteThe coordinate that rheme is put;
Distance is determined submodule (not shown), for taking turns according to the coordinate of described position and described imageThe coordinate of pixel in exterior feature, determines the distance between each pixel in described position and described image outline;
Starting point is determined submodule (not shown), for by image outline corresponding minimum rangePixel, is defined as the starting point that profile is drawn.
Further, this starting point determines that submodule specifically can be for judging whether described minimum range is less thanDefault the first distance threshold, if so, by the pixel in image outline corresponding minimum range, is defined asThe starting point that profile is drawn.
In another embodiment of the present invention, the device shown in Fig. 5 can also comprise:
Information output module (not shown), for being not less than default first when described minimum rangeWhen distance threshold, output information.
In another embodiment of the present invention, the drafting orientation determination mould in the device embodiment shown in Fig. 5Piece 503 specifically can comprise:
Angle is determined submodule (not shown), for draw the direction of operation according to active user, reallyDetermine active user and draw the angle corresponding to direction of operation;
Draw orientation determination submodule (not shown), for each according to what preserve for this starting pointDraw each angular range corresponding to direction, determine the angular range at this angle place, by this angular range pairThe drafting orientation determination of answering is the drafting direction of drawing in image outline corresponding to this starting point.
In another embodiment of the present invention, the terminating point judge module in the device embodiment shown in Fig. 5504 specifically can comprise:
Pixel coordinate is determined submodule (not shown), for determining a described setting quantity pixelIn the coordinate of last pixel corresponding to this drafting direction;
Coordinate distance judges submodule (not shown), for judging the seat of described last pixelWhether the distance between the coordinate of the starting point that mark and described profile are drawn is less than default second distance threshold value;
Terminating point is determined submodule (not shown), if for the coordinate of described last pixelAnd the distance between the starting point coordinate that in described image outline, profile is drawn is less than default second distance threshold value,Determine that described last pixel is terminating point, otherwise, determine described last pixel nonterminalPoint.
In another embodiment of the present invention, the starting point in the device embodiment shown in Fig. 5 is determined mouldBefore piece 502, described device can also comprise:
Binaryzation picture determination module (not shown), for according to definite image outline pixelCoordinate, generate and the black and white picture of the contour wide binaryzation of the picture for the treatment of draw outline described binaryzationBlack and white picture in treat the image outline of the picture of draw outline described in comprising.
In another embodiment of the present invention, the pixel in the device embodiment shown in Fig. 5 is preserved module506 specifically can be for:
Judge in target image profile whether preserve a described setting quantity pixel, if not, by instituteState and set a quantity pixel as the pixel in target image profile and preserve.
In another embodiment of the present invention, the device shown in Fig. 5 can also comprise:
Pixel removing module (not shown), if described in having preserved for target image profileSet a quantity pixel, delete a described setting quantity pixel of preserving.
Because said apparatus embodiment is that method for drafting embodiment based on image outline obtains, with the methodHave identical technique effect, the technique effect that therefore installs embodiment does not repeat them here.
For device embodiment, because it is substantially similar in appearance to embodiment of the method, so describe to obtain ratioSimpler, relevant part is referring to the part explanation of embodiment of the method.
It should be noted that, in this article, the relational terms such as the first and second grades be only used for byEntity or operation and another entity or operating space separate, and not necessarily require or imply theseBetween entity or operation, there is relation or the order of any this reality. And term " comprises ", " bagContaining " or any other variant be intended to contain comprising of nonexcludability, thereby make to comprise a series of key elementsProcess, method, article or equipment not only comprise those key elements, but also comprise its that clearly do not listHis key element, or be also included as the intrinsic key element of this process, method, article or equipment. Do not havingHave in the situation of more restrictions, the key element being limited by statement " comprising ... ", and be not precluded within and compriseIn process, method, article or the equipment of described key element, also there is other identical element.
One of ordinary skill in the art will appreciate that, all or part of step in above-mentioned embodiment is canComplete by the relevant hardware of programmed instruction, described program can be stored in embodied on computer readable storageIn medium. Here alleged storage medium, refers to ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection model of the present inventionEnclose. All any amendments of making within the spirit and principles in the present invention, be equal to replacement, improvement etc., all bagBe contained in protection scope of the present invention.