CN108446697A - Image processing method, electronic device and storage medium - Google Patents

Image processing method, electronic device and storage medium Download PDF

Info

Publication number
CN108446697A
CN108446697A CN201810183143.9A CN201810183143A CN108446697A CN 108446697 A CN108446697 A CN 108446697A CN 201810183143 A CN201810183143 A CN 201810183143A CN 108446697 A CN108446697 A CN 108446697A
Authority
CN
China
Prior art keywords
indicia framing
original image
pictures
picture
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810183143.9A
Other languages
Chinese (zh)
Other versions
CN108446697B (en
Inventor
王健宗
王义文
刘奡智
庞烨
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810183143.9A priority Critical patent/CN108446697B/en
Priority to PCT/CN2018/089881 priority patent/WO2019169772A1/en
Publication of CN108446697A publication Critical patent/CN108446697A/en
Application granted granted Critical
Publication of CN108446697B publication Critical patent/CN108446697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Medical Informatics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Databases & Information Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The present invention provides a kind of image processing methods, including:Sample graph valut is trained, the classification function of the samples pictures with indicia framing and the samples pictures without indicia framing is obtained;Based on the classification value for sorting out function calculating original image, if the classification value meets the first preset condition, judge that the original image includes the indicia framing drawn using the pre-set color;Original image is transformed into HSV space from rgb space, obtains HSV pictures;According to value range of the pre-set color in HSV space, binary-state threshold is set, binary conversion treatment is carried out to each pixel in the HSV pictures, obtains binaryzation picture;The location information of objective contour is extracted from binaryzation picture, original image is cut to obtain the corresponding local picture of indicia framing according to the positional information.The present invention also provides a kind of electronic device and storage mediums.The corresponding local picture of indicia framing can be rapidly and accurately cut out from the original image using the present invention.

Description

Image processing method, electronic device and storage medium
Technical field
The present invention relates to a kind of field of computer technology more particularly to image processing method, electronic device and storage mediums.
Background technology
With the development of Internet technology, disparate networks resource is very abundant, greatly facilitates user and is obtained to resource It takes.For example, having the scenery picture of magnanimity high definition on network, to which user is it is not necessary that shooting may also find required figure on the spot in person Piece.Wherein, in order to mark the local content for needing to pay close attention in picture, some pictures carry the label drawn using a certain color In frame, such as the photo of traffic monitoring shooting, people or the vehicle etc. of violation have been marked in photo with red frame, and these offices Portion's content is exactly the content that user wishes to find.Therefore, user not only wishes to find required original image, is more desirable to obtain Take the corresponding local picture of indicia framing in original image.However, for such original image for having carried indicia framing, due to label The location information of frame can not be extracted directly, corresponding to obtain the indicia framing to be difficult to original image accurately cut Local picture.In the case where original image quantity is larger, automatic quickly mode is more needed to realize the local picture Extraction.
Invention content
For these reasons, it is necessary to a kind of image processing method, electronic device and storage medium are provided, can identify band There is the original image of indicia framing, and extracts the location information of the indicia framing, root from the original image with indicia framing automatically The corresponding local picture of indicia framing is rapidly and accurately cut out from the original image to realize according to the location information.
To achieve the above object, the present invention provides a kind of image processing method, and this method includes:Sample training step:It obtains Sample this picture library, the sample graph valut includes multiple samples pictures with indicia framing and corresponding multiple without mark The samples pictures for remembering frame, are trained the sample graph valut, obtain samples pictures with indicia framing and described right The classification function for the samples pictures without indicia framing answered, the indicia framing are the closure wire drawn using pre-set color; Sort out judgment step:Pending original image is obtained, the pending original image is calculated based on the classification function Classification value judges that the original image includes being drawn using the pre-set color if the classification value meets the first preset condition Indicia framing;Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then will The original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is divided Solution is at coloration H, saturation degree S and brightness V values, to obtain HSV pictures;Binary conversion treatment step:Existed according to the pre-set color Value range in HSV space, setting binary-state threshold judge each picture in the HSV pictures using the binary-state threshold Whether coloration H, the saturation degree S and brightness V values of vegetarian refreshments meet the binary-state threshold, according to judging result to the HSV pictures In each pixel carry out binary conversion treatment, obtain the corresponding binaryzation picture of the HSV pictures;Contour detecting step:Pass through wheel Wide detection algorithm detects objective contour from the binaryzation picture, and extracts the location information conduct of the objective contour The corresponding location information of indicia framing in the original image according to the positional information carries out the pending original image It cuts, obtains the corresponding local picture of indicia framing in original image.
Optionally, described that the sample graph valut is trained, obtain the samples pictures with indicia framing and institute The classification function for stating the corresponding samples pictures without indicia framing includes:Convolutional neural networks are built, convolution god is passed through The sample graph valut is trained through network, obtains the corresponding convolutional neural networks model of the sample graph valut;According to Whether each picture carries the remark information of the indicia framing in sample graph valut, and the sample graph valut is divided into containing indicia framing Pictures and unmarked frame pictures, the pictures containing indicia framing include the multiple samples pictures with indicia framing, institute It includes corresponding multiple samples pictures without indicia framing to state unmarked frame pictures;It will the pictures containing indicia framing The convolutional neural networks model is inputted respectively with the unmarked frame pictures, passes through the volume of the convolutional neural networks model Product nuclear convolution obtains the corresponding feature value vector collection of pictures containing indicia framing and the unmarked block diagram piece collection is corresponding Feature value vector collection;By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and the nothing The corresponding feature value vector collection of indicia framing pictures is calculated, and the pictures containing indicia framing and the unmarked block diagram are obtained The classification function of piece collection.
Optionally, described to obtain pending original image, it is calculated based on the classification function described pending original The classification value of picture judges that the original image includes using the default face if the classification value meets the first preset condition Color draw indicia framing include:Pending original image is obtained, the pending original image is inputted into the convolution god Through network model, the corresponding feature vector of pending original image is obtained;Feature vector corresponding to the original image The classification value of the pending original image is calculated based on the classification function, and judges whether the classification value is more than default threshold Value judges that the original image includes the mark drawn using the pre-set color if the classification value is more than the predetermined threshold value Remember frame.
Optionally, the classification function representation is as follows:F (x)=wx+b;Wherein, w for by algorithm of support vector machine to institute The parameter obtained after the corresponding feature value vector collection of pictures containing indicia framing is calculated is stated, b is to pass through algorithm of support vector machine The parameter obtained after calculating the corresponding feature value vector collection of the unmarked block diagram piece collection, x indicate described pending The corresponding feature vector of original image.
Optionally, described by contour detecting algorithm, detect that objective contour includes from the binaryzation picture:Pass through Contour detecting algorithm detects one or more candidate contours from the binaryzation picture;It calculates separately one or more The size of a candidate contours, and result of calculation and the second preset condition are compared, corresponding result of calculation is met into institute The candidate contours of the second preset condition are stated as objective contour.
Optionally, the location information of the extraction objective contour includes:Judge the shape of the objective contour for circle One of shape, ellipse, square, rectangle;When the shape of the objective contour is round, the circle of the objective contour is extracted Heart location information and radius length information;When the shape of the objective contour is ellipse, the two of the objective contour are extracted A focal position information, four vertex location information, and the preset quantity sampled point that is up-sampled in objective contour Location information;When the shape of the objective contour is square or when rectangle, extracts the vertex of the objective contour Location information.
To achieve the above object, the present invention also provides a kind of electronic device, which includes memory and processor, The memory includes picture processing program, which realizes following steps when being executed by the processor:It obtains Sample this picture library, the sample graph valut includes multiple samples pictures with indicia framing and corresponding multiple without mark The samples pictures for remembering frame, are trained the sample graph valut, obtain samples pictures with indicia framing and described right The classification function for the samples pictures without indicia framing answered, the indicia framing are the closure wire drawn using pre-set color; Sort out judgment step:Pending original image is obtained, the pending original image is calculated based on the classification function Classification value judges that the original image includes being drawn using the pre-set color if the classification value meets the first preset condition Indicia framing;Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then will The original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is divided Solution is at coloration H, saturation degree S and brightness V values, to obtain HSV pictures;Binary conversion treatment step:Existed according to the pre-set color Value range in HSV space, setting binary-state threshold judge each picture in the HSV pictures using the binary-state threshold Whether coloration H, the saturation degree S and brightness V values of vegetarian refreshments meet the binary-state threshold, according to judging result to the HSV pictures In each pixel carry out binary conversion treatment, obtain the corresponding binaryzation picture of the HSV pictures;Contour detecting step:Pass through wheel Wide detection algorithm detects objective contour from the binaryzation picture, and extracts the location information conduct of the objective contour The corresponding location information of indicia framing in the original image according to the positional information carries out the pending original image It cuts, obtains the corresponding local picture of indicia framing in original image.
Optionally, described that the sample graph valut is trained, obtain the samples pictures with indicia framing and institute The classification function for stating the corresponding samples pictures without indicia framing includes:Convolutional neural networks are built, convolution god is passed through The sample graph valut is trained through network, obtains the corresponding convolutional neural networks model of the sample graph valut;According to Whether each picture carries the remark information of the indicia framing in sample graph valut, and the sample graph valut is divided into containing indicia framing Pictures and unmarked frame pictures, the pictures containing indicia framing include the multiple samples pictures with indicia framing, institute It includes corresponding multiple samples pictures without indicia framing to state unmarked frame pictures;It will the pictures containing indicia framing The convolutional neural networks model is inputted respectively with the unmarked frame pictures, passes through the volume of the convolutional neural networks model Product nuclear convolution obtains the corresponding feature value vector collection of pictures containing indicia framing and the unmarked block diagram piece collection is corresponding Feature value vector collection;By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and the nothing The corresponding feature value vector collection of indicia framing pictures is calculated, and the pictures containing indicia framing and the unmarked block diagram are obtained The classification function of piece collection.
Optionally, described to obtain pending original image, it is calculated based on the classification function described pending original The classification value of picture judges that the original image includes using the default face if the classification value meets the first preset condition Color draw indicia framing include:Pending original image is obtained, the pending original image is inputted into the convolution god Through network model, the corresponding feature vector of pending original image is obtained;Feature vector corresponding to the original image The classification value of the pending original image is calculated based on the classification function, and judges whether the classification value is more than default threshold Value judges that the original image includes the mark drawn using the pre-set color if the classification value is more than the predetermined threshold value Remember frame.
Optionally, the classification function representation is as follows:F (x)=wx+b;Wherein, w for by algorithm of support vector machine to institute The parameter obtained after the corresponding feature value vector collection of pictures containing indicia framing is calculated is stated, b is to pass through algorithm of support vector machine The parameter obtained after calculating the corresponding feature value vector collection of the unmarked block diagram piece collection, x indicate described pending The corresponding feature vector of original image.
Optionally, described by contour detecting algorithm, detect that objective contour includes from the binaryzation picture:Pass through Contour detecting algorithm detects one or more candidate contours from the binaryzation picture;It calculates separately one or more The size of a candidate contours, and result of calculation and the second preset condition are compared, corresponding result of calculation is met into institute The candidate contours of the second preset condition are stated as objective contour.
Optionally, the location information of the extraction objective contour includes:Judge the shape of the objective contour for circle One of shape, ellipse, square, rectangle;When the shape of the objective contour is round, the circle of the objective contour is extracted Heart location information and radius length information;When the shape of the objective contour is ellipse, the two of the objective contour are extracted A focal position information, four vertex location information, and the preset quantity sampled point that is up-sampled in objective contour Location information;When the shape of the objective contour is square or when rectangle, extracts the vertex of the objective contour Location information.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Storage medium includes picture processing program, when which is executed by processor, is realized at picture as described above The arbitrary steps of reason method.
Image processing method, electronic device and storage medium proposed by the present invention, by being trained to sample graph valut The classification function of samples pictures and the corresponding samples pictures without indicia framing with indicia framing is obtained, and is returned based on described Class function calculates the classification value of pending original image, if the classification value meets the first preset condition, judges the original graph Piece includes the indicia framing drawn using the pre-set color, then by the original image including indicia framing from rgb space It is transformed into HSV space, each pixel in the original image is resolved into coloration H, saturation degree S and brightness V values, to To HSV pictures, and the value range according to the pre-set color in HSV space, binary-state threshold is set, the two-value is used Change threshold value, judges whether the coloration H of each pixel, saturation degree S and brightness V values meet the binaryzation in the HSV pictures Threshold value carries out binary conversion treatment to each pixel in the HSV pictures according to judging result, it is corresponding to obtain the HSV pictures Binaryzation picture detects objective contour finally by contour detecting algorithm from the binaryzation picture, and extracts the mesh The location information of profile is marked as the corresponding location information of indicia framing in the original image, according to the positional information to described Pending original image is cut, and the corresponding local picture of indicia framing in original image is obtained, so as to quick and precisely Ground cuts out the corresponding local picture of indicia framing from the original image.
Description of the drawings
Fig. 1 is the running environment schematic diagram of electronic device preferred embodiment of the present invention;
Fig. 2 is the interaction schematic diagram of electronic device of the present invention and client preferred embodiment;
Fig. 3 is the flow chart of image processing method preferred embodiment of the present invention;
Fig. 4 is the exemplary plot of original image.
Fig. 5 is the exemplary plot of HSV pictures.
Fig. 6 is the exemplary plot of binaryzation picture.
Fig. 7 is the exemplary plot of the corresponding local picture of indicia framing.
Fig. 8 is the Program modual graph of picture processing program in Fig. 1.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
The principle and spirit of the invention are described below with reference to several specific embodiments.It should be appreciated that described herein Specific embodiment be only used to explain the present invention, be not intended to limit the present invention.
It will be apparent to one skilled in the art that embodiments of the present invention can be implemented as a kind of method, apparatus, equipment, be System or computer program product.Therefore, the present invention can be implemented as complete hardware, complete software (including firmware, is stayed Stay software, microcode etc.) or hardware and software combine form.
According to an embodiment of the invention, it is proposed that a kind of image processing method, electronic device and storage medium.
It is the running environment schematic diagram of 1 preferred embodiment of electronic device of the present invention shown in referring to Fig.1.
The electronic device 1, which can be server, portable computer, desktop PC etc., has storage and calculation function Terminal device.
The electronic device 1 includes memory 11, processor 12, network interface 13 and communication bus 14.The network interface 13 may include optionally the wireline interface and wireless interface (such as WI-FI interfaces) of standard.Communication bus 14 is for realizing above-mentioned Connection communication between component.
Memory 11 includes the readable storage medium storing program for executing of at least one type.The readable storage medium storing program for executing of at least one type It can be the non-volatile memory medium of such as flash memory, hard disk, multimedia card, card-type memory.In some embodiments, described can Read the internal storage unit that storage medium can be the electronic device 1, such as the hard disk of the electronic device 1.In other realities It applies in example, the readable storage medium storing program for executing can also be the external memory 11 of the electronic device 1, such as the electronic device 1 The plug-in type hard disk of upper outfit, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) block, flash card (Flash Card) etc..
In the present embodiment, the readable storage medium storing program for executing of the memory 11 is installed on the electronic device commonly used in storage 1 picture processing program 10 and the database 4 etc. for being stored with sample graph valut.The memory 11 can be also used for temporarily depositing Store up the data that has exported or will export.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chips, the program code for being stored in run memory 11 or processing data, example Such as execute picture processing program 10.
Fig. 1 illustrates only the electronic device 1 with component 11-14 and picture processing program 10, it should be understood that It is not required for implementing all components shown, the implementation that can be substituted is more or less component.
Optionally, which can also include user interface, and user interface may include input unit such as keyboard (Keyboard), speech input device such as microphone (microphone) etc. has the equipment of speech identifying function, voice defeated Go out device such as sound equipment, earphone etc..Optionally, user interface can also include standard wireline interface and wireless interface.
Optionally, which can also include display, and display is referred to as display screen or display unit. Can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and Organic Light Emitting Diode in some embodiments (Organic Light-Emitting Diode, OLED) display etc..Display is used to show and handle in the electronic apparatus 1 Information and for showing visual user interface.
Optionally, which further includes touch sensor.What the touch sensor was provided touches for user The region for touching operation is known as touch area.In addition, touch sensor described here can be resistive touch sensor, capacitance Formula touch sensor etc..Moreover, the touch sensor not only includes the touch sensor of contact, proximity may also comprise Touch sensor etc..In addition, the touch sensor can be single sensor, or such as multiple biographies of array arrangement Sensor.User can start picture processing program 10 by touching the touch area.
In addition, the area of the display of the electronic device 1 can be identical as the area of the touch sensor, it can not also Together.Optionally, display and touch sensor stacking are arranged, to form touch display screen.The device is based on touching aobvious Display screen detects the touch control operation of user's triggering.
The electronic device 1 can also include radio frequency (Radio Frequency, RF) circuit, sensor and voicefrequency circuit etc. Deng details are not described herein.
As shown in fig.2, for the interaction schematic diagram of electronic device 1 and 2 preferred embodiment of client of the present invention.The picture Processing routine 10 is run in electronic device 1, and the preferred embodiment of the electronic device 1 in fig. 2 is server.The electronics Device 1 is communicated to connect by network 3 and client 2.The client 2 can be run in all kinds of terminal devices, such as intelligently Mobile phone, portable computer etc..After user logs on to the electronic device 1 by client 2, pass through the picture processing side Method, picture processing program 10 can receive and identify the original image with indicia framing, and automatically from the original of indicia framing The location information of the indicia framing is extracted in picture, according to the positional information to realize rapidly and accurately from the original graph The corresponding local picture of indicia framing is cut out in piece, and the local picture is back to client 2.The picture processing program 10 can be realized by Python programming languages.
As shown in fig.3, for the flow chart of image processing method preferred embodiment of the present invention.The processor of electronic device 1 The following steps of image processing method are realized when the picture processing program 10 stored in 12 execution memories 11:
Step S1, obtain sample graph valut, the sample graph valut include multiple samples pictures with indicia framing and Corresponding multiple samples pictures without indicia framing are trained the sample graph valut, obtain described with indicia framing Samples pictures and the corresponding samples pictures without indicia framing classification function, the indicia framing be using preset face The closure wire that color is drawn.
Specifically, the sample graph valut can be stored in the database 4.The sample graph valut includes user day What is often acquired has confirmed that the samples pictures for the indicia framing for whether carrying the pre-set color.Since user would generally use red to exist The local content for needing to pay close attention to is marked in picture, such as draws a red frame in picture, is needed with marking in several buildings A building being paid close attention to, therefore the pre-set color can be red.Each samples pictures in the sample graph valut Remark information is all carried, the remark information is used to indicate the label whether corresponding samples pictures carry pre-set color Frame.
It is described that the sample graph valut is trained, obtain samples pictures with indicia framing and described corresponding It can be for example accomplished by the following way without the classification function of the samples pictures of indicia framing:
Convolutional neural networks are built, the sample graph valut is trained by the convolutional neural networks, obtains institute State the corresponding convolutional neural networks model of sample graph valut;
The remark information that the indicia framing whether is carried according to each picture in sample graph valut, by the sample graph valut It is divided into pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include the multiple with indicia framing Samples pictures, the unmarked frame pictures include corresponding multiple samples pictures without indicia framing;
The pictures containing indicia framing and the unmarked frame pictures are inputted into the convolutional neural networks model respectively, The corresponding feature value vector collection of the pictures containing indicia framing is obtained by the convolution nuclear convolution of the convolutional neural networks model, And the corresponding feature value vector collection of the unmarked block diagram piece collection;
It is corresponding to the pictures containing indicia framing by support vector machines (Support Vector Machine) algorithm Feature value vector collection and the corresponding feature value vector collection of the unmarked block diagram piece collection are calculated, and the block diagram containing label is obtained The classification function of piece collection and the unmarked frame pictures.
The algorithm of support vector machine is a kind of subsumption algorithm, it is solving small sample, the identification of non-linear and high dimensional pattern In there is advantage, and in the other machines problem concerning study such as can promote the use of Function Fitting, generally, support vector machines is calculated Method can solve the problems, such as classification and the criteria for classification of complex transaction.It will the corresponding feature value vector of the pictures containing indicia framing After collection feature value vector collection corresponding with the unmarked block diagram piece collection is calculated by algorithm of support vector machine, it can obtain It is divided into the picture with indicia framing and the class condition without this two classes picture of the picture of indicia framing, the class condition can With with the classification function representation.
In one embodiment, if the class condition be linear classification, the classification function for example can by with Minor function formula indicates:
F (x)=wx+b;
Wherein, w is to be carried out to the corresponding feature value vector collection of the pictures containing indicia framing by algorithm of support vector machine The parameter obtained after calculating, b are by algorithm of support vector machine to the corresponding feature value vector collection of the unmarked block diagram piece collection The parameter obtained after being calculated, x indicate that the corresponding feature vector of pending original image, i.e., the described x are the change of unknown number Amount.
Step S2 obtains pending original image, and the pending original image is calculated based on the classification function Classification value, if the classification value meet the first preset condition, judge the original image include use the pre-set color paint The indicia framing of system.
Specifically, step S2, can be first by the pending original graph after obtaining the pending original image The convolutional neural networks model of piece input step S1 structures, obtains the corresponding feature vector of pending original image, The i.e. described variable x.
Then, step S2 can be based on the original image corresponding feature vector to wait for described in classification function calculating The classification value of the original image of processing, and judge whether the classification value is more than predetermined threshold value, if the classification value is more than described preset Threshold value then judges that the original image includes the indicia framing drawn using the pre-set color.In the present embodiment, described first Preset condition is that the classification value is more than the predetermined threshold value.
Step S3, if it is determined that the original image includes the indicia framing drawn using the pre-set color, then by the packet The original image for including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is decomposed quality H, saturation degree S and brightness V values are spent, to obtain HSV pictures.
Specifically, the picture that usual user uses or sees is rgb format, therefore can set the original image as RGB The picture of format.Such as Fig. 4 show a rgb format original image (for adapt to Patent Law requirement, change into gray-scale map exhibition Show), 3 kittens have been marked respectively with 3 red square marks frames in the original image.
Since red (R) in the picture of rgb format, green (G), the value range of blue (B) three Color Channels are wider, be 0~ 255, although color distinction is very big from naked eyes, from difference in RGB value ranges and little, value range mutually has Overlapping relation, therefore be difficult the RGB value ranges for judging the red area of red square marks frame in Fig. 4.And HSV colors are empty Between be not only related to red green blue tricolor composition, further account for tone (H), saturation degree (S), brightness (V) color parameter number Value, therefore be more convenient for extracting designated color using HSV color spaces.
Step S3 needs to carry out HSV transformation to the original image as a result,.In the present embodiment, step S3 can be used Cv2.COLOR_RGB2HLS functions in cross-platform computer vision library openCV realize the HSV transformation, by will be described Each pixel in original image resolves into coloration (H), saturation degree (S) and brightness (V) value, and original image is transformed into HSV In color space, to obtain the HSV pictures, such as shown in Fig. 5.As can be seen that the visual effect of indicia framing becomes in Fig. 5 It is more prominent.
Step S4 sets binary-state threshold, using described according to value range of the pre-set color in HSV space Binary-state threshold, judges whether the coloration (H), saturation degree (S) and brightness (V) value of each pixel in the HSV pictures meet The binary-state threshold carries out binary conversion treatment to each pixel in the HSV pictures according to judging result, obtains the HSV The corresponding binaryzation picture of picture.
Specifically, value range of the pre-set color in HSV space, i.e. pre-set color are corresponding in HSV space The value range of tone (H), saturation degree (S), brightness (V) parameter.By taking Fig. 5 as an example, in the HSV pictures of openCV, coloration H's Value range is 0~180, and the value range of saturation degree S is 0~255, and the value range of brightness V is 0~255.Wherein, red The value range of coloration H be about (0~10) ∪ (156~180), the value range of red saturation degree S is about 43~ 255, the value range of red brightness V is about 46~255.Meanwhile when saturation degree S is less than threshold value (reference value 80) Grey is then presented, when brightness V is too low, black is presented, V brightness is excessively high, and white is presented.On this basis, due to red frame in Fig. 5 To be drawn using PC Tools, saturation degree S can generally compare mechanical uniform, therefore in Fig. 5 indicia framing red it is corresponding Value range can be determining it is more narrow, such as H can be determined as:0~1, S:155~255, V:170~255.According to Identified value range can set the binary-state threshold.
According to the binary-state threshold, step S4 carries out binary conversion treatment to the HSV pictures.Specifically, step S4 can To judge whether the coloration (H), saturation degree (S) and brightness (V) value of each pixel in the HSV pictures meet the binaryzation Threshold value, if meeting the binary-state threshold, the pixel value of corresponding pixel is set as the first specified numerical value, such as 255;If It is unsatisfactory for the binary-state threshold, then sets the pixel value of corresponding pixel to the second specified numerical value, such as 0, it is final to obtain To the binaryzation picture.
Red value range in conjunction with indicia framing in above-mentioned Fig. 5 is coloration H:0~1, saturation degree S:155~255, brightness V:170~255, it can be with for the coloration H for the binary-state threshold of Fig. 5 settings:0~1, saturation degree S:155~ 255, brightness V:170~255.According to the binary-state threshold set for Fig. 5, step S4 carries out two to the HSV pictures Value is handled, specifically, you can to detect whether each pixel in Fig. 5 meets H for step S4:0~1, S:155~255, V: 170~255, if satisfied, then the pixel value of respective pixel point in Fig. 5 is set as 255 by step S4, it is rendered as white, if discontented Foot, then the pixel value of respective pixel point in Fig. 5 is set as 0 by step S4, is rendered as black, obtained binaryzation picture such as Fig. 6 It is shown.
Step S5 detects objective contour by contour detecting algorithm from the binaryzation picture, and extracts the mesh The location information of profile is marked as the corresponding location information of indicia framing in the original image, according to the positional information to described Pending original image is cut, and the corresponding local picture of indicia framing in original image is obtained.
Due to the case where there may be field color and the indicia framing solid colours other than some indicia framings in original image, Therefore, there may be some noises in the binaryzation picture obtained by step S4, i.e., by the pixel of non-marked frame region Pixel value be arranged to it is identical as the pixel value of indicia framing pixel, in order to avoid the interference of non-marked frame region location information, because This needs to carry out Denoising disposal.Since theoretically size is smaller for the pixels of these non-marked frame regions, and usually not at Specific shape, so step S5 can exclude size and be unsatisfactory for second by carrying out contour detecting to the binaryzation picture The profile of preset condition is as the Denoising disposal.
Step S5 detects that objective contour may include by contour detecting algorithm from the binaryzation picture as a result,:
By contour detecting algorithm, one or more candidate contours are detected from the binaryzation picture;
Calculate separately the size of one or more of candidate contours, and by result of calculation and the second preset condition into Corresponding result of calculation is met the candidate contours of second preset condition as objective contour by row comparison.
Second preset condition for example can be profile width and highly desirable separately or concurrently big Mr. Yu's numerical value.In conjunction with Shown in Fig. 6, according to the size of kitten in Fig. 4, step S5 can set second preset condition to profile width It need to be simultaneously greater than 10 with height.The cv2.findContours letters in OpenCV can be used for example in the method for the contour detecting Number.
In one embodiment, the shape of the indicia framing used according to general user, the objective contour may be it is round, Ellipse, square and rectangle, the location information that thus step S5 extracts the objective contour for example may include:
Judge the shape of the objective contour for one of round, ellipse, square, rectangle;
When the shape of the objective contour is round, the center location information and radius length of the objective contour are extracted Information;
When the shape of the objective contour is ellipse, two focal position information, four of the objective contour are extracted The location information on a vertex, and the location information of preset quantity sampled point that is up-sampled in objective contour;
When the shape of the objective contour is square or when rectangle, extracts the vertex position of the objective contour Information.
After step S5 extracts the location information of the objective contour, according to the positional information to described pending original Picture is cut, and the corresponding local picture of indicia framing in original image is obtained.Such as the position according to the indicia framing extracted Information, step S5 can cut Fig. 4, obtain indicia framing corresponding local picture in Fig. 4, as shown in Figure 7.
In conclusion according to image processing method provided in this embodiment, by being trained to obtain to sample graph valut The classification function of samples pictures and the corresponding samples pictures without indicia framing with indicia framing, and it is based on the classification letter Number calculates the classification value of pending original image, if the classification value meets the first preset condition, judges in the original image Include the indicia framing drawn using the pre-set color, then converts the original image including indicia framing from rgb space To HSV space, each pixel in the original image is resolved into coloration H, saturation degree S and brightness V values, to obtain HSV pictures, and the value range according to the pre-set color in HSV space set binary-state threshold, use the binaryzation Threshold value judges whether the coloration H of each pixel, saturation degree S and brightness V values meet the binaryzation threshold in the HSV pictures Value carries out binary conversion treatment to each pixel in the HSV pictures according to judging result, obtains the HSV pictures corresponding two Value picture detects objective contour finally by contour detecting algorithm from the binaryzation picture, and extracts the target The location information of profile is waited for described according to the positional information as the corresponding location information of indicia framing in the original image The original image of processing is cut, and the corresponding local picture of indicia framing in original image is obtained.It provides through this embodiment Image processing method can identify the original image with indicia framing, and extract institute from the original image with indicia framing automatically The location information of indicia framing is stated, rapidly and accurately cuts bid from the original image according to the positional information to realize Remember the corresponding local picture of frame.
As shown in fig.8, for the Program modual graph of picture processing program 10 in Fig. 1.In the present embodiment, picture handles journey Sequence 10 is divided into multiple modules, and multiple module is stored in memory 11, and is executed by processor 12, to complete this hair It is bright.The so-called module of the present invention is the series of computation machine program instruction section for referring to complete specific function.
The picture processing program 10 can be divided into:Sample training module 110 sorts out judgment module 120, space turn Change the mold block 130, binary processing module 140 and profile detection module 150.
Sample training module 110, for obtaining sample graph valut, the sample graph valut includes multiple with indicia framing Samples pictures and corresponding multiple samples pictures without indicia framing, are trained the sample graph valut, obtain institute State the classification function of samples pictures and the corresponding samples pictures without indicia framing with indicia framing, the indicia framing For the closure wire drawn using pre-set color.
Specifically, described that the sample graph valut is trained, obtain the samples pictures with indicia framing and institute The classification function for stating the corresponding samples pictures without indicia framing includes:
Sample training module 110 builds convolutional neural networks, by the convolutional neural networks to the sample graph valut It is trained, obtains the corresponding convolutional neural networks model of the sample graph valut;
Whether sample training module 110 carries the remark information of the indicia framing according to each picture in sample graph valut, The sample graph valut is divided into pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include described Multiple samples pictures with indicia framing, the unmarked frame pictures include corresponding multiple samples without indicia framing This picture;
The pictures containing indicia framing and the unmarked frame pictures are inputted the volume by sample training module 110 respectively Product neural network model obtains the pictures containing indicia framing by the convolution nuclear convolution of the convolutional neural networks model and corresponds to Feature value vector collection and the corresponding feature value vector collection of the unmarked block diagram piece collection;
Sample training module 110 is by algorithm of support vector machine to the corresponding feature value vector of the pictures containing indicia framing Collection and the corresponding feature value vector collection of the unmarked block diagram piece collection are calculated, obtain described in pictures containing indicia framing and described The classification function of unmarked frame pictures.
Sort out judgment module 120, for obtaining pending original image, based on the classifications function calculating described in wait locating The classification value of the original image of reason judges that the original image includes using institute if the classification value meets the first preset condition State the indicia framing of pre-set color drafting.
Wherein, described to obtain pending original image, the pending original graph is calculated based on the classification function The classification value of piece judges that the original image includes using the pre-set color if the classification value meets the first preset condition The indicia framing of drafting includes:
Pending original image is obtained, the pending original image is inputted into the convolutional neural networks model, Obtain the corresponding feature vector of pending original image;
The pending original image is calculated based on the classification function to the corresponding feature vector of the original image Classification value, and judge the classification value whether be more than predetermined threshold value, if the classification value be more than the predetermined threshold value, judge the original Beginning picture includes the indicia framing drawn using the pre-set color.
Based on the corresponding feature vector of the original image, the classification function can for example indicate as follows:
F (x)=wx+b;
Wherein, w is to be carried out to the corresponding feature value vector collection of the pictures containing indicia framing by algorithm of support vector machine The parameter obtained after calculating, b are by algorithm of support vector machine to the corresponding feature value vector collection of the unmarked block diagram piece collection The parameter obtained after being calculated, x indicate the corresponding feature vector of the pending original image.
Space conversion module 130, for if it is determined that the original image includes the label drawn using the pre-set color The original image including indicia framing is then transformed into HSV space by frame from rgb space, by each of described original image Pixel all resolves into coloration H, saturation degree S and brightness V values, to obtain HSV pictures.
Binary processing module 140 sets two-value for the value range according to the pre-set color in HSV space Change threshold value and judges the coloration H of each pixel, saturation degree S and brightness V values in the HSV pictures using the binary-state threshold Whether meet the binary-state threshold, binary conversion treatment is carried out to each pixel in the HSV pictures according to judging result, is obtained The corresponding binaryzation picture of the HSV pictures.
Profile detection module 150, for by contour detecting algorithm, target wheel to be detected from the binaryzation picture Exterior feature, and the location information of the objective contour is extracted as the corresponding location information of indicia framing in the original image, according to institute It states location information to cut the pending original image, obtains the corresponding local picture of indicia framing in original image.
Wherein, described by contour detecting algorithm, detect that objective contour includes from the binaryzation picture:
By contour detecting algorithm, one or more candidate contours are detected from the binaryzation picture;
Calculate separately the size of one or more of candidate contours, and by result of calculation and the second preset condition into Corresponding result of calculation is met the candidate contours of second preset condition as objective contour by row comparison.
Specifically, the location information of the extraction objective contour for example may include:
Judge the shape of the objective contour for one of round, ellipse, square, rectangle;
When the shape of the objective contour is round, the center location information and radius length of the objective contour are extracted Information;
When the shape of the objective contour is ellipse, two focal position information, four of the objective contour are extracted The location information on a vertex, and the location information of preset quantity sampled point that is up-sampled in objective contour;
When the shape of the objective contour is square or when rectangle, extracts the vertex position of the objective contour Information.
In the running environment schematic diagram of 1 preferred embodiment of electronic device shown in Fig. 1, including readable storage medium storing program for executing is deposited May include operating system, picture processing program 10 and database 4 in reservoir 11.It is stored in the execution memory 11 of processor 12 Following steps are realized when picture processing program 10:
Sample training step:Sample graph valut is obtained, the sample graph valut includes multiple sample graphs with indicia framing Piece and corresponding multiple samples pictures without indicia framing, are trained the sample graph valut, obtain described carry The classification function of the samples pictures of indicia framing and the corresponding samples pictures without indicia framing, the indicia framing are to use The closure wire that pre-set color is drawn;
Sort out judgment step:Pending original image is obtained, the pending original is calculated based on the classification function The classification value of beginning picture judges that the original image includes using described default if the classification value meets the first preset condition The indicia framing that color is drawn;
Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then will The original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is divided Solution is at coloration H, saturation degree S and brightness V values, to obtain HSV pictures;
Binary conversion treatment step:According to value range of the pre-set color in HSV space, binary-state threshold is set, Using the binary-state threshold, judge whether the coloration H of each pixel, saturation degree S and brightness V values are full in the HSV pictures The foot binary-state threshold carries out binary conversion treatment to each pixel in the HSV pictures according to judging result, obtains described The corresponding binaryzation picture of HSV pictures;
Contour detecting step:By contour detecting algorithm, objective contour is detected from the binaryzation picture, and extract The location information of the objective contour is as the corresponding location information of indicia framing in the original image, according to the positional information The pending original image is cut, the corresponding local picture of indicia framing in original image is obtained.
It is described that the sample graph valut is trained, obtain samples pictures with indicia framing and described corresponding Classification function without the samples pictures of indicia framing includes:
Convolutional neural networks are built, the sample graph valut is trained by the convolutional neural networks, obtains institute State the corresponding convolutional neural networks model of sample graph valut;
The remark information that the indicia framing whether is carried according to each picture in sample graph valut, by the sample graph valut It is divided into pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include the multiple with indicia framing Samples pictures, the unmarked frame pictures include corresponding multiple samples pictures without indicia framing;
The pictures containing indicia framing and the unmarked frame pictures are inputted into the convolutional neural networks model respectively, The corresponding feature value vector collection of the pictures containing indicia framing is obtained by the convolution nuclear convolution of the convolutional neural networks model, And the corresponding feature value vector collection of the unmarked block diagram piece collection;
By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and described unmarked The corresponding feature value vector collection of block diagram piece collection is calculated, and the pictures containing indicia framing and the unmarked frame pictures are obtained Classification function.
It is described to obtain pending original image, returning for the pending original image is calculated based on the classification function Class value judges that the original image includes being drawn using the pre-set color if the classification value meets the first preset condition Indicia framing includes:
Pending original image is obtained, the pending original image is inputted into the convolutional neural networks model, Obtain the corresponding feature vector of pending original image;
The pending original image is calculated based on the classification function to the corresponding feature vector of the original image Classification value, and judge the classification value whether be more than predetermined threshold value, if the classification value be more than the predetermined threshold value, judge the original Beginning picture includes the indicia framing drawn using the pre-set color.
The classification function representation is as follows:
F (x)=wx+b;
Wherein, w is to be carried out to the corresponding feature value vector collection of the pictures containing indicia framing by algorithm of support vector machine The parameter obtained after calculating, b are by algorithm of support vector machine to the corresponding feature value vector collection of the unmarked block diagram piece collection The parameter obtained after being calculated, x indicate the corresponding feature vector of the pending original image.
It is described by contour detecting algorithm, detect that objective contour includes from the binaryzation picture:
By contour detecting algorithm, one or more candidate contours are detected from the binaryzation picture;
Calculate separately the size of one or more of candidate contours, and by result of calculation and the second preset condition into Corresponding result of calculation is met the candidate contours of second preset condition as objective contour by row comparison.
The location information of the extraction objective contour includes:
Judge the shape of the objective contour for one of round, ellipse, square, rectangle;
When the shape of the objective contour is round, the center location information and radius length of the objective contour are extracted Information;
When the shape of the objective contour is ellipse, two focal position information, four of the objective contour are extracted The location information on a vertex, and the location information of preset quantity sampled point that is up-sampled in objective contour;
When the shape of the objective contour is square or when rectangle, extracts the vertex position of the objective contour Information.
Concrete principle please refers to above-mentioned Fig. 8 and is handled about picture about the Program modual graph and Fig. 3 of picture processing program 10 The introduction of the flow chart of method preferred embodiment.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium Can be hard disk, multimedia card, SD card, flash card, SMC, read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM), any one in portable compact disc read-only memory (CD-ROM), USB storage etc. or several timess Meaning combination.The computer readable storage medium includes the database 4 and picture processing journey for being stored with the sample graph valut Sequence 10 etc. realizes following operation when the picture processing program 10 is executed by the processor 12:
Sample training step:Sample graph valut is obtained, the sample graph valut includes multiple sample graphs with indicia framing Piece and corresponding multiple samples pictures without indicia framing, are trained the sample graph valut, obtain described carry The classification function of the samples pictures of indicia framing and the corresponding samples pictures without indicia framing, the indicia framing are to use The closure wire that pre-set color is drawn;
Sort out judgment step:Pending original image is obtained, the pending original is calculated based on the classification function The classification value of beginning picture judges that the original image includes using described default if the classification value meets the first preset condition The indicia framing that color is drawn;
Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then will The original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is divided Solution is at coloration H, saturation degree S and brightness V values, to obtain HSV pictures;
Binary conversion treatment step:According to value range of the pre-set color in HSV space, binary-state threshold is set, Using the binary-state threshold, judge whether the coloration H of each pixel, saturation degree S and brightness V values are full in the HSV pictures The foot binary-state threshold carries out binary conversion treatment to each pixel in the HSV pictures according to judging result, obtains described The corresponding binaryzation picture of HSV pictures;
Contour detecting step:By contour detecting algorithm, objective contour is detected from the binaryzation picture, and extract The location information of the objective contour is as the corresponding location information of indicia framing in the original image, according to the positional information The pending original image is cut, the corresponding local picture of indicia framing in original image is obtained.
It is described that the sample graph valut is trained, obtain samples pictures with indicia framing and described corresponding Classification function without the samples pictures of indicia framing includes:
Convolutional neural networks are built, the sample graph valut is trained by the convolutional neural networks, obtains institute State the corresponding convolutional neural networks model of sample graph valut;
The remark information that the indicia framing whether is carried according to each picture in sample graph valut, by the sample graph valut It is divided into pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include the multiple with indicia framing Samples pictures, the unmarked frame pictures include corresponding multiple samples pictures without indicia framing;
The pictures containing indicia framing and the unmarked frame pictures are inputted into the convolutional neural networks model respectively, The corresponding feature value vector collection of the pictures containing indicia framing is obtained by the convolution nuclear convolution of the convolutional neural networks model, And the corresponding feature value vector collection of the unmarked block diagram piece collection;
By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and described unmarked The corresponding feature value vector collection of block diagram piece collection is calculated, and the pictures containing indicia framing and the unmarked frame pictures are obtained Classification function.
It is described to obtain pending original image, returning for the pending original image is calculated based on the classification function Class value judges that the original image includes being drawn using the pre-set color if the classification value meets the first preset condition Indicia framing includes:
Pending original image is obtained, the pending original image is inputted into the convolutional neural networks model, Obtain the corresponding feature vector of pending original image;
The pending original image is calculated based on the classification function to the corresponding feature vector of the original image Classification value, and judge the classification value whether be more than predetermined threshold value, if the classification value be more than the predetermined threshold value, judge the original Beginning picture includes the indicia framing drawn using the pre-set color.
The classification function representation is as follows:
F (x)=wx+b;
Wherein, w is to be carried out to the corresponding feature value vector collection of the pictures containing indicia framing by algorithm of support vector machine The parameter obtained after calculating, b are by algorithm of support vector machine to the corresponding feature value vector collection of the unmarked block diagram piece collection The parameter obtained after being calculated, x indicate the corresponding feature vector of the pending original image.
It is described by contour detecting algorithm, detect that objective contour includes from the binaryzation picture:
By contour detecting algorithm, one or more candidate contours are detected from the binaryzation picture;
Calculate separately the size of one or more of candidate contours, and by result of calculation and the second preset condition into Corresponding result of calculation is met the candidate contours of second preset condition as objective contour by row comparison.
The location information of the extraction objective contour includes:
Judge the shape of the objective contour for one of round, ellipse, square, rectangle;
When the shape of the objective contour is round, the center location information and radius length of the objective contour are extracted Information;
When the shape of the objective contour is ellipse, two focal position information, four of the objective contour are extracted The location information on a vertex, and the location information of preset quantity sampled point that is up-sampled in objective contour;
When the shape of the objective contour is square or when rectangle, extracts the vertex position of the objective contour Information.
The specific implementation mode of the computer readable storage medium of the present invention is filled with above-mentioned image processing method and electronics Set 1 specific implementation mode it is roughly the same, details are not described herein.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that process, device, article or method including a series of elements include not only those elements, and And further include other elements that are not explicitly listed, or further include for this process, device, article or method institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this There is also other identical elements in the process of element, device, article or method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be expressed in the form of software products, which is stored in one as described above In storage medium, including some instructions are used so that a station terminal equipment (can be mobile phone, computer, server or network Equipment etc.) execute method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of image processing method, which is characterized in that this approach includes the following steps:
Sample training step:Obtain sample graph valut, the sample graph valut include multiple samples pictures with indicia framing with And corresponding multiple samples pictures without indicia framing, the sample graph valut is trained, is obtained described with label The classification function of the samples pictures of frame and the corresponding samples pictures without indicia framing, the indicia framing are using default The closure wire that color is drawn;
Sort out judgment step:Pending original image is obtained, the pending original graph is calculated based on the classification function The classification value of piece judges that the original image includes using the pre-set color if the classification value meets the first preset condition The indicia framing of drafting;
Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then it will be described Original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is resolved into Coloration H, saturation degree S and brightness V values, to obtain HSV pictures;
Binary conversion treatment step:According to value range of the pre-set color in HSV space, binary-state threshold is set, is used The binary-state threshold judges whether the coloration H of each pixel, saturation degree S and brightness V values meet institute in the HSV pictures Binary-state threshold is stated, binary conversion treatment is carried out to each pixel in the HSV pictures according to judging result, obtains the HSV figures The corresponding binaryzation picture of piece;
Contour detecting step:By contour detecting algorithm, objective contour is detected from the binaryzation picture, and described in extraction The location information of objective contour is as the corresponding location information of indicia framing in the original image, according to the positional information to institute It states pending original image to be cut, obtains the corresponding local picture of indicia framing in original image.
2. image processing method as described in claim 1, which is characterized in that it is described that the sample graph valut is trained, The classification function for obtaining the samples pictures with indicia framing and the corresponding samples pictures without indicia framing includes:
Convolutional neural networks are built, the sample graph valut is trained by the convolutional neural networks, obtains the sample The corresponding convolutional neural networks model of this picture library;
The remark information that the indicia framing whether is carried according to each picture in sample graph valut, the sample graph valut is divided into Pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include the multiple sample with indicia framing Picture, the unmarked frame pictures include corresponding multiple samples pictures without indicia framing;
The pictures containing indicia framing and the unmarked frame pictures are inputted into the convolutional neural networks model respectively, are passed through The convolution nuclear convolution of the convolutional neural networks model obtains the corresponding feature value vector collection of the pictures containing indicia framing, and The corresponding feature value vector collection of the unmarked block diagram piece collection;
By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and the unmarked block diagram The corresponding feature value vector collection of piece collection is calculated, and returning for the pictures containing indicia framing and the unmarked frame pictures is obtained Class function.
3. image processing method as claimed in claim 2, which is characterized in that it is described to obtain pending original image, it is based on The classification value sorted out function and calculate the pending original image is sentenced if the classification value meets the first preset condition The fixed original image includes including using the indicia framing that the pre-set color is drawn:
Pending original image is obtained, the pending original image is inputted into the convolutional neural networks model, is obtained The corresponding feature vector of pending original image;
Returning for the pending original image is calculated based on the classification function to the corresponding feature vector of the original image Class value, and judge whether the classification value is more than predetermined threshold value, if the classification value is more than the predetermined threshold value, judge the original graph Piece includes the indicia framing drawn using the pre-set color.
4. image processing method as claimed in claim 3, which is characterized in that the classification function representation is as follows:
F (x)=wx+b;
Wherein, w is to be calculated the corresponding feature value vector collection of the pictures containing indicia framing by algorithm of support vector machine The parameter obtained afterwards, b are to be carried out to the corresponding feature value vector collection of the unmarked block diagram piece collection by algorithm of support vector machine The parameter obtained after calculating, x indicate the corresponding feature vector of the pending original image.
5. image processing method as described in claim 1, which is characterized in that it is described by contour detecting algorithm, from described two Detect that objective contour includes in value picture:
By contour detecting algorithm, one or more candidate contours are detected from the binaryzation picture;
It calculates separately the size of one or more of candidate contours, and result of calculation and the second preset condition is carried out pair Than corresponding result of calculation is met the candidate contours of second preset condition as objective contour.
6. image processing method as described in claim 1, which is characterized in that the location information of the extraction objective contour Including:
Judge the shape of the objective contour for one of round, ellipse, square, rectangle;
When the shape of the objective contour is round, the center location information and radius length letter of the objective contour are extracted Breath;
When the shape of the objective contour be ellipse when, extract the objective contour two focal position information, four top The location information of point, and the location information of preset quantity sampled point that is up-sampled in objective contour;
When the shape of the objective contour is square or when rectangle, extracts the vertex position letter of the objective contour Breath.
7. a kind of electronic device, including memory and processor, which is characterized in that the memory includes picture processing journey Sequence, the picture processing program realize following steps when being executed by the processor:
Sample training step:Obtain sample graph valut, the sample graph valut include multiple samples pictures with indicia framing with And corresponding multiple samples pictures without indicia framing, the sample graph valut is trained, is obtained described with label The classification function of the samples pictures of frame and the corresponding samples pictures without indicia framing, the indicia framing are using default The closure wire that color is drawn;
Sort out judgment step:Pending original image is obtained, the pending original graph is calculated based on the classification function The classification value of piece judges that the original image includes using the pre-set color if the classification value meets the first preset condition The indicia framing of drafting;
Space conversion step:If it is determined that the original image includes the indicia framing drawn using the pre-set color, then it will be described Original image including indicia framing is transformed into HSV space from rgb space, and each pixel in the original image is resolved into Coloration H, saturation degree S and brightness V values, to obtain HSV pictures;
Binary conversion treatment step:According to value range of the pre-set color in HSV space, binary-state threshold is set, is used The binary-state threshold judges whether the coloration H of each pixel, saturation degree S and brightness V values meet institute in the HSV pictures Binary-state threshold is stated, binary conversion treatment is carried out to each pixel in the HSV pictures according to judging result, obtains the HSV figures The corresponding binaryzation picture of piece;
Contour detecting step:By contour detecting algorithm, objective contour is detected from the binaryzation picture, and described in extraction The location information of objective contour is as the corresponding location information of indicia framing in the original image, according to the positional information to institute It states pending original image to be cut, obtains the corresponding local picture of indicia framing in original image.
8. electronic device as claimed in claim 7, which is characterized in that it is described that the sample graph valut is trained, it obtains The classification function of the samples pictures with indicia framing and the corresponding samples pictures without indicia framing includes:
Convolutional neural networks are built, the sample graph valut is trained by the convolutional neural networks, obtains the sample The corresponding convolutional neural networks model of this picture library;
The remark information that the indicia framing whether is carried according to each picture in sample graph valut, the sample graph valut is divided into Pictures containing indicia framing and unmarked frame pictures, the pictures containing indicia framing include the multiple sample with indicia framing Picture, the unmarked frame pictures include corresponding multiple samples pictures without indicia framing;
The pictures containing indicia framing and the unmarked frame pictures are inputted into the convolutional neural networks model respectively, are passed through The convolution nuclear convolution of the convolutional neural networks model obtains the corresponding feature value vector collection of the pictures containing indicia framing, and The corresponding feature value vector collection of the unmarked block diagram piece collection;
By algorithm of support vector machine to the corresponding feature value vector collection of the pictures containing indicia framing and the unmarked block diagram The corresponding feature value vector collection of piece collection is calculated, and returning for the pictures containing indicia framing and the unmarked frame pictures is obtained Class function.
9. electronic device as claimed in claim 8, which is characterized in that it is described to obtain pending original image, based on described Sort out the classification value that function calculates the pending original image, if the classification value meets the first preset condition, judgement should Original image includes including using the indicia framing that the pre-set color is drawn:
Pending original image is obtained, the pending original image is inputted into the convolutional neural networks model, is obtained The corresponding feature vector of pending original image;
Returning for the pending original image is calculated based on the classification function to the corresponding feature vector of the original image Class value, and judge whether the classification value is more than predetermined threshold value, if the classification value is more than the predetermined threshold value, judge the original graph Piece includes the indicia framing drawn using the pre-set color.
10. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium includes picture processing Program when the picture processing program is executed by processor, realizes that picture according to any one of claims 1 to 6 such as is handled The step of method.
CN201810183143.9A 2018-03-06 2018-03-06 Image processing method, electronic device and storage medium Active CN108446697B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810183143.9A CN108446697B (en) 2018-03-06 2018-03-06 Image processing method, electronic device and storage medium
PCT/CN2018/089881 WO2019169772A1 (en) 2018-03-06 2018-06-05 Picture processing method, electronic apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810183143.9A CN108446697B (en) 2018-03-06 2018-03-06 Image processing method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN108446697A true CN108446697A (en) 2018-08-24
CN108446697B CN108446697B (en) 2019-11-12

Family

ID=63193729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810183143.9A Active CN108446697B (en) 2018-03-06 2018-03-06 Image processing method, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN108446697B (en)
WO (1) WO2019169772A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447895A (en) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 Picture Generation Method and device, storage medium and electronic device
CN109522898A (en) * 2018-09-18 2019-03-26 平安科技(深圳)有限公司 Handwriting samples picture mask method, device, computer equipment and storage medium
CN110084132A (en) * 2019-04-03 2019-08-02 杭州深数科技有限公司 Timber goods yard timber information acquisition method based on unmanned plane, system, device
CN110110750A (en) * 2019-03-29 2019-08-09 广州思德医疗科技有限公司 A kind of classification method and device of original image
CN110162649A (en) * 2019-05-24 2019-08-23 北京百度网讯科技有限公司 Sample data acquisition methods obtain system, server and computer-readable medium
CN110220480A (en) * 2019-05-07 2019-09-10 上海理工大学 A kind of measurement method of eye glass frame top rake
CN110889882A (en) * 2019-11-11 2020-03-17 北京皮尔布莱尼软件有限公司 Picture synthesis method and computing device
CN112183554A (en) * 2020-09-01 2021-01-05 国交空间信息技术(北京)有限公司 Automatic road boundary contour extraction method
CN112481839A (en) * 2020-11-27 2021-03-12 杭州数迈科技有限公司 Fabric sewing method, system, equipment and storage medium
CN114385256A (en) * 2020-10-22 2022-04-22 华为云计算技术有限公司 Method and device for configuring system parameters
CN114781846A (en) * 2022-04-13 2022-07-22 国家电网有限公司技术学院分公司 Evaluation method and system for overhead transmission line defect identification training

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061933A (en) * 2019-11-21 2020-04-24 深圳壹账通智能科技有限公司 Picture sample library construction method and device, readable storage medium and terminal equipment
CN113093556A (en) * 2020-01-08 2021-07-09 佛山市云米电器科技有限公司 Clothing collection reminding method, clothes hanger, system and storage medium
CN111209922B (en) * 2020-01-14 2023-09-01 深圳市彬讯科技有限公司 Image color system style marking method, device, equipment and medium based on svm and opencv
CN113496139B (en) * 2020-03-18 2024-02-13 北京京东乾石科技有限公司 Method and apparatus for detecting objects from images and training object detection models
CN113538450B (en) 2020-04-21 2023-07-21 百度在线网络技术(北京)有限公司 Method and device for generating image
CN112508016B (en) * 2020-12-15 2024-04-16 深圳万兴软件有限公司 Image processing method, device, computer equipment and storage medium
CN112686265A (en) * 2021-01-07 2021-04-20 南京大学 Hierarchic contour extraction-based pictograph segmentation method
CN112966786A (en) * 2021-04-15 2021-06-15 宁波九寰适创科技有限公司 Automatic marking method for convolutional neural network training data
CN114092456A (en) * 2021-11-26 2022-02-25 上海申挚医疗科技有限公司 Cell fluorescence image distinguishing method and system
CN114399617B (en) * 2021-12-23 2023-08-04 北京百度网讯科技有限公司 Method, device, equipment and medium for identifying shielding pattern
CN116469025B (en) * 2022-12-30 2023-11-24 以萨技术股份有限公司 Processing method for identifying task, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877126A (en) * 2009-11-19 2010-11-03 东软集团股份有限公司 Method and device for splitting license plate candidate area
CN103093181A (en) * 2011-11-01 2013-05-08 青岛海信网络科技股份有限公司 License plate image locating method and device
CN103617422A (en) * 2013-10-29 2014-03-05 浙江工业大学 A social relation management method based on business card recognition
US20160275366A1 (en) * 2015-03-19 2016-09-22 Fuji Xerox Co., Ltd. Image processing apparatus, image processing system, non-transitory computer readable medium, and image processing method
US20170278266A1 (en) * 2016-03-22 2017-09-28 Tata Consultancy Services Limited Systems and methods for detecting and tracking a marker

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104732220B (en) * 2015-04-03 2017-12-22 中国人民解放军国防科学技术大学 A kind of particular color human body detecting method towards monitor video
CN105678756A (en) * 2015-12-30 2016-06-15 天津盛购科技发展有限公司 Storage location positioning system based on colors

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877126A (en) * 2009-11-19 2010-11-03 东软集团股份有限公司 Method and device for splitting license plate candidate area
CN103093181A (en) * 2011-11-01 2013-05-08 青岛海信网络科技股份有限公司 License plate image locating method and device
CN103617422A (en) * 2013-10-29 2014-03-05 浙江工业大学 A social relation management method based on business card recognition
US20160275366A1 (en) * 2015-03-19 2016-09-22 Fuji Xerox Co., Ltd. Image processing apparatus, image processing system, non-transitory computer readable medium, and image processing method
US20170278266A1 (en) * 2016-03-22 2017-09-28 Tata Consultancy Services Limited Systems and methods for detecting and tracking a marker

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李贺等: "基于颜色规格化和轮廓多边形的", 《铁路计算机应用》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447895A (en) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 Picture Generation Method and device, storage medium and electronic device
US11538208B2 (en) 2018-09-03 2022-12-27 Tencent Technology (Shenzhen) Company Limited Picture generation method and device, storage medium, and electronic device
CN109447895B (en) * 2018-09-03 2021-06-08 腾讯科技(武汉)有限公司 Picture generation method and device, storage medium and electronic device
CN109522898A (en) * 2018-09-18 2019-03-26 平安科技(深圳)有限公司 Handwriting samples picture mask method, device, computer equipment and storage medium
CN110110750A (en) * 2019-03-29 2019-08-09 广州思德医疗科技有限公司 A kind of classification method and device of original image
CN110084132A (en) * 2019-04-03 2019-08-02 杭州深数科技有限公司 Timber goods yard timber information acquisition method based on unmanned plane, system, device
CN110220480A (en) * 2019-05-07 2019-09-10 上海理工大学 A kind of measurement method of eye glass frame top rake
CN110162649A (en) * 2019-05-24 2019-08-23 北京百度网讯科技有限公司 Sample data acquisition methods obtain system, server and computer-readable medium
CN110162649B (en) * 2019-05-24 2021-06-18 北京百度网讯科技有限公司 Sample data acquisition method, acquisition system, server and computer readable medium
CN110889882A (en) * 2019-11-11 2020-03-17 北京皮尔布莱尼软件有限公司 Picture synthesis method and computing device
CN112183554A (en) * 2020-09-01 2021-01-05 国交空间信息技术(北京)有限公司 Automatic road boundary contour extraction method
CN112183554B (en) * 2020-09-01 2024-06-07 国交空间信息技术(北京)有限公司 Automatic road boundary contour extraction method
CN114385256A (en) * 2020-10-22 2022-04-22 华为云计算技术有限公司 Method and device for configuring system parameters
CN114385256B (en) * 2020-10-22 2024-06-11 华为云计算技术有限公司 Configuration method and configuration device of system parameters
CN112481839A (en) * 2020-11-27 2021-03-12 杭州数迈科技有限公司 Fabric sewing method, system, equipment and storage medium
CN114781846A (en) * 2022-04-13 2022-07-22 国家电网有限公司技术学院分公司 Evaluation method and system for overhead transmission line defect identification training

Also Published As

Publication number Publication date
CN108446697B (en) 2019-11-12
WO2019169772A1 (en) 2019-09-12

Similar Documents

Publication Publication Date Title
CN108446697B (en) Image processing method, electronic device and storage medium
US20210256258A1 (en) Method, apparatus, and computer program for extracting representative characteristics of object in image
CN108961279A (en) Image processing method, device and mobile terminal
CN109636825A (en) Seal graphics dividing method, device and computer readable storage medium
CN103699532B (en) Image color retrieval method and system
CN107798299A (en) Billing information recognition methods, electronic installation and readable storage medium storing program for executing
CN110675940A (en) Pathological image labeling method and device, computer equipment and storage medium
CN111178355B (en) Seal identification method, device and storage medium
CN106777177A (en) Search method and device
KR102002024B1 (en) Method for processing labeling of object and object management server
CN110197238B (en) Font type identification method, system and terminal equipment
CN110415212A (en) Abnormal cell detection method, device and computer readable storage medium
CN110363747B (en) Intelligent abnormal cell judging method, device and computer readable storage medium
CN106372624A (en) Human face recognition method and human face recognition system
CN109800747A (en) Medical invoice recognition methods, user equipment, storage medium and device
CN110737687A (en) Data query method, device, equipment and storage medium
CN111784665A (en) OCT image quality assessment method, system and device based on Fourier transform
CN112036304A (en) Medical bill layout identification method and device and computer equipment
CN108984576A (en) A kind of patent document acquisition methods and system based on convolutional neural networks
CN108877030B (en) Image processing method, device, terminal and computer readable storage medium
CN112529914B (en) Real-time hair segmentation method and system
CN104093010B (en) A kind of image processing method and device
CN103854020A (en) Character recognition method and device
CN104598289B (en) A kind of recognition methods and a kind of electronic equipment
CN111950469A (en) Road sign detection method, system, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant