CN105260743A - Pattern classification method and device - Google Patents

Pattern classification method and device Download PDF

Info

Publication number
CN105260743A
CN105260743A CN201510633809.2A CN201510633809A CN105260743A CN 105260743 A CN105260743 A CN 105260743A CN 201510633809 A CN201510633809 A CN 201510633809A CN 105260743 A CN105260743 A CN 105260743A
Authority
CN
China
Prior art keywords
assignment graph
picture
pixel
classification results
region
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.)
Pending
Application number
CN201510633809.2A
Other languages
Chinese (zh)
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.)
Beijing Xiaomi Technology Co Ltd
Xiaomi Inc
Original Assignee
Xiaomi 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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201510633809.2A priority Critical patent/CN105260743A/en
Publication of CN105260743A publication Critical patent/CN105260743A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate

Abstract

The invention relates to a pattern classification method and a device and belongs to the computer technology field. The method comprises steps that, a designated pattern drafted by a user in a first picture is acquired; for each pixel point on the designated pattern, a radial line of the pixel points is acquired, and ballot for each pixel point on the radial line is carried out; according to a ballot number of each pixel point in an enclosed area of the designated pattern, a classification result of the designated pattern is determined, and the classification result can be a circle or a rectangle; according to the position of the designated pattern in the first picture, the designated pattern is replaced by a standard pattern in matching with the classification result, and a second picture is acquired. Through the method, ballot for each pixel point on the radial line of all the pixels on the designated pattern is carried out, whether the designated pattern is a circle or a rectangle is determined, classification accuracy is improved, matching with standard patterns in all shapes is not necessary, calculation resources are saved, and a classification speed is improved.

Description

