CN108805190A - A kind of image processing method and device - Google Patents
A kind of image processing method and device Download PDFInfo
- Publication number
- CN108805190A CN108805190A CN201810538373.2A CN201810538373A CN108805190A CN 108805190 A CN108805190 A CN 108805190A CN 201810538373 A CN201810538373 A CN 201810538373A CN 108805190 A CN108805190 A CN 108805190A
- Authority
- CN
- China
- Prior art keywords
- subgraph
- target
- image
- threshold value
- target image
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The present invention provides a kind of image processing method and devices, belong to field of computer technology.Wherein, terminal can first judge whether target image is picture mosaic image, then, it can be when target image be picture mosaic image, target image is split, obtain at least two target subgraphs that target image includes, finally, classify respectively to every target subgraph, and determine the classification of target image based on the classification results of every target subgraph, in this way, by the way that target image is split, the content complexity of target image is reduced, the accuracy rate of judgement can be improved to avoid due to the complicated caused erroneous judgement of picture material.
Description
Technical field
The invention belongs to field of computer technology, more particularly to a kind of image processing method and device.
Background technology
With the continuous development of field of computer technology, the information in internet is more and more.In order to ensure in internet
The safety of information, legitimacy, it usually needs the information uploaded to user is audited, could be by these when audit passes through
Information is distributed in internet.For example, for the image in internet, it usually needs classify to image, to judge image
Whether it is illegal image, for example, judging whether image is pornographic image or bloody violence image, etc..
In the prior art, it is typically directly treated using preset disaggregated model using pending image as basis for estimation
Audit image is classified.But when pending image is the picture mosaic image of the independent subgraph composition of at least two contents,
Since the composition and content of picture mosaic image are complex, the difficulty of judgement is larger, therefore the problem of often will appear erroneous judgement, sentences
Disconnected accuracy rate is relatively low.
Invention content
A kind of image processing method of present invention offer and device, to solve the problems, such as that the accuracy rate judged is relatively low.
According to the present invention in a first aspect, provide a kind of image processing method, be applied to terminal, this method can wrap
It includes:
Judge whether target image is picture mosaic image;
If the target image is picture mosaic image, the target image is split, the target image packet is obtained
At least two target subgraphs included;
Classify respectively to every target subgraph, and the mesh is determined based on the classification results of every target subgraph
The classification of logo image.
Optionally, described to judge the step of whether target image is picture mosaic image, including:
The target image is converted into gray level image, obtaining can processing target image;
Based on preset horizontal edge operator, determine described in can processing target image first edge figure in the horizontal direction,
And be based on preset vertical edge operator, determine described in can processing target image vertical direction second edge figure;
The divisible quantity of the target image in the horizontal direction is determined based on the first edge figure, obtains first point
Quantity is cut, the divisible quantity of the target image in vertical direction is determined based on the first edge figure, obtains second point
Cut quantity;
Based on first dividing number and second dividing number, determine whether the target image is picture mosaic figure
Picture.
Optionally, described that the divisible number of the target image in the horizontal direction is determined based on the first edge figure
The step of measuring, obtaining the first dividing number, including:
The quantity for calculating object pixel row in the first edge figure, obtains the first quantity;The object pixel row indicates
Including the number of object pixel be more than the pixel column of the first predetermined number threshold value, it is pre- that the object pixel indicates that gray value is equal to
If the pixel of gray value;
If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that first segmentation
Quantity is 0;
If first quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, calculate every
The distance between a object pixel row obtains multiple first distances;
By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if the first object
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that first dividing number is 0;
If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, in the first object apart from right
When the distance value answered is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object apart from corresponding
When distance value is not less than pre-determined distance threshold value, the frequency of occurrences of the first object distance is determined as the first segmentation number
Amount.
Optionally, described based on determining the target image in vertical direction divisible described in the first edge figure
Quantity, the step of obtaining the second dividing number, including:
The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity;The object pixel
Row indicate that the number for the object pixel for including is more than the pixel column of the second predetermined number threshold value, and the object pixel indicates gray value
Equal to the pixel of default gray value;
If second quantity is more than first predetermined threshold value, or, being less than second predetermined threshold value, it is determined that described
Second dividing number is 0;
If second quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, calculate every
The distance between a object pixel row, obtain multiple second distances;
Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if second target
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that second dividing number is 0;
If the frequency of occurrences of second target range be not less than the predeterminated frequency threshold value, second target away from
From corresponding distance value be less than the pre-determined distance threshold value when, determine second dividing number be 0, second target away from
When being not less than the pre-determined distance threshold value from corresponding distance value, the frequency of occurrences of second target range is determined as described
Second dividing number.
Optionally, if the target image is picture mosaic image, the target image is split, described in acquisition
The step of at least two target subgraphs that target image includes, including:
If first dividing number and second dividing number are not zero, based on the object pixel row with
And the object pixel row, the target image is split, multiple target subgraphs are obtained;
If first dividing number is not zero, second dividing number is zero, then is based on the object pixel row pair
The target image is split, and obtains multiple second subgraphs;Target subgraph is determined based on the multiple second subgraph;
If second dividing number is not zero, first dividing number is zero, then is based on object pixel row pair
The target image is split, and obtains multiple third subgraphs;Target subgraph is determined based on the multiple third subgraph.
Optionally, described the step of target subgraph is determined based on the multiple second subgraph, including:
For each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third edge
Figure;
Based on the third edge graph, judge that second subgraph whether there is divisible position in vertical direction;
If there are divisible position, the divisible position based on second subgraph in vertical direction, to described
Second subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, second subgraph is determined as target subgraph.
Optionally, described the step of target subgraph is determined based on the multiple third subgraph, including:
For each third subgraph, determines the edge graph of the third subgraph in the horizontal direction, obtain the 4th side
Edge figure;
Based on the 4th edge graph, judge that the third subgraph whether there is divisible position in the horizontal direction;
If there are divisible position, the divisible position based on the third subgraph in the horizontal direction, to described
Third subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, the third subgraph is determined as target subgraph.
Second aspect according to the present invention provides a kind of image processing apparatus, is applied to terminal, which can wrap
It includes:
Judgment module, for judging whether target image is picture mosaic image;
Divide module, if being picture mosaic image for the target image, the target image is split, obtains institute
State at least two target subgraphs that target image includes;
Sort module, for classifying respectively to every target subgraph, and based on the classification of every target subgraph
As a result the classification of the target image is determined.
Optionally, the judgment module, including:
Transform subblock, for the target image to be converted to gray level image, obtaining can processing target image;
First determination sub-module, for be based on preset horizontal edge operator, determine described in can processing target image in water
Square to first edge figure, and, be based on preset vertical edge operator, determine described in can processing target image in Vertical Square
To second edge figure;
Second determination sub-module, for based on the first edge figure determine the target image in the horizontal direction can
Dividing number obtains the first dividing number, based on the first edge figure determine the target image in vertical direction can
Dividing number obtains the second dividing number;
Third determination sub-module, described in based on first dividing number and second dividing number, determining
Whether target image is picture mosaic image.
Optionally, second determination sub-module, is used for:
The quantity for calculating object pixel row in the first edge figure, obtains the first quantity;The object pixel row indicates
Including the number of object pixel be more than the pixel column of the first predetermined number threshold value, it is pre- that the object pixel indicates that gray value is equal to
If the pixel of gray value;
If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that first segmentation
Quantity is 0;
If first quantity is no more than second predetermined threshold value and is not less than first predetermined threshold value, calculate every
The distance between a object pixel row obtains multiple first distances;
By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if the first object
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that first dividing number is 0;
If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, in the first object apart from right
When the distance value answered is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object apart from corresponding
When distance value is not less than pre-determined distance threshold value, the frequency of occurrences of the first object distance is determined as the first segmentation number
Amount.
Optionally, second determination sub-module, is used for, including:
The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity;The object pixel
Row indicate that the number for the object pixel for including is more than the pixel column of the second predetermined number threshold value, and the object pixel indicates gray value
Equal to the pixel of default gray value;
If second quantity is more than first predetermined threshold value, or, being less than second predetermined threshold value, it is determined that described
Second dividing number is 0;
If second quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, calculate every
The distance between a object pixel row, obtain multiple second distances;
Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if second target
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that second dividing number is 0;
If the frequency of occurrences of second target range be not less than the predeterminated frequency threshold value, second target away from
From corresponding distance value be less than the pre-determined distance threshold value when, determine second dividing number be 0, second target away from
When being not less than the pre-determined distance threshold value from corresponding distance value, the frequency of occurrences of second target range is determined as described
Second dividing number.
Optionally, the segmentation module, including:
First segmentation submodule, if being not zero for first dividing number and second dividing number,
It is arranged based on the object pixel row and the object pixel, the target image is split, multiple target subgraphs are obtained
Picture;
Second segmentation submodule, if being not zero for first dividing number, second dividing number is zero, then base
The target image is split in the object pixel row, obtains multiple second subgraphs;4th determination sub-module, is used for
Target subgraph is determined based on the multiple second subgraph;
Third divides submodule, if being not zero for second dividing number, first dividing number is zero, then base
It is arranged in the object pixel and the target image is split, obtain multiple third subgraphs;5th determination sub-module, is used for
Target subgraph is determined based on the multiple third subgraph.
Optionally, the 4th determination sub-module, is used for:
For each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third edge
Figure;
Based on the third edge graph, judge that second subgraph whether there is divisible position in vertical direction;
If there are divisible position, the divisible position based on second subgraph in vertical direction, to described
Second subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, second subgraph is determined as target subgraph.
Optionally, the 5th determination sub-module, is used for:
For each third subgraph, determines the edge graph of the third subgraph in the horizontal direction, obtain the 4th side
Edge figure;
Based on the 4th edge graph, judge that the third subgraph whether there is divisible position in the horizontal direction;
If there are divisible position, the divisible position based on the third subgraph in the horizontal direction, to described
Third subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, the third subgraph is determined as target subgraph.
For first technology, the present invention has following advantage:
Terminal can first judge whether target image is picture mosaic image, then, can be when target image is picture mosaic image, to mesh
Logo image is split, and at least two target subgraphs that target image includes is obtained, finally, respectively to every target subgraph
Classify, and determine the classification of target image based on the classification results of every target subgraph, in this way, by by target image
It splits, reduces the content complexity of target image, the standard of judgement can be improved to avoid due to the complicated caused erroneous judgement of picture material
True rate.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention,
And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field
Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is a kind of step flow chart for image processing method that the embodiment of the present invention one provides;
Fig. 2-1 is a kind of step flow chart of image processing method provided by Embodiment 2 of the present invention;
Fig. 2-2 is first edge schematic diagram provided by Embodiment 2 of the present invention;
Fig. 2-3 is second edge schematic diagram provided by Embodiment 2 of the present invention;
Fig. 2-4 is a kind of fractionation schematic diagram provided by Embodiment 2 of the present invention;
Fig. 2-5 is another fractionation schematic diagram provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of block diagram for image processing apparatus that the embodiment of the present invention three provides;
Fig. 4 is a kind of block diagram for image processing apparatus that the embodiment of the present invention four provides.
Specific implementation mode
Exemplary embodiment of the present invention is more fully described below with reference to accompanying drawings.Although showing the present invention in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the present invention without should be by embodiments set forth here
It is limited.It is to be able to be best understood from the present invention on the contrary, providing these embodiments, and can be by the scope of the present invention
Completely it is communicated to those skilled in the art.
Embodiment one
Fig. 1 is a kind of step flow chart for image processing method that the embodiment of the present invention one provides, and is applied to terminal, such as schemes
Shown in 1, this method may include:
Step 101 judges whether target image is picture mosaic image.
In the embodiment of the present invention, since the content of picture mosaic image is complex, the False Rate of classification is higher, and to be sorted
Target image is likely to be picture mosaic image, and therefore, terminal can first judge target image before classifying to target image
Whether it is picture mosaic image.Specifically, terminal can first obtain the edge graph of target image, wherein the edge graph can embody mesh
The characteristics of image of logo image, the edge graph for being then based on target image determine divisible quantity, it is true to be finally based on divisible quantity
Whether the image that sets the goal is picture mosaic image.
If step 102, the target image are picture mosaic image, the target image is split, the mesh is obtained
At least two target subgraphs that logo image includes.
In the embodiment of the present invention, if target image is picture mosaic image, illustrate target image by the independent son of multiple contents
Image forms, and in order to improve the judging nicety rate to target image classification, target image can be divided into sub one by one by terminal
Image obtains multiple target subgraphs, and then reduces the content complexity of target image, improves subsequent classification accuracy.Into
One step, if target image is not picture mosaic image, terminal directly can utilize preset disaggregated model to the target figure
As classifying.
Step 103 respectively classifies to every target subgraph, and the classification results based on every target subgraph are true
The classification of the fixed target image.
In the embodiment of the present invention, since every target subgraph is all a part for target image, that is, every target subgraph
A part of content as all representing target image, therefore, terminal can first judge the classification of each target subgraph, be finally based on
The classification of every target subgraph determines the classification of target image, in this manner it is ensured that when determining target image classification, energy
Enough fully take into account all the elements of target image.
In conclusion the image processing method that the embodiment of the present invention one provides, can first judge whether target image is picture mosaic
Image can then be split target image, it includes at least to obtain target image when target image is picture mosaic image
Two target subgraphs finally respectively classify to every target subgraph, and based on the classification knot of every target subgraph
Fruit determines the classification of target image, in this way, by splitting target image, reduces the content complexity of target image, can keep away
Exempt from, due to the complicated caused erroneous judgement of picture material, to improve the accuracy rate of judgement.
Embodiment two
Fig. 2-1 is a kind of step flow chart of image processing method provided by Embodiment 2 of the present invention, is applied to terminal, such as
Shown in Fig. 2-1, this method may include:
The target image is converted to gray level image by step 201, and obtaining can processing target image.
It, can be by carrying out gray processing processing to target image, to obtain the corresponding gray-scale map of target image in this step
Picture, wherein gray processing processing is the process that coloured image is converted to gray level image, carries out the gray scale obtained after gray processing processing
Image can reflect distribution and the feature of the entirety and local coloration and brightness degree of entire image.The embodiment of the present invention
In, by the way that colored target image is converted to gray level image, calculating quantitative change when can make subsequently for target image processing
It must lack, and then reduce the consuming to terminal system resource.Specifically, terminal can be based on the red color channel value of each pixel
R, green channel value G and blue channel value B calculates the corresponding gray value Gray of each pixel by following formula 1, then will
The gray scale of each pixel is set as the corresponding gray value of each pixel, obtains gray level image.
Gray=R*0.299+G*0.587+B*0.114;(formula 1)
It should be noted that in another alternative embodiment of the present invention, the maximum R that is also based in target image
Value, maximum G values, maximum B values, minimum R values, minimum G values and minimum B values calculate a normal brightness value using following formula 2
Then L sets the brightness value of each pixel to the normal brightness value, obtains gray level image.
L=(max (R, G, B)+min (R, G, B))/2;(formula 2)
Step 202 is based on preset horizontal edge operator, can processing target image in the horizontal direction first described in determination
Edge graph, and, be based on preset vertical edge operator, determine described in can processing target image vertical direction second edge
Figure.
In this step, the horizontal edge operator and vertical edge operator can be Sobel Sobel operators, specifically,
The horizontal edge operator can be the minor matrix of a 3*3:
-1 | 0 | +1 |
-2 | 0 | +2 |
-1 | 0 | +1 |
Further, which can be the minor matrix of a 3*3:
+1 | +2 | +1 |
0 | 0 | 0 |
-1 | -2 | -1 |
Further, terminal can using can be in processing target image each pixel as can processing target image it is corresponding
Each element in matrix, the gray value of each pixel are the value of each element, then, for can processing target image correspond to
Matrix in each element, calculate the element and around it 8 pixels with it is right in the minor matrix of horizontal edge operator representation
The product of position element is answered, then by the addition of obtained product, the new gray value of the corresponding pixel of the element is obtained, with this
Analogize, can be in processing target image after the new gray value of each pixel calculating, it can be in processing target image
The gray value of each pixel is set as the corresponding new gray value of each pixel, finally, to after adjustment can processing target image
Carry out binary conversion treatment, obtain can processing target image first edge figure in the horizontal direction, it is exemplary, Fig. 2-2 be the present invention
The first edge schematic diagram that embodiment two provides.
Correspondingly, terminal can using can be in processing target image each pixel as can the corresponding square of processing target image
Battle array in each element, the gray value of each pixel is the value of each element, then, for can processing target image it is corresponding
Each element in matrix calculates the element and 8 pixels is corresponding with the minor matrix that vertical edge operator indicates around it
The product of position element obtains the new gray value of the corresponding pixel of the element, with such then by the addition of obtained product
It pushes away, can be in processing target image after the new gray value of each pixel calculating, it can be every in processing target image
The gray value of a pixel is set as the corresponding new gray value of each pixel, finally, to after adjustment can processing target image into
Row binary conversion treatment, obtain can processing target image second edge figure in the horizontal direction, exemplary, Fig. 2-3 is that the present invention is real
The second edge schematic diagram of the offer of example two is provided.
Specifically, the binary conversion treatment is exactly that the gray value of each pixel in the gray level image is set as 0 or 255, make
Whole image shows apparent black and white effect, can should specifically, be less than the pixel of default gray threshold for gray value
The gray value of pixel is set as 0, and the pixel of default gray threshold is not less than for gray value, can set the gray value of the pixel
255 are set to, which can be selected according to actual conditions, exemplary, which can be 60,
The default gray threshold may be 80, and the embodiment of the present invention is not construed as limiting this.
The binary image obtained after binary conversion treatment remains able to reflection image entirety and local feature.Further
Ground, since the gray value of pixel in the image after binary conversion treatment only has 0 or 255, the rank of grey scale pixel value is few, therefore number
According to processing and decrement it is small, and then handled again after target image is converted to binary image, processing can be made to grasp
Make simpler.
Step 203 determines the divisible quantity of the target image in the horizontal direction based on the first edge figure, obtains
To the first dividing number, the divisible quantity of the target image in vertical direction is determined based on the first edge figure, is obtained
To the second dividing number.
Specifically, terminal can realize determining first edge figure in level by following sub-steps (1)~sub-step (5)
Divisible quantity on direction, obtains the first dividing number:
Sub-step (1):The quantity for calculating object pixel row in the first edge figure, obtains the first quantity.
In this step, object pixel row can indicate that the number for the object pixel for including is more than the first predetermined number threshold value
Pixel column, the object pixel indicate that gray value is equal to the pixel of default gray value, which can be 255.Specifically,
Terminal can count the number of pixels that gray value included in each pixel column in first edge figure is equal to default gray value, so
That included gray value is more than the pixel column of the first predetermined number threshold value equal to the number of pixels of default gray value is calculated afterwards
Number, obtains the first quantity.Wherein, which can be the pixel included by pixel column in target image
What number determined, when the number of pixels included by the pixel column in target image is more, default of larger first can be set
The first smaller predetermined number threshold can be arranged when the number of pixels included by the pixel column in target image is less in number threshold values
Value.
Sub-step (2):If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that institute
It is 0 to state the first dividing number.
In this step, the first predetermined threshold value is more than the second predetermined threshold value, further, in actual application scenarios, picture mosaic
There can be the more moderate part of edge strength in the content of image, if gray value included in image is equal to default gray scale
When the number of pixels of value is excessive, it may be considered that the edge strength in the content of the image is too strong, if included by image
When gray value is very few equal to the number of pixels of default gray value, it may be considered that the edge strength in the content of the image is excessively weak,
At this time it is considered that the image is not picture mosaic image, that is, the image can not be split.
Correspondingly, in the embodiment of the present invention, if the first quantity is more than the first predetermined threshold value, it may be considered that first edge figure
Edge it is too strong, that is, the edge of target image horizontal direction is too strong;If the first quantity is less than the second predetermined threshold value, can recognize
Edge for first edge figure is excessively weak, that is, the edge of target image horizontal direction is excessively weak, and target image does not have in the horizontal direction
The position that can divide, hence, it can be determined that the first dividing number of target image in the horizontal direction is 0.
Sub-step (3):If first quantity is no more than first predetermined threshold value and is not less than the described second default threshold
Value, then calculate the distance between each object pixel row, obtain multiple first distances.
It is exemplary, it is assumed that object pixel row includes a rows, b rows, c rows, e rows and f rows, then terminal can
With calculate a rows at a distance from b rows, a rows at a distance from c rows, a rows are at a distance from e rows, a rows and f rows
Distance, b rows at a distance from c rows, b rows at a distance from e rows, b rows are at a distance from f rows, c rows and e rows
Distance, c rows are at a distance from f rows and e rows are at a distance from f rows, obtain 10 the first distances.
Sub-step (4):By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if institute
The frequency of occurrences for stating first object distance is less than predeterminated frequency threshold value, it is determined that first dividing number is 0.
In this step, which can be set according to actual demand, and the embodiment of the present invention does not limit this
It is fixed.It is exemplary, it is assumed that predeterminated frequency threshold value is 3, the frequency of occurrences 2 of first object distance, due to the appearance of first object distance
Frequency is less than predeterminated frequency threshold value, then terminal can determine that the first dividing number is 0.Assuming that predeterminated frequency threshold value is 3, first
The frequency of occurrences of target range is 3, since the frequency of occurrences of first object distance is not less than predeterminated frequency threshold value, then terminal can
To determine the first dividing number not for 0.
Sub-step (5):If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, described first
When the corresponding distance value of target range is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object
When being not less than pre-determined distance threshold value apart from corresponding distance value, the frequency of occurrences of the first object distance is determined as described the
One dividing number.
In this step, which can be set according to actual demand, and the embodiment of the present invention does not limit this
It is fixed.It is exemplary, it is assumed that pre-determined distance threshold value be 3 centimetres of cm, first object apart from corresponding distance value be 5cm, first object away from
From the frequency of occurrences be 3, due to first object apart from corresponding distance value be not less than pre-determined distance threshold value, then terminal can be true
Fixed first dividing number is 3.
Specifically, terminal can realize that determining second edge figure is hanging down by following sub-steps (6)~sub-step (10)
The upward divisible quantity of histogram, obtains the second dividing number:
Sub-step (6):The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity.
In this step, object pixel row can indicate that the number for the object pixel for including is more than the second predetermined number threshold value
Pixel column, the object pixel indicate that gray value is equal to the pixel of default gray value, which can be 255.Specifically,
Terminal can count the number of pixels that gray value included in each pixel column in second edge figure is equal to default gray value, so
That included gray value is more than the pixel column of the second predetermined number threshold value equal to the number of pixels of default gray value is calculated afterwards
Number, obtains the second quantity.Wherein, which can be the pixel included by pixel column in target image
What number determined, when the number of pixels included by the pixel column in target image is more, default of larger second can be set
The second smaller predetermined number threshold can be arranged when the number of pixels included by the pixel column in target image is less in number threshold values
Value.
Sub-step (7):If second quantity is more than first predetermined threshold value, or, it is less than second predetermined threshold value,
Then determine that second dividing number is 0.
There can be the more moderate part of edge strength in actual application scenarios, in the content of picture mosaic image, if figure
When included gray value is excessive equal to the number of pixels of default gray value as in, it may be considered that the side in the content of the image
Edge intensity is too strong, if gray value included in image is very few equal to the number of pixels of default gray value, it may be considered that
Edge strength in the content of the image is excessively weak, at this time it is considered that the image is not picture mosaic image, that is, the image can not carry out
Segmentation.
Correspondingly, in the embodiment of the present invention, if the second quantity is more than the first predetermined threshold value, it may be considered that second edge figure
Edge it is too strong, that is, the edge of target image vertical direction is too strong;If the second quantity is less than the second predetermined threshold value, can recognize
Edge for second edge figure is excessively weak, that is, the edge of target image vertical direction is excessively weak, and target image does not have in vertical direction
The position that can divide, hence, it can be determined that the second dividing number of target image in vertical direction is 0.
Sub-step (8):If second quantity is no more than first predetermined threshold value and is not less than the described second default threshold
Value then calculates each object pixel row and adjacent the distance between object pixel row, obtains multiple second distances.
It is exemplary, it is assumed that object pixel row include h row, the i-th row, the i-th row, kth row and the 1st row, then terminal can
With calculate h row with i-th row at a distance from, h row with jth row at a distance from, h row with kth row at a distance from, h arrange and the 1st arrange
Distance, i-th row with jth row at a distance from, i-th row with kth row at a distance from, i-th row with the 1st row at a distance from, jth arrange and kth arrange
Distance, jth row are at a distance from the 1st row and kth row are at a distance from the 1st row, obtain 10 second distances.
Sub-step (9):Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if institute
The frequency of occurrences for stating the second target range is less than predeterminated frequency threshold value, it is determined that second dividing number is 0.
In this step, which can be set according to actual demand, and the embodiment of the present invention does not limit this
It is fixed.It is exemplary, it is assumed that predeterminated frequency threshold value is 3, the frequency of occurrences 2 of the second target range, due to the appearance of the second target range
Frequency is less than predeterminated frequency threshold value, then terminal can determine that the second dividing number is 0.Assuming that predeterminated frequency threshold value is 3, second
The frequency of occurrences of target range is 4, since the frequency of occurrences of the second target range is not less than predeterminated frequency threshold value, then terminal can
To determine the second dividing number not for 0.
Sub-step (10):If the frequency of occurrences of second target range is not less than the predeterminated frequency threshold value, in institute
When stating the corresponding distance value of the second target range less than the pre-determined distance threshold value, determine that second dividing number is 0, in institute
When stating the corresponding distance value of the second target range not less than the pre-determined distance threshold value, by the appearance frequency of second target range
Rate is determined as second dividing number.
In this step, which can be set according to actual demand, and the embodiment of the present invention does not limit this
It is fixed.It is exemplary, it is assumed that pre-determined distance threshold value be 3 centimetres of cm, the corresponding distance value of the second target range be 8cm, the second target away from
From the frequency of occurrences be 4, due to the corresponding distance value of the second target range be not less than pre-determined distance threshold value, then terminal can be true
Fixed second dividing number is 4.
Step 204 is based on first dividing number and second dividing number, whether determines the target image
For picture mosaic image.
If specifically, first dividing number and second dividing number are zero, it is determined that the target figure
As not being picture mosaic image.If first dividing number and second dividing number are not zero there are at least one, for example,
First dividing number is not 0, alternatively, the second dividing number is not 0, alternatively, the first dividing number and the second dividing number are equal
It is not 0, then can determines that target image is picture mosaic image.
If step 205, the target image are picture mosaic image, the target image is split, the mesh is obtained
At least two target subgraphs that logo image includes.
Specifically, terminal can divide target image to realize by following sub-steps (11)~sub-step (13)
It cuts, obtains at least two target subgraphs that target image includes:
Sub-step (11):If first dividing number and second dividing number are not zero, based on described
Object pixel row and object pixel row, are split the target image, obtain multiple target subgraphs.
In this step, terminal can carry out horizontal direction first along object pixel row corresponding row in the target image
Segmentation arranges corresponding row in the target image then along object pixel, the segmentation of vertical direction is carried out, finally, after segmentation
Obtained each subgraph, is determined as target subgraph.Certainly, in practical application, when being split, can also be first along
Object pixel arranges corresponding row in the target image, the segmentation of vertical direction is carried out, then along object pixel row in target figure
The corresponding row as in, carries out the segmentation of horizontal direction, the embodiment of the present invention is not construed as limiting this.Exemplary, Fig. 2-4 is the present invention
A kind of fractionation schematic diagram that embodiment two provides, as can be seen that " artwork " is represented from " split result " shown in Fig. 2-4
Target image be split as 9 target subgraphs.Sub-step (12):If first dividing number is not zero, described second
Dividing number is zero, then is split to the target image based on the object pixel row, obtains multiple second subgraphs;Base
Target subgraph is determined in the multiple second subgraph.
In this step, when the first dividing number is not 0, it is believed that target image is divisible in the horizontal direction, this
When, terminal can carry out the segmentation of horizontal direction, by target image first along object pixel row corresponding row in the target image
Multiple second subgraphs are divided into, due to that in practical application, there may be irregular picture mosaic, that is, there is only parts second
Subgraph is divisible in vertical direction, therefore, in order to ensure picture mosaic segmentation accuracy, terminal can by following procedure,
Each second subgraph is handled, to determine final target subgraph:
Firstly, for each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third
Edge graph.
Specifically, determine that the realization process of third edge graph can refer to above-mentioned steps 202, the embodiment of the present invention is herein not
It repeats.
It is then possible to be based on the third edge graph, judge second subgraph in vertical direction with the presence or absence of can
Split position.
Specifically, the realization process of this step can refer to the process that above-mentioned sub-step (6)~sub-step (10) is shown, this
This will not be repeated here for inventive embodiments.
Finally, if there are divisible position, the divisible position based on second subgraph in vertical direction is right
Second subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph, if there is no divisible
Second subgraph is then determined as target subgraph by position.
It is exemplary, Fig. 2-5 be it is provided by Embodiment 2 of the present invention it is another split schematic diagram, " tear open shown in Fig. 2-5
As can be seen that the target image represented by " artwork " is split as 6 target subgraphs in point result ".
Sub-step (13):If second dividing number is not zero, first dividing number is zero, then is based on the mesh
Mark pixel column is split the target image, obtains multiple third subgraphs;It is determined based on the multiple third subgraph
Target subgraph.
In this step, when the second dividing number is not 0, it is believed that target image is divisible in vertical direction, this
When, terminal first can arrange corresponding row in the target image along object pixel, the segmentation of vertical direction be carried out, by target image
Multiple third subgraphs are divided into, due to that in practical application, there may be irregular picture mosaic, that is, there is only part thirds
Subgraph is divisible in the horizontal direction, therefore, in order to ensure picture mosaic segmentation accuracy, terminal can by following procedure,
Each third subgraph is handled, to determine final target subgraph:
Firstly, for each third subgraph, the edge graph of the third subgraph in the horizontal direction is determined, obtain
Four edge graphs.
Specifically, determining that the realization process of the 4th edge graph can refer to above-mentioned steps 202, the embodiment of the present invention is herein not
It repeats.
Then, it is based on the 4th edge graph, it is divisible to judge that the third subgraph whether there is in the horizontal direction
Position.
Specifically, the realization process of this step can refer to the process that above-mentioned sub-step (1)~sub-step (5) is shown, this
This will not be repeated here for inventive embodiments.
Finally, if there are divisible position, the divisible position based on the third subgraph in the horizontal direction is right
The third subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph, if there is no divisible
The third subgraph is then determined as target subgraph by position.
It should be noted that in order to further improve the accuracy rate that picture mosaic image is split, in the another optional of the present invention
In embodiment, terminal can also continue to each target subgraph execute judge the target subgraph whether be picture mosaic image behaviour
Make, if the target subgraph is picture mosaic image, target subgraph is continued to divide, until dividing obtained every height
When image is not picture mosaic image, then based on each classification divided obtained subgraph and determine target image.
Step 206 respectively classifies to every target subgraph, and the classification results based on every target subgraph are true
The classification of the fixed target image.
Exemplary, for judging whether target image is pornographic image, terminal can collect a large amount of normogram in advance
Then picture and pornographic image manually mark out the classification of each sample image, that is, marking out the sample image is as sample
Normal picture or pornographic image, then, by these sample images and and each sample image mark classification, be input to
Model is carried out in the deep learning frame that caffe increases income to instruct again, other deep learnings of increasing income can also be used certainly, in practical application
Frame is trained, and the embodiment of the present invention is not construed as limiting this.
Specifically in training, feedforward BP neural network algorithm may be used, i.e., it is preceding to be exported in layer to when transmitting, if
The result that output layer obtains has difference then to carry out back transfer with desired value, updates it with gradient descent method according to its error
Weight and threshold values, repeated several times, until error function reaches global minimum, end training obtains pornographic image classification mould
Type.
In classification, every target subgraph can be input in the pornographic image disaggregated model, according to same mould
Type structure and trained parameter are successively handled every target subgraph, for example, convolution, pond, etc., until
The confidence level probability that every target subgraph corresponds to two classifications (normal picture classification, pornographic image) is finally obtained, it finally, will
The corresponding classification of maximum confidence probability is determined as the classification of target image.
Certainly, in another alternative embodiment of the present invention, two can also be corresponded to acquiring every target subgraph
After the confidence level probability of classification, maximum confidence probability in the corresponding two confidence level probability of each target subgraph is corresponded to
Classification, be determined as the classification of the target subgraph, finally, when the classification of all target subgraphs is normal picture, really
The image that sets the goal is normal picture, when the classification of at least one target subgraph is pornographic image, determines that target image is color
Feelings image.Further, in order to improve the accuracy rate of judgement, terminal can also to target subgraph that classification is pornographic image into
Rower is noted, in order to manually be checked.
In conclusion image processing method provided by Embodiment 2 of the present invention, first can determine target image in the horizontal direction
First edge figure and second edge figure in vertical direction, be then based on first edge figure and second edge figure determine mesh
The first dividing number and the second dividing number of logo image, are then based on the first dividing number and the second dividing number judges
Whether target image is picture mosaic image, then can be split to target image when target image is picture mosaic image, obtain mesh
At least two target subgraphs that logo image includes finally respectively classify to every target subgraph, and are based on every mesh
The classification results of mark subgraph determine that the classification of target image reduces the interior of target image in this way, by splitting target image
Hold complexity, the accuracy rate of judgement can be improved to avoid due to the complicated caused erroneous judgement of picture material.
Embodiment three
Fig. 3 is a kind of block diagram for image processing apparatus that the embodiment of the present invention three provides, as shown in figure 3, the device 30 can
To include:
Judgment module 301, for judging whether target image is picture mosaic image.
Divide module 302, if being picture mosaic image for the target image, the target image is split, is obtained
Take at least two target subgraphs that the target image includes.
Sort module 303, for classifying respectively to every target subgraph, and based on point of every target subgraph
Class result determines the classification of the target image.
In conclusion the image processing apparatus that the embodiment of the present invention three provides, judgment module can first judge that target image is
No is picture mosaic image, and then, segmentation module can be split target image, obtain mesh when target image is picture mosaic image
At least two target subgraphs that logo image includes, finally, sort module can respectively classify to every target subgraph, and
The classification of target image is determined based on the classification results of every target subgraph, in this way, by splitting target image, reduces mesh
The content complexity of logo image can improve the accuracy rate of judgement to avoid due to the complicated caused erroneous judgement of picture material.
Example IV
Fig. 4 is a kind of block diagram for image processing apparatus that the embodiment of the present invention four provides, as shown in figure 4, the device 40 can
To include:
Judgment module 401, for judging whether target image is picture mosaic image.
Divide module 402, if being picture mosaic image for the target image, the target image is split, is obtained
Take at least two target subgraphs that the target image includes.
Sort module 403, for classifying respectively to every target subgraph, and based on point of every target subgraph
Class result determines the classification of the target image.
Optionally, above-mentioned judgment module 401, including:
Transform subblock 4011, for the target image to be converted to gray level image, obtaining can processing target image.
First determination sub-module 4012 can processing target image described in determination for being based on preset horizontal edge operator
First edge figure in the horizontal direction, and, be based on preset vertical edge operator, determine described in can processing target image hang down
Histogram to second edge figure.
Second determination sub-module 4013, for determining the target image in the horizontal direction based on the first edge figure
Divisible quantity, obtain the first dividing number, the target image determined in vertical direction based on the first edge figure
Divisible quantity, obtain the second dividing number.
Third determination sub-module 4014 is determined for being based on first dividing number and second dividing number
Whether the target image is picture mosaic image.
Optionally, above-mentioned second determination sub-module 4013, is used for:
The quantity for calculating object pixel row in the first edge figure, obtains the first quantity;The object pixel row indicates
Including the number of object pixel be more than the pixel column of the first predetermined number threshold value, it is pre- that the object pixel indicates that gray value is equal to
If the pixel of gray value.
If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that first segmentation
Quantity is 0.
If first quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, calculate every
The distance between a object pixel row obtains multiple first distances.
By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if the first object
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that first dividing number is 0.
If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, in the first object apart from right
When the distance value answered is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object apart from corresponding
When distance value is not less than pre-determined distance threshold value, the frequency of occurrences of the first object distance is determined as the first segmentation number
Amount.
Optionally, above-mentioned second determination sub-module 4013, is used for, including:
The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity;The object pixel
Row indicate that the number for the object pixel for including is more than the pixel column of the second predetermined number threshold value, and the object pixel indicates gray value
Equal to the pixel of default gray value.
If second quantity is more than first predetermined threshold value, or, being less than second predetermined threshold value, it is determined that described
Second dividing number is 0.
If second quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, calculate every
The distance between a object pixel row, obtain multiple second distances.
Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if second target
The frequency of occurrences of distance is less than predeterminated frequency threshold value, it is determined that second dividing number is 0.
If the frequency of occurrences of second target range be not less than the predeterminated frequency threshold value, second target away from
From corresponding distance value be less than the pre-determined distance threshold value when, determine second dividing number be 0, second target away from
When being not less than the pre-determined distance threshold value from corresponding distance value, the frequency of occurrences of second target range is determined as described
Second dividing number.
Optionally, above-mentioned third determination sub-module 4014, is used for:
If first dividing number and second dividing number are zero, it is determined that the target image is not to spell
Figure image.
If first dividing number and second dividing number are not zero there are at least one, it is determined that the mesh
Logo image is picture mosaic image.
Optionally, above-mentioned segmentation module 402, including:
First segmentation submodule, if being not zero for first dividing number and second dividing number,
It is arranged based on the object pixel row and the object pixel, the target image is split, multiple target subgraphs are obtained
Picture.
Second segmentation submodule, if being not zero for first dividing number, second dividing number is zero, then base
The target image is split in the object pixel row, obtains multiple second subgraphs;4th determination sub-module, is used for
Target subgraph is determined based on the multiple second subgraph.
Third divides submodule, if being not zero for second dividing number, first dividing number is zero, then base
It is arranged in the object pixel and the target image is split, obtain multiple third subgraphs;5th determination sub-module, is used for
Target subgraph is determined based on the multiple third subgraph.
Optionally, above-mentioned 4th determination sub-module, is used for:
For each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third edge
Figure.
Based on the third edge graph, judge that second subgraph whether there is divisible position in vertical direction.
If there are divisible position, the divisible position based on second subgraph in vertical direction, to described
Second subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph.
If divisible position is not present, second subgraph is determined as target subgraph.
Optionally, above-mentioned 5th determination sub-module, is used for:
For each third subgraph, determines the edge graph of the third subgraph in the horizontal direction, obtain the 4th side
Edge figure.
Based on the 4th edge graph, judge that the third subgraph whether there is divisible position in the horizontal direction.
If there are divisible position, the divisible position based on the third subgraph in the horizontal direction, to described
Third subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph.
If divisible position is not present, the third subgraph is determined as target subgraph.
In conclusion the image processing apparatus that the embodiment of the present invention four provides, the first determination sub-module can first determine target
Image first edge figure in the horizontal direction and the second edge figure in vertical direction, then the second determination sub-module can be based on
First edge figure and second edge figure determine the first dividing number and the second dividing number of target image, and then third is true
Stator modules can be based on the first dividing number and the second dividing number judges whether target image is picture mosaic image, then divide
Module can be split target image when target image is picture mosaic image, obtain at least two mesh that target image includes
Subgraph is marked, finally, sort module can respectively classify to every target subgraph, and based on point of every target subgraph
Class result determines the classification of target image, in this way, by splitting target image, reduces the content complexity of target image, can
To avoid due to the complicated caused erroneous judgement of picture material, the accuracy rate of judgement is improved.
For above-mentioned apparatus embodiment, since it is basically similar to the method embodiment, so description is fairly simple,
The relevent part can refer to the partial explaination of embodiments of method.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiment, the same or similar parts between the embodiments can be referred to each other.
It would have readily occurred to a person skilled in the art that be:The arbitrary combination application of above-mentioned each embodiment is all feasible, therefore
Arbitrary combination between above-mentioned each embodiment is all embodiment of the present invention, but this specification exists as space is limited,
This is not just detailed one by one.
Provided herein image processing method not with the intrinsic phase of any certain computer, virtual system or miscellaneous equipment
It closes.Various general-purpose systems can also be used together with teaching based on this.As described above, construction has present invention side
Structure required by the system of case is obvious.In addition, the present invention is not also directed to any certain programmed language.It should be bright
In vain, various programming languages can be utilized to realize the content of invention described herein, and is retouched above to what language-specific was done
State is to disclose the preferred forms of the present invention.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the present invention and help to understand one or more of each inventive aspect,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, such as right
As claim reflects, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows tool
Thus claims of body embodiment are expressly incorporated in the specific implementation mode, wherein each claim conduct itself
The separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment
Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of arbitrary
It mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors
Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) come realize in image processing method according to the ... of the embodiment of the present invention some or
The some or all functions of person's whole component.The present invention is also implemented as one for executing method as described herein
Divide either whole equipment or program of device (for example, computer program and computer program product).Such this hair of realization
Bright program can may be stored on the computer-readable medium, or can be with the form of one or more signal.It is such
Signal can be downloaded from internet website and be obtained, and either provided on carrier signal or provided in any other forms.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch
To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame
Claim.
Claims (14)
1. a kind of image processing method, which is characterized in that it is applied to terminal, the method includes:
Judge whether target image is picture mosaic image;
If the target image is picture mosaic image, the target image is split, obtaining the target image includes
At least two target subgraphs;
Classify respectively to every target subgraph, and the target figure is determined based on the classification results of every target subgraph
The classification of picture.
2. according to the method described in claim 1, it is characterized in that, it is described judge target image whether be picture mosaic image step
Suddenly, including:
The target image is converted into gray level image, obtaining can processing target image;
Based on preset horizontal edge operator, determine described in can processing target image first edge figure in the horizontal direction, and,
Based on preset vertical edge operator, determine described in can processing target image vertical direction second edge figure;
The divisible quantity of the target image in the horizontal direction is determined based on the first edge figure, obtains the first segmentation number
Amount, determines the divisible quantity of the target image in vertical direction based on the second edge figure, obtains the second segmentation number
Amount;
Based on first dividing number and second dividing number, determine whether the target image is picture mosaic image.
3. according to the method described in claim 2, it is characterized in that, described determine the target figure based on the first edge figure
As divisible quantity in the horizontal direction, the step of obtaining the first dividing number, including:
The quantity for calculating object pixel row in the first edge figure, obtains the first quantity;The object pixel row indicates
The number of object pixel be more than the pixel column of the first predetermined number threshold value, the object pixel indicates that gray value is equal to default ash
The pixel of angle value;
If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that first dividing number
It is 0;
If first quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, each mesh is calculated
The distance between pixel column is marked, multiple first distances are obtained;
By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if the first object distance
The frequency of occurrences be less than predeterminated frequency threshold value, it is determined that first dividing number be 0;
If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, in the first object apart from corresponding
When distance value is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object apart from corresponding distance
When value is not less than pre-determined distance threshold value, the frequency of occurrences of the first object distance is determined as first dividing number.
4. according to the method described in claim 3, it is characterized in that, described based on the determining mesh described in the second edge figure
The divisible quantity of logo image in vertical direction, the step of obtaining the second dividing number, including:
The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity;The object pixel list
Show that the number for the object pixel for including is more than the pixel column of the second predetermined number threshold value, the object pixel indicates that gray value is equal to
The pixel of default gray value;
If second quantity is more than first predetermined threshold value, or, being less than second predetermined threshold value, it is determined that described second
Dividing number is 0;
If second quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, each mesh is calculated
The distance between pixel column is marked, multiple second distances are obtained;
Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if second target range
The frequency of occurrences be less than predeterminated frequency threshold value, it is determined that second dividing number be 0;
If the frequency of occurrences of second target range is not less than the predeterminated frequency threshold value, in second target range pair
When the distance value answered is less than the pre-determined distance threshold value, determine that second dividing number is 0, in second target range pair
When the distance value answered is not less than the pre-determined distance threshold value, the frequency of occurrences of second target range is determined as described second
Dividing number.
5. if according to the method described in claim 2, it is characterized in that, the target image is picture mosaic image, to institute
The step of stating target image to be split, obtaining at least two target subgraphs that the target image includes, including:
If first dividing number and second dividing number are not zero, it is based on the object pixel row and institute
Object pixel row are stated, the target image is split, multiple target subgraphs are obtained;
If first dividing number is not zero, second dividing number is zero, then is based on the object pixel row to described
Target image is split, and obtains multiple second subgraphs;Target subgraph is determined based on the multiple second subgraph;
If second dividing number is not zero, first dividing number is zero, then is arranged to described based on the object pixel
Target image is split, and obtains multiple third subgraphs;Target subgraph is determined based on the multiple third subgraph.
6. according to the method described in claim 5, it is characterized in that, described determine target based on the multiple second subgraph
The step of image, including:
For each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third edge graph;
Based on the third edge graph, judge that second subgraph whether there is divisible position in vertical direction;
If there are divisible position, the divisible position based on second subgraph in vertical direction, to described second
Subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, second subgraph is determined as target subgraph.
7. according to the method described in claim 5, it is characterized in that, described determine target based on the multiple third subgraph
The step of image, including:
For each third subgraph, determines the edge graph of the third subgraph in the horizontal direction, obtain the 4th edge graph;
Based on the 4th edge graph, judge that the third subgraph whether there is divisible position in the horizontal direction;
If there are divisible position, the divisible position based on the third subgraph in the horizontal direction, to the third
Subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, the third subgraph is determined as target subgraph.
8. a kind of image processing apparatus, which is characterized in that be applied to terminal, described device includes:
Judgment module, for judging whether target image is picture mosaic image;
Divide module, if being picture mosaic image for the target image, the target image is split, the mesh is obtained
At least two target subgraphs that logo image includes;
Sort module, for classifying respectively to every target subgraph, and based on the classification results of every target subgraph
Determine the classification of the target image.
9. device according to claim 8, which is characterized in that the judgment module, including:
Transform subblock, for the target image to be converted to gray level image, obtaining can processing target image;
First determination sub-module, for be based on preset horizontal edge operator, determine described in can processing target image in level side
To first edge figure, and, be based on preset vertical edge operator, determine described in can processing target image in vertical direction
Second edge figure;
Second determination sub-module, for determining the target image in the horizontal direction divisible based on the first edge figure
Quantity obtains the first dividing number, and the target image in vertical direction divisible is determined based on the first edge figure
Quantity obtains the second dividing number;
Third determination sub-module determines the target for being based on first dividing number and second dividing number
Whether image is picture mosaic image.
10. device according to claim 9, which is characterized in that second determination sub-module is used for:
The quantity for calculating object pixel row in the first edge figure, obtains the first quantity;The object pixel row indicates
The number of object pixel be more than the pixel column of the first predetermined number threshold value, the object pixel indicates that gray value is equal to default ash
The pixel of angle value;
If first quantity is more than the first predetermined threshold value, or, being less than the second predetermined threshold value, it is determined that first dividing number
It is 0;
If first quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, each mesh is calculated
The distance between pixel column is marked, multiple first distances are obtained;
By corresponding value maximum and highest first distance of the frequency of occurrences is as first object distance, if the first object distance
The frequency of occurrences be less than predeterminated frequency threshold value, it is determined that first dividing number be 0;
If the frequency of occurrences of the first object distance is not less than predeterminated frequency threshold value, in the first object apart from corresponding
When distance value is less than pre-determined distance threshold value, determine that first dividing number is 0, in the first object apart from corresponding distance
When value is not less than pre-determined distance threshold value, the frequency of occurrences of the first object distance is determined as first dividing number.
11. device according to claim 9, which is characterized in that second determination sub-module is used for:
The quantity for calculating the object pixel row for including in the second edge figure, obtains the second quantity;The object pixel list
Show that the number for the object pixel for including is more than the pixel column of the second predetermined number threshold value, the object pixel indicates that gray value is equal to
The pixel of default gray value;
If second quantity is more than first predetermined threshold value, or, being less than second predetermined threshold value, it is determined that described second
Dividing number is 0;
If second quantity is no more than first predetermined threshold value and is not less than second predetermined threshold value, each mesh is calculated
The distance between pixel column is marked, multiple second distances are obtained;
Using corresponding value maximum and the highest second distance of the frequency of occurrences is as the second target range, if second target range
The frequency of occurrences be less than predeterminated frequency threshold value, it is determined that second dividing number be 0;
If the frequency of occurrences of second target range is not less than the predeterminated frequency threshold value, in second target range pair
When the distance value answered is less than the pre-determined distance threshold value, determine that second dividing number is 0, in second target range pair
When the distance value answered is not less than the pre-determined distance threshold value, the frequency of occurrences of second target range is determined as described second
Dividing number.
12. device according to claim 9, which is characterized in that the segmentation module, including:
First segmentation submodule is based on if being not zero for first dividing number and second dividing number
The object pixel row and object pixel row, are split the target image, obtain multiple target subgraphs;
Second segmentation submodule, if being not zero for first dividing number, second dividing number is zero, then is based on institute
It states object pixel row to be split the target image, obtains multiple second subgraphs;4th determination sub-module, for being based on
The multiple second subgraph determines target subgraph;
Third divides submodule, if being not zero for second dividing number, first dividing number is zero, then is based on institute
It states object pixel and arranges and the target image is split, obtain multiple third subgraphs;5th determination sub-module, for being based on
The multiple third subgraph determines target subgraph.
13. device according to claim 12, which is characterized in that the 4th determination sub-module is used for:
For each second subgraph, determine that second subgraph in the edge graph of vertical direction, obtains third edge graph;
Based on the third edge graph, judge that second subgraph whether there is divisible position in vertical direction;
If there are divisible position, the divisible position based on second subgraph in vertical direction, to described second
Subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, second subgraph is determined as target subgraph.
14. device according to claim 12, which is characterized in that the 5th determination sub-module is used for:
For each third subgraph, determines the edge graph of the third subgraph in the horizontal direction, obtain the 4th edge graph;
Based on the 4th edge graph, judge that the third subgraph whether there is divisible position in the horizontal direction;
If there are divisible position, the divisible position based on the third subgraph in the horizontal direction, to the third
Subgraph is split, and the subgraph obtained after segmentation is determined as target subgraph;
If divisible position is not present, the third subgraph is determined as target subgraph.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810538373.2A CN108805190B (en) | 2018-05-30 | 2018-05-30 | Image processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810538373.2A CN108805190B (en) | 2018-05-30 | 2018-05-30 | Image processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108805190A true CN108805190A (en) | 2018-11-13 |
CN108805190B CN108805190B (en) | 2021-06-22 |
Family
ID=64089405
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810538373.2A Active CN108805190B (en) | 2018-05-30 | 2018-05-30 | Image processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108805190B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109558904A (en) * | 2018-11-21 | 2019-04-02 | 咪咕文化科技有限公司 | Image local feature classification method and device and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103377376A (en) * | 2012-04-13 | 2013-10-30 | 阿里巴巴集团控股有限公司 | Method and system for image classification, and method and system for image retrieval |
CN104504649A (en) * | 2014-12-30 | 2015-04-08 | 百度在线网络技术(北京)有限公司 | Picture cutting method and device |
KR101582779B1 (en) * | 2015-07-17 | 2016-01-06 | 중앙대학교 산학협력단 | Wavelength-adaptive dehazing device and method for image |
CN106503740A (en) * | 2016-10-31 | 2017-03-15 | 北京奇艺世纪科技有限公司 | Picture classification method and device |
CN106504261A (en) * | 2016-10-31 | 2017-03-15 | 北京奇艺世纪科技有限公司 | A kind of image partition method and device |
CN107330889A (en) * | 2017-07-11 | 2017-11-07 | 北京工业大学 | A kind of traditional Chinese medical science tongue color coating colour automatic analysis method based on convolutional neural networks |
CN107516312A (en) * | 2017-08-14 | 2017-12-26 | 北京工业大学 | A kind of Chinese medicine complexion automatic classification method using shallow-layer neutral net |
-
2018
- 2018-05-30 CN CN201810538373.2A patent/CN108805190B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103377376A (en) * | 2012-04-13 | 2013-10-30 | 阿里巴巴集团控股有限公司 | Method and system for image classification, and method and system for image retrieval |
CN104504649A (en) * | 2014-12-30 | 2015-04-08 | 百度在线网络技术(北京)有限公司 | Picture cutting method and device |
KR101582779B1 (en) * | 2015-07-17 | 2016-01-06 | 중앙대학교 산학협력단 | Wavelength-adaptive dehazing device and method for image |
CN106503740A (en) * | 2016-10-31 | 2017-03-15 | 北京奇艺世纪科技有限公司 | Picture classification method and device |
CN106504261A (en) * | 2016-10-31 | 2017-03-15 | 北京奇艺世纪科技有限公司 | A kind of image partition method and device |
CN107330889A (en) * | 2017-07-11 | 2017-11-07 | 北京工业大学 | A kind of traditional Chinese medical science tongue color coating colour automatic analysis method based on convolutional neural networks |
CN107516312A (en) * | 2017-08-14 | 2017-12-26 | 北京工业大学 | A kind of Chinese medicine complexion automatic classification method using shallow-layer neutral net |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109558904A (en) * | 2018-11-21 | 2019-04-02 | 咪咕文化科技有限公司 | Image local feature classification method and device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108805190B (en) | 2021-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108764243A (en) | A kind of image processing method and device | |
US10445557B2 (en) | Learning pixel visual context from object characteristics to generate rich semantic images | |
CN110008680B (en) | Verification code generation system and method based on countermeasure sample | |
CN105849274B (en) | Method and system for classification and identification of individual cells in microscopic images | |
CN108229575A (en) | For detecting the method and apparatus of target | |
CN109035260A (en) | A kind of sky areas dividing method, device and convolutional neural networks | |
Qu et al. | A pedestrian detection method based on yolov3 model and image enhanced by retinex | |
CN110781976B (en) | Extension method of training image, training method and related device | |
CN109472193A (en) | Method for detecting human face and device | |
CN113392702B (en) | Target identification method based on self-adaptive image enhancement under weak illumination environment | |
CN105405130A (en) | Cluster-based license image highlight detection method and device | |
CN113420871B (en) | Image quality evaluation method, image quality evaluation device, storage medium, and electronic device | |
CN111881706B (en) | Living body detection, image classification and model training method, device, equipment and medium | |
CN111079744B (en) | Intelligent vehicle license plate identification method and device suitable for complex illumination environment | |
CN111104976B (en) | Blue algae coverage calculating method based on time sequence images | |
CN108805190A (en) | A kind of image processing method and device | |
CN106997590A (en) | A kind of image procossing and detecting system based on detection product performance | |
CN114187515A (en) | Image segmentation method and image segmentation device | |
CN114049478A (en) | Infrared ship image rapid identification method and system based on improved Cascade R-CNN | |
CN117877069A (en) | Termite identification method based on ResNet neural network | |
KR102421289B1 (en) | Learning method and learning device for image-based detection of visibility according to parallel decision voting algorithm and testing method and testing device using the same | |
CN115457614B (en) | Image quality evaluation method, model training method and device | |
CN108182426A (en) | Coloured image sorting technique and device | |
CN114611863A (en) | E-commerce product packaging quality detection method based on big data | |
Widyaningsih et al. | Optimization Contrast Enhancement and Noise Reduction for Semantic Segmentation of Oil Palm Aerial Imagery. |
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 |