Shape classification and device
Technical field
The disclosure is directed to field of computer technology, specifically about a kind of Shape classification and device.
Background technology
Along with the widespread use of picture, on picture, graphing has become a kind of conventional mark mode, when user wishes to mark some data in picture, at the position graphing at this data place, can be marked data by this figure.
User can draw the figure of the various shapes such as circle, rectangle on picture, and because this figure is by user's hand drawn, shape may not too standard, then in order to ensure the aesthetic property of figure, the test pattern of various shape can be pre-set, and figure user drawn mates respectively with the test pattern of this various shape, determine that this figure is any shape, then this figure is replaced with the test pattern of respective shapes.
Summary of the invention
In order to solve Problems existing in correlation technique, present disclose provides a kind of Shape classification and device.Described technical scheme is as follows:
According to the first aspect of disclosure embodiment, provide a kind of Shape classification, described method comprises:
Obtain the assignment graph that user draws in the first picture;
For each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
According to the ballot number of each pixel in the region that described assignment graph surrounds, determine the classification results of described assignment graph, described classification results is circular or rectangle;
According to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtain second picture.
In another embodiment, the assignment graph that described acquisition user draws in the first picture, comprising:
Detect the drafting operation of user in described first picture;
Obtain the described trace information drawing operation;
According to described trace information, described first picture generates described assignment graph.
In another embodiment, the ballot number of each pixel in the described region surrounded according to described assignment graph, determine the classification results of described assignment graph, comprising:
The Region dividing described assignment graph surrounded is multiple measure-alike windows;
According to the ballot number of each pixel in each window, obtain total ballot number of each window;
According to total ballot number of window each in described region, determine the classification results of described assignment graph.
In another embodiment, described total ballot number according to window each in described region, determine the classification results of described assignment graph, comprising:
According to total ballot number of window each in described region, obtain total votes object maximal value in described region;
Judge whether the maximal value got is greater than predetermined threshold value;
When described maximal value is greater than described predetermined threshold value, determine that described classification results is for circular;
When described maximal value is not more than described predetermined threshold value, determine that described classification results is rectangle.
In another embodiment, described according to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtain second picture, comprising:
When described classification results is circular, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard circular, obtains described second picture; Or,
When described classification results is rectangle, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard rectangular, obtains described second picture.
According to the second aspect of disclosure embodiment, provide a kind of pattern classification device, described device comprises:
Acquisition module, for obtaining the assignment graph that user draws in the first picture;
Vote module, for for each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
Sort module, for the ballot number of each pixel in the region that surrounds according to described assignment graph, determines the classification results of described assignment graph, and described classification results is circular or rectangle;
Replacement module, for according to the position of described assignment graph in described first picture, replaces with the test pattern mated with described classification results, obtains second picture by described assignment graph.
In another embodiment, described acquisition module is also for detecting the drafting operation of user in described first picture; Obtain the described trace information drawing operation; According to described trace information, described first picture generates described assignment graph.
In another embodiment, the Region dividing of described sort module also for described assignment graph being surrounded is multiple measure-alike windows; According to the ballot number of each pixel in each window, obtain total ballot number of each window; According to total ballot number of window each in described region, determine the classification results of described assignment graph.
In another embodiment, described sort module, also for the total ballot number according to window each in described region, obtains total votes object maximal value in described region; Judge whether the maximal value got is greater than predetermined threshold value; When described maximal value is greater than described predetermined threshold value, determine that described classification results is for circular; When described maximal value is not more than described predetermined threshold value, determine that described classification results is rectangle.
In another embodiment, when described replacement module is also for being circular when described classification results, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard circular, obtains described second picture; Or, when described classification results is rectangle, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard rectangular, obtains described second picture.
According to the third aspect of disclosure embodiment, provide a kind of pattern classification device, described device comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Obtain the assignment graph that user draws in the first picture;
For each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
According to the ballot number of each pixel in the region that described assignment graph surrounds, determine the classification results of described assignment graph, described classification results is circular or rectangle;
According to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtain second picture.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect:
Consider that the radial alignment of each pixel in standard circular can intersect at the center of circle, and the radial alignment of each pixel in standard rectangular is parallel to each other, then when user draws assignment graph on the first picture, pixel in the radial alignment of pixel each in assignment graph is voted, get the ballot number of each pixel in region that this assignment graph surrounds, determine that this assignment graph is circular or rectangle according to this ballot number, improve classification accuracy, and without the need to mating with the test pattern of often kind of shape, save computational resource, improve classification speed.
Should be understood that, it is only exemplary that above general description and details hereinafter describe, and can not limit the disclosure.
Accompanying drawing explanation
Accompanying drawing to be herein merged in instructions and to form the part of this instructions, shows and meets embodiment of the present disclosure, and is used from instructions one and explains principle of the present disclosure.
Fig. 1 is the process flow diagram of a kind of Shape classification according to an exemplary embodiment;
Fig. 2 is the process flow diagram of a kind of Shape classification according to an exemplary embodiment;
Fig. 3 is the radial alignment schematic diagram of a kind of circle according to an exemplary embodiment;
Fig. 4 is the radial alignment schematic diagram of a kind of rectangle according to an exemplary embodiment;
Fig. 5 is the block diagram of a kind of pattern classification device according to an exemplary embodiment;
Fig. 6 is the block diagram of a kind of pattern classification device according to an exemplary embodiment.
Embodiment
For making object of the present disclosure, technical scheme and advantage clearly understand, below in conjunction with embodiment and accompanying drawing, the disclosure is described in further details.At this, exemplary embodiment of the present disclosure and illustrating for explaining the disclosure, but not as to restriction of the present disclosure.
Disclosure embodiment provides a kind of Shape classification and device, is described in detail to the disclosure below in conjunction with accompanying drawing.
Fig. 1 is the process flow diagram of a kind of Shape classification according to an exemplary embodiment, and as shown in Figure 1, Shape classification is used for, in image processing equipment, comprising the following steps:
In a step 101, the assignment graph that user draws in the first picture is obtained.
In a step 102, for each pixel in this assignment graph, obtain the radial alignment of this pixel, and vote for each pixel in this radial alignment, this radial alignment is through this pixel, and vertical with the gradient direction of this pixel.
In step 103, according to the ballot number of each pixel in the region that this assignment graph surrounds, determine the classification results of this assignment graph, this classification results is circular or rectangle.
At step 104, according to the position of this assignment graph in this first picture, this assignment graph is replaced with the test pattern mated with this classification results, obtain second picture.
The method that the present embodiment provides, consider that the radial alignment of each pixel in standard circular can intersect at the center of circle, and the radial alignment of each pixel in standard rectangular is parallel to each other, then when user draws assignment graph on the first picture, pixel in the radial alignment of pixel each in assignment graph is voted, get the ballot number of each pixel in region that this assignment graph surrounds, determine that this assignment graph is circular or rectangle according to this ballot number, improve classification accuracy, and without the need to mating with the test pattern of often kind of shape, save computational resource, improve classification speed.
In another embodiment, the assignment graph that this acquisition user draws in the first picture, comprising:
Detect the drafting operation of user in this first picture;
Obtain the trace information of this drafting operation;
According to this trace information, this first picture generates this assignment graph.
In another embodiment, the ballot number of each pixel in this region surrounded according to this assignment graph, determine the classification results of this assignment graph, comprising:
The Region dividing this assignment graph surrounded is multiple measure-alike windows;
According to the ballot number of each pixel in each window, obtain total ballot number of each window;
According to total ballot number of window each in this region, determine the classification results of this assignment graph.
In another embodiment, this, according to total ballot number of window each in this region, is determined the classification results of this assignment graph, comprising:
According to total ballot number of window each in this region, obtain total votes object maximal value in this region;
Judge whether the maximal value got is greater than predetermined threshold value;
When this maximal value is greater than this predetermined threshold value, determine that this classification results is for circular;
When this maximal value is not more than this predetermined threshold value, determine that this classification results is rectangle.
In another embodiment, this assignment graph, according to the position of this assignment graph in this first picture, is replaced with the test pattern mated with this classification results, obtains second picture, comprise by this:
When this classification results is circular, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard circular, obtains this second picture; Or,
When this classification results is rectangle, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard rectangular, obtains this second picture.
Above-mentioned all alternatives, can adopt and combine arbitrarily formation embodiment of the present disclosure, this is no longer going to repeat them.
Fig. 2 is the process flow diagram of a kind of Shape classification according to an exemplary embodiment, and as shown in Figure 2, Shape classification is used for, in image processing equipment, comprising the following steps:
In step 201, the assignment graph that user draws in the first picture is obtained.
In the present embodiment, this image processing equipment can be mobile phone, computing machine, server etc., and the present embodiment does not limit this.This image processing equipment obtains the first picture, this first picture can take for this image processing equipment the photo obtained, or for other equipment send to the picture etc. of this image processing equipment, can comprise the data such as word, image in this first picture, the present embodiment does not also limit this.
When user wishes to mark the data in this first picture, can trigger in this first picture and draw operation, to draw assignment graph.Such as, image processing equipment can configure touch display screen curtain, shows the first picture by touch display screen curtain, and user can trigger slide on touch display screen curtain, to draw assignment graph.Or, user can also after pressing left mouse button sliding mouse, to draw this assignment graph, the present embodiment to this drafting operation do not limit.
After user draws assignment graph, this image processing equipment can obtain the assignment graph that user draws in this first picture.Such as, this image processing equipment can detect the drafting operation of user in this first picture, obtains the trace information of this drafting operation, according to this trace information, this first picture generates this assignment graph, then, when this image processing equipment shows this first picture, this assignment graph can be shown.
In step 202., for each pixel in this assignment graph, obtain the radial alignment of this pixel, and vote for each pixel in this radial alignment.
Wherein, this assignment graph comprises multiple pixel, and also comprises multiple pixel in the region that this assignment graph surrounds.The radial alignment of the pixel in this assignment graph refers to through this pixel, and the straight line vertical with the gradient direction of this pixel.
In the present embodiment, this assignment graph of user's hand drawn, the shape of this assignment graph is determined by user, can be circle or rectangle etc.But, owing to being subject to the restriction of drawing level, the shape of the assignment graph that user draws may not too standard, then in order to ensure the attractive in appearance of figure, can first classify to this assignment graph, determine that this assignment graph is any shape, then this assignment graph is replaced with the test pattern of respective shapes.
In practical application, in standard circular, the radial alignment of each pixel can intersect at the center of circle, namely has a lot of bar radial alignment near the center of circle, and radial alignment near circular boundary is less, i.e. the skewness of radial alignment.And the radial alignment of each pixel is parallel to each other in standard rectangular, in the region that standard rectangular surrounds, the radial alignment number of each position is identical, and the distribution of radial alignment is comparatively even.Consider the difference between standard circular and standard rectangular, in the region that this image processing equipment can surround according to this assignment graph each pixel the number of radial alignment of process, determine that this assignment graph is circular or rectangle.
This image processing equipment can travel through each pixel in this assignment graph, for each pixel in this assignment graph, this image processing equipment obtains the gradient direction of this pixel, according to this gradient direction, prolongation picture ray is carried out in the both sides of this pixel, obtain the radial alignment of this pixel, and vote for each pixel in this radial alignment.Due to the region that this radial alignment surrounds through this assignment graph, then for each pixel in radial alignment vote time, the ballot number of each pixel in region that this assignment graph surrounds can be obtained.
And, in the process of the pixel in traversal assignment graph, this image processing equipment is that the pixel in different radial alignment is voted respectively, the ballot number of each pixel then in the region that surrounds of this assignment graph is accumulated thereupon, the ballot number of each pixel obtained after having traveled through can be used for representing respective pixel point the number of radial alignment of process.
Such as, when the radial alignment of the pixel A in this assignment graph through this assignment graph surround pixel B in region, for pixel B votes, now the ballot number of pixel B is 1.When the radial alignment of the pixel C in this assignment graph is also through pixel B, again for pixel B votes, now, the ballot number of pixel B is 2.
In step 203, obtain the ballot number of each pixel in region that this assignment graph surrounds, the Region dividing this assignment graph surrounded is multiple measure-alike windows, according to the ballot number of each pixel in each window, obtains total ballot number of each window.
After ballot, this image processing equipment can obtain the ballot number of each pixel in region that this assignment graph surrounds, represents the radial alignment number through respective pixel point with number of voting.Then in order to determine the distribution situation of radial alignment in the region that this assignment graph surrounds, the Region dividing that this assignment graph surrounds by this image processing equipment is multiple measure-alike windows, obtain the ballot number of each pixel in each window, calculate the pixel ballot number sum in each window, obtain total ballot number of each window.Wherein, the shape of window can be circle or rectangle etc., and the size of window can be determined according to the demand to classification accuracy and the demand to calculated amount by this image processing equipment, can be 3*3,6*6 etc., and the present embodiment does not all limit this.
In step 204, according to total ballot number of window each in this region, the classification results of this assignment graph is determined.
Total ballot number of each window and the number correlation of the radial alignment through this window, total ballot number of window is larger, represent that the number of the radial alignment through this window is larger, and total ballot number of window is less, represents that the number of the radial alignment through this window is less.Then in order to distinguish this assignment graph for circular or rectangle, total ballot number of each window in the region that this image processing equipment can surround according to this assignment graph, determines the classification results of this assignment graph, and this classification results is circular or rectangle.
Such as, this image processing equipment is according to total ballot number of window each in this region, obtain total votes object maximal value in this region, judge whether the maximal value got is greater than predetermined threshold value, when this maximal value is greater than this predetermined threshold value, represent a certain window in the region that this assignment graph surrounds the number of radial alignment of process very large, then determine that this classification results is for circular.And when this maximal value is not more than this predetermined threshold value, represent in the region that this assignment graph surrounds arbitrary window the number of radial alignment of process all very little, then determine that this classification results is rectangle.Wherein, this predetermined threshold value can be determined according to total ballot number of window each in standard circular in advance by this image processing equipment, and the present embodiment does not limit this.
The radial alignment of the circle that user draws and circular each pixel is respectively as shown in the solid line in Fig. 3 and dotted line, the ballot number of the pixel near the center of circle is larger, and the ballot number of the pixel at circular boundary place is less, the ballot number skewness of pixel, when then this image processing equipment gets total votes object maximal value of each window in the circular region surrounded, can determine that this maximal value is greater than this predetermined threshold value, thus determine that this assignment graph is for circular.
On the rectangle that user draws and rectangle, the radial alignment of each pixel is respectively as shown in the solid line in Fig. 4 and dotted line, in the region that rectangle surrounds, the votes object difference of pixel is little, when then this image processing equipment gets total votes object maximal value of each window in region that rectangle surrounds, can determine that this maximal value is not more than this predetermined threshold value, thus determine that this appointment image is rectangle.
In addition, this image processing equipment can also compare total ballot number of window each in this region, using the window corresponding to total votes object maximal value as specified window, difference between the total ballot number determining any two windows except specified window is all less than preset difference value, and the difference between total ballot number of this specified window and total ballot number of other arbitrary windows is when being all greater than this preset difference value, determine that this classification results is for circular.And the difference between the total ballot number determining any two windows is when being all less than preset difference value, determine that this classification results is rectangle.Wherein, this preset difference value can be determined according to the difference between total ballot number of window each in standard circular in advance by this image processing equipment, and the present embodiment does not limit this.
In step 205, according to the position of this assignment graph in this first picture, this assignment graph is replaced with the test pattern mated with this classification results, obtain second picture.
This image processing equipment can obtain standard circular and standard rectangular in advance, when after the classification results determining this assignment graph, this assignment graph can be replaced with the test pattern mated with this classification results, obtain second picture, and show this second picture.
When this classification results is circular, this image processing equipment is according to the position of this assignment graph in this first picture, determine corresponding home position and radius, according to the radius determined, obtain the standard circular of mating with this radius, and according to the home position determined, this assignment graph is replaced with this standard circular, obtain this second picture.
Or, when this classification results is rectangle, this image processing equipment is according to the position of this assignment graph in this first picture, determine the size of this assignment graph, obtain the standard rectangular of mating with this size, and according to the position of this assignment graph in this first figure, this assignment graph is replaced with this standard rectangular, obtains this second picture.
It should be noted that, the present embodiment assignment graph of only drawing for user is described for circular or rectangle, in fact, when the assignment graph that user draws is oval, the method that this image processing equipment can adopt the present embodiment to provide, this assignment graph is judged to be circle, and this assignment graph is replaced with standard circular.Or, when user draw assignment graph be irregular quadrilateral or pentagon time, the method that this image processing equipment can adopt the present embodiment to provide, this assignment graph is judged to be rectangle, and this assignment graph is replaced with standard rectangular, the concrete shape of the present embodiment to assignment graph does not limit.
Under the process obtaining the second picture comprising test pattern after drawing assignment graph in the present embodiment on the first picture can be applied to several scenes, as user sends to good friend the scene of picture, user to issue picture scene, user's scene of editing resources material etc. in friend circle, the present embodiment does not limit this.
In correlation technique, mated respectively, determine the shape of this figure by figure user drawn with the test pattern of various shape, calculated amount is very large, and the computational resource expended is too much.And when the graphics shape that user draws is nonstandard, this mode is easy to lose efficacy, thus causes the concrete shape cannot determining this figure.
And the present embodiment have employed one rapidly and accurately sorting technique circular and rectangle are distinguished, the feature of the center that make use of circular center cumulative voting and rectangle not cumulative voting, by carrying out the mode of voting after projecting in radial directions, ballot number according to obtaining is classified, the figure that user draws is divided into figure or rectangle, improve classification accuracy, improve classification speed, and there will not be the situation cannot determining shape.
The method that the present embodiment provides, consider that the radial alignment of each pixel in standard circular can intersect at the center of circle, and the radial alignment of each pixel in standard rectangular is parallel to each other, then when user draws assignment graph on the first picture, pixel in the radial alignment of pixel each in assignment graph is voted, get the ballot number of each pixel in region that this assignment graph surrounds, determine that this assignment graph is circular or rectangle according to this ballot number, improve classification accuracy, and without the need to mating with the test pattern of often kind of shape, save computational resource, improve classification speed, avoid the situation occurring determining shape.
Fig. 5 is the block diagram of a kind of pattern classification device according to an exemplary embodiment.See Fig. 5, this device comprises acquisition module 501, vote module 502, sort module 503 and replacement module 504.
Acquisition module 501 is configured to the assignment graph of drawing in the first picture for obtaining user;
Vote module 502 is configured to for for each pixel in this assignment graph, obtain the radial alignment of this pixel, and vote for each pixel in this radial alignment, this radial alignment is through this pixel, and vertical with the gradient direction of this pixel;
Sort module 503 is configured to the ballot number of each pixel in the region for surrounding according to this assignment graph, determines the classification results of this assignment graph, and this classification results is circular or rectangle;
Replacement module 504 is configured to, for according to the position of this assignment graph in this first picture, this assignment graph be replaced with the test pattern mated with this classification results, obtain second picture.
The device that the present embodiment provides, consider that the radial alignment of each pixel in standard circular can intersect at the center of circle, and the radial alignment of each pixel in standard rectangular is parallel to each other, then when user draws assignment graph on the first picture, pixel in the radial alignment of pixel each in assignment graph is voted, get the ballot number of each pixel in region that this assignment graph surrounds, determine that this assignment graph is circular or rectangle according to this ballot number, improve classification accuracy, and without the need to mating with the test pattern of often kind of shape, save computational resource, improve classification speed.
In another embodiment, this acquisition module 501 is also configured to for detecting the drafting operation of user in this first picture; Obtain the trace information of this drafting operation; According to this trace information, this first picture generates this assignment graph.
In another embodiment, this sort module 503 is also configured to the Region dividing for this assignment graph being surrounded is multiple measure-alike windows; According to the ballot number of each pixel in each window, obtain total ballot number of each window; According to total ballot number of window each in this region, determine the classification results of this assignment graph.
In another embodiment, this sort module 503 is also configured to for the total ballot number according to window each in this region, obtains total votes object maximal value in this region; Judge whether the maximal value got is greater than predetermined threshold value; When this maximal value is greater than this predetermined threshold value, determine that this classification results is for circular; When this maximal value is not more than this predetermined threshold value, determine that this classification results is rectangle.
In another embodiment, this replacement module 504 is also configured to, for when this classification results is for time circular, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard circular, obtain this second picture; Or, when this classification results is rectangle, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard rectangular, obtains this second picture.
Above-mentioned all alternatives, can adopt and combine arbitrarily formation embodiment of the present disclosure, this is no longer going to repeat them.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations has been described in detail in about the embodiment of the method, will not elaborate explanation herein.
It should be noted that: the pattern classification device that above-described embodiment provides is when classifying to figure, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by image processing equipment is divided into different functional modules, to complete all or part of function described above.In addition, the pattern classification device that above-described embodiment provides and Shape classification embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
Fig. 6 is the block diagram of a kind of pattern classification device 600 according to an exemplary embodiment.Such as, device 600 can be mobile phone, computing machine, digital broadcast terminal, messaging devices, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc.
With reference to Fig. 6, device 600 can comprise following one or more assembly: processing components 602, storer 604, power supply module 606, multimedia groupware 608, audio-frequency assembly 610, the interface 612 of I/O (I/O), sensor module 614, and communications component 616.
The integrated operation of the usual control device 600 of processing components 602, such as with display, call, data communication, camera operation and record operate the operation be associated.Processing components 602 can comprise one or more processor 620 to perform instruction, to complete all or part of step of above-mentioned method.In addition, processing components 602 can comprise one or more module, and what be convenient between processing components 602 and other assemblies is mutual.Such as, processing components 602 can comprise multi-media module, mutual with what facilitate between multimedia groupware 608 and processing components 602.
Storer 604 is configured to store various types of data to be supported in the operation of device 600.The example of these data comprises for any application program of operation on device 600 or the instruction of method, contact data, telephone book data, message, picture, video etc.Storer 604 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), ROM (read-only memory) (ROM), magnetic store, flash memory, disk or CD.
The various assemblies that power supply module 606 is device 600 provide electric power.Power supply module 606 can comprise power-supply management system, one or more power supply, and other and the assembly generating, manage and distribute electric power for device 600 and be associated.
Multimedia groupware 608 is included in the screen providing an output interface between described device 600 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises one or more touch sensor with the gesture on sensing touch, slip and touch panel.Described touch sensor can the border of not only sensing touch or sliding action, but also detects the duration relevant to described touch or slide and pressure.In certain embodiments, multimedia groupware 608 comprises a front-facing camera and/or post-positioned pick-up head.When device 600 is in operator scheme, during as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom ability.
Audio-frequency assembly 610 is configured to export and/or input audio signal.Such as, audio-frequency assembly 610 comprises a microphone (MIC), and when device 600 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The sound signal received can be stored in storer 604 further or be sent via communications component 616.In certain embodiments, audio-frequency assembly 610 also comprises a loudspeaker, for output audio signal.
I/O interface 612 is for providing interface between processing components 602 and peripheral interface module, and above-mentioned peripheral interface module can be keyboard, some striking wheel, button etc.These buttons can include but not limited to: home button, volume button, start button and locking press button.
Sensor module 614 comprises one or more sensor, for providing the state estimation of various aspects for device 600.Such as, sensor module 614 can detect the opening/closing state of device 600, the relative positioning of assembly, such as described assembly is display and the keypad of device 600, the position of all right pick-up unit 600 of sensor module 614 or device 600 1 assemblies changes, the presence or absence that user contacts with device 600, the temperature variation of device 600 orientation or acceleration/deceleration and device 600.Sensor module 614 can comprise proximity transducer, be configured to without any physical contact time detect near the existence of object.Sensor module 614 can also comprise optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor module 614 can also comprise acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 616 is configured to the communication being convenient to wired or wireless mode between device 600 and other equipment.Device 600 can access the wireless network based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communications component 616 receives from the broadcast singal of external broadcasting management system or broadcast related information via broadcast channel.In one exemplary embodiment, described communications component 616 also comprises near-field communication (NFC) module, to promote junction service.Such as, can based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 600 can be realized, for performing above-mentioned Shape classification by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD) (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components.
In the exemplary embodiment, additionally provide a kind of non-transitory computer-readable recording medium comprising instruction, such as, comprise the storer 604 of instruction, above-mentioned instruction can perform said method by the processor 620 of device 600.Such as, this non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.
A kind of non-transitory computer-readable recording medium, when the instruction in this storage medium is performed by the processor of image processing equipment, make image processing equipment can perform a kind of Shape classification, the method comprises:
Obtain the assignment graph that user draws in the first picture;
For each pixel in this assignment graph, obtain the radial alignment of this pixel, and vote for each pixel in this radial alignment, this radial alignment is through this pixel, and vertical with the gradient direction of this pixel;
According to the ballot number of each pixel in the region that this assignment graph surrounds, determine the classification results of this assignment graph, this classification results is circular or rectangle;
According to the position of this assignment graph in this first picture, this assignment graph is replaced with the test pattern mated with this classification results, obtain second picture.
In another embodiment, the assignment graph that this acquisition user draws in the first picture, comprising:
Detect the drafting operation of user in this first picture;
Obtain the trace information of this drafting operation;
According to this trace information, this first picture generates this assignment graph.
In another embodiment, the ballot number of each pixel in this region surrounded according to this assignment graph, determine the classification results of this assignment graph, comprising:
The Region dividing this assignment graph surrounded is multiple measure-alike windows;
According to the ballot number of each pixel in each window, obtain total ballot number of each window;
According to total ballot number of window each in this region, determine the classification results of this assignment graph.
In another embodiment, this, according to total ballot number of window each in this region, is determined the classification results of this assignment graph, comprising:
According to total ballot number of window each in this region, obtain total votes object maximal value in this region;
Judge whether the maximal value got is greater than predetermined threshold value;
When this maximal value is greater than this predetermined threshold value, determine that this classification results is for circular;
When this maximal value is not more than this predetermined threshold value, determine that this classification results is rectangle.
In another embodiment, this assignment graph, according to the position of this assignment graph in this first picture, is replaced with the test pattern mated with this classification results, obtains second picture, comprise by this:
When this classification results is circular, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard circular, obtains this second picture; Or,
When this classification results is rectangle, according to the position of this assignment graph in this first picture, this assignment graph is replaced with standard rectangular, obtains this second picture.
Above-mentioned all alternatives, can adopt and combine arbitrarily formation embodiment of the present disclosure, this is no longer going to repeat them.
Those skilled in the art, at consideration instructions and after putting into practice invention disclosed herein, will easily expect other embodiment of the present disclosure.The application is intended to contain any modification of the present disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present disclosure and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Instructions and embodiment are only regarded as exemplary, and true scope of the present disclosure and spirit are pointed out by claim below.
Should be understood that, the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.The scope of the present disclosure is only limited by appended claim.

Claims (11)

1. a Shape classification, is characterized in that, described method comprises:
Obtain the assignment graph that user draws in the first picture;
For each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
According to the ballot number of each pixel in the region that described assignment graph surrounds, determine the classification results of described assignment graph, described classification results is circular or rectangle;
According to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtain second picture.
2. method according to claim 1, is characterized in that, the assignment graph that described acquisition user draws in the first picture, comprising:
Detect the drafting operation of user in described first picture;
Obtain the described trace information drawing operation;
According to described trace information, described first picture generates described assignment graph.
3. method according to claim 1, is characterized in that, the ballot number of each pixel in the described region surrounded according to described assignment graph, determines the classification results of described assignment graph, comprising:
The Region dividing described assignment graph surrounded is multiple measure-alike windows;
According to the ballot number of each pixel in each window, obtain total ballot number of each window;
According to total ballot number of window each in described region, determine the classification results of described assignment graph.
4. method according to claim 3, is characterized in that, described total ballot number according to window each in described region, determines the classification results of described assignment graph, comprising:
According to total ballot number of window each in described region, obtain total votes object maximal value in described region;
Judge whether the maximal value got is greater than predetermined threshold value;
When described maximal value is greater than described predetermined threshold value, determine that described classification results is for circular;
When described maximal value is not more than described predetermined threshold value, determine that described classification results is rectangle.
5. the method according to claim 1 or 4, is characterized in that, described according to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtains second picture, comprising:
When described classification results is circular, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard circular, obtains described second picture; Or,
When described classification results is rectangle, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard rectangular, obtains described second picture.
6. a pattern classification device, is characterized in that, described device comprises:
Acquisition module, for obtaining the assignment graph that user draws in the first picture;
Vote module, for for each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
Sort module, for the ballot number of each pixel in the region that surrounds according to described assignment graph, determines the classification results of described assignment graph, and described classification results is circular or rectangle;
Replacement module, for according to the position of described assignment graph in described first picture, replaces with the test pattern mated with described classification results, obtains second picture by described assignment graph.
7. device according to claim 6, is characterized in that, described acquisition module is also for detecting the drafting operation of user in described first picture; Obtain the described trace information drawing operation; According to described trace information, described first picture generates described assignment graph.
8. device according to claim 6, is characterized in that, the Region dividing of described sort module also for described assignment graph being surrounded is multiple measure-alike windows; According to the ballot number of each pixel in each window, obtain total ballot number of each window; According to total ballot number of window each in described region, determine the classification results of described assignment graph.
9. device according to claim 8, is characterized in that, described sort module, also for the total ballot number according to window each in described region, obtains total votes object maximal value in described region; Judge whether the maximal value got is greater than predetermined threshold value; When described maximal value is greater than described predetermined threshold value, determine that described classification results is for circular; When described maximal value is not more than described predetermined threshold value, determine that described classification results is rectangle.
10. the device according to claim 6 or 9, it is characterized in that, when described replacement module is also for being circular when described classification results, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard circular, obtains described second picture; Or, when described classification results is rectangle, according to the position of described assignment graph in described first picture, described assignment graph is replaced with standard rectangular, obtains described second picture.
11. 1 kinds of pattern classification devices, is characterized in that, comprising:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
Obtain the assignment graph that user draws in the first picture;
For each pixel in described assignment graph, obtain the radial alignment of described pixel, and vote for each pixel in described radial alignment, described radial alignment is through described pixel, and vertical with the gradient direction of described pixel;
According to the ballot number of each pixel in the region that described assignment graph surrounds, determine the classification results of described assignment graph, described classification results is circular or rectangle;
According to the position of described assignment graph in described first picture, described assignment graph is replaced with the test pattern mated with described classification results, obtain second picture.
CN201510633809.2A 2015-09-29 2015-09-29 Pattern classification method and device Pending CN105260743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510633809.2A CN105260743A (en) 2015-09-29 2015-09-29 Pattern classification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510633809.2A CN105260743A (en) 2015-09-29 2015-09-29 Pattern classification method and device

Publications (1)

Publication Number Publication Date
CN105260743A true CN105260743A (en) 2016-01-20

Family

ID=55100424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510633809.2A Pending CN105260743A (en) 2015-09-29 2015-09-29 Pattern classification method and device

Country Status (1)

Country Link
CN (1) CN105260743A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106873981A (en) * 2017-01-11 2017-06-20 努比亚技术有限公司 A kind of icon processing method, device and terminal
CN107133907A (en) * 2016-02-26 2017-09-05 龙芯中科技术有限公司 Pattern drawing method and device
CN110851062A (en) * 2019-08-29 2020-02-28 华为技术有限公司 Drawing method and electronic equipment
CN111985468A (en) * 2020-08-27 2020-11-24 江苏提米智能科技有限公司 Code table pointer value detection method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060098877A1 (en) * 2004-11-09 2006-05-11 Nick Barnes Detecting shapes in image data
CN101110100A (en) * 2006-07-17 2008-01-23 松下电器产业株式会社 Method and device for detecting geometric figure of image
CN103218615A (en) * 2013-04-17 2013-07-24 哈尔滨工业大学深圳研究生院 Face judgment method
CN104424473A (en) * 2013-09-06 2015-03-18 北京三星通信技术研究有限公司 Method and device for identifying and editing freehand sketch
CN104657734A (en) * 2015-03-05 2015-05-27 东方网力科技股份有限公司 Traffic sign detecting method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060098877A1 (en) * 2004-11-09 2006-05-11 Nick Barnes Detecting shapes in image data
CN101110100A (en) * 2006-07-17 2008-01-23 松下电器产业株式会社 Method and device for detecting geometric figure of image
CN103218615A (en) * 2013-04-17 2013-07-24 哈尔滨工业大学深圳研究生院 Face judgment method
CN104424473A (en) * 2013-09-06 2015-03-18 北京三星通信技术研究有限公司 Method and device for identifying and editing freehand sketch
CN104657734A (en) * 2015-03-05 2015-05-27 东方网力科技股份有限公司 Traffic sign detecting method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133907A (en) * 2016-02-26 2017-09-05 龙芯中科技术有限公司 Pattern drawing method and device
CN106873981A (en) * 2017-01-11 2017-06-20 努比亚技术有限公司 A kind of icon processing method, device and terminal
CN106873981B (en) * 2017-01-11 2020-03-31 努比亚技术有限公司 Icon processing method and device and terminal
CN110851062A (en) * 2019-08-29 2020-02-28 华为技术有限公司 Drawing method and electronic equipment
WO2021036903A1 (en) * 2019-08-29 2021-03-04 华为技术有限公司 Drawing method and electronic device
CN111985468A (en) * 2020-08-27 2020-11-24 江苏提米智能科技有限公司 Code table pointer value detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106951884A (en) Gather method, device and the electronic equipment of fingerprint
CN105095881A (en) Method, apparatus and terminal for face identification
CN105224924A (en) Living body faces recognition methods and device
CN104484871B (en) edge extracting method and device
CN105069786A (en) Straight line detection method and straight line detection device
CN105224195A (en) Terminal operation method and device
CN104504684A (en) Edge extraction method and device
CN106127129A (en) Fingerprint typing reminding method and device
CN105242870A (en) False touch method and device of terminal with touch screen
CN105426515A (en) Video classification method and apparatus
CN105046231A (en) Face detection method and device
CN105488511A (en) Image identification method and device
CN104850852A (en) Feature vector calculation method and device
CN105205494A (en) Similar picture identification method and device
CN105139378A (en) Card boundary detection method and apparatus
CN104284240A (en) Video browsing method and device
CN105069426A (en) Similar picture determining method and apparatus
CN104598076A (en) Method and device for shielding touch messages
CN105159496A (en) Touch event response method and mobile terminal
CN105354560A (en) Fingerprint identification method and device
CN105046260A (en) Image pre-processing method and apparatus
CN105513137A (en) Three dimensional model and scene creating method and apparatus based on mobile intelligent terminal
CN105426878A (en) Method and device for face clustering
CN105260743A (en) Pattern classification method and device
CN105100634A (en) Image photographing method and image photographing device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160120