CN107423752B - Method and device for detecting excessive size of picture and detection server - Google Patents

Method and device for detecting excessive size of picture and detection server Download PDF

Info

Publication number
CN107423752B
CN107423752B CN201710440381.9A CN201710440381A CN107423752B CN 107423752 B CN107423752 B CN 107423752B CN 201710440381 A CN201710440381 A CN 201710440381A CN 107423752 B CN107423752 B CN 107423752B
Authority
CN
China
Prior art keywords
picture
coordinate point
detected
straight line
obtaining
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.)
Active
Application number
CN201710440381.9A
Other languages
Chinese (zh)
Other versions
CN107423752A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201710440381.9A priority Critical patent/CN107423752B/en
Publication of CN107423752A publication Critical patent/CN107423752A/en
Application granted granted Critical
Publication of CN107423752B publication Critical patent/CN107423752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/24765Rule-based classification
    • 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

Abstract

The invention discloses a method and a device for detecting the excessive size of a picture and a detection server. The method for detecting the size standard exceeding of the picture comprises the following steps: obtaining a picture to be detected; calculating to obtain the pixel value and the size value of the picture to be detected; obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value; comparing the size value of the picture to be detected with the upper limit value of the picture size; and when the size value of the picture to be detected is larger than the upper limit value of the size of the picture, generating corresponding overproof notification information. By adopting the invention, the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard can be improved.

Description

Method and device for detecting excessive size of picture and detection server
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for detecting the excessive size of a picture and a detection server.
Background
The FAB (FAB rule), namely Feature, advance and Benefit, means that when products are introduced in sequence according to the attributes of the products, the advantages of the products and the benefits of the products in the product promotion process, a complete and complete promotion persuasion can be formed, and the best promotion effect is more likely to be achieved. The FAB web page, which is a product promotion web page established based on FAB rules, is used to attract users to register in the website. Since the FAB web Page is typically the first Page of a website or the guide Page (Landing Page) of a registration/login interface, there are typically a large number of users accessing it. For web pages such as FAB web pages that a large number of users visit, the speed of loading and opening the web pages in the user side directly affects PV (Page View, i.e. Page View amount or click amount) and UV (Unique viewer, i.e. number of independent visitors, i.e. clients visiting the web site) of the web site, thereby affecting the user click registration rate of the web site and further affecting the bid placing effect of the web site. Therefore, how to increase the loading and opening speed of web pages (especially FAB web pages) is an important part of website operation.
It will be appreciated that the loading and opening speed of a web page is related to the size of the web page in addition to the bandwidth of the transport network. Under the condition of a certain network bandwidth, the larger the size of the webpage is, the longer the time required for loading and opening the webpage is. In contrast, in the case of a certain network bandwidth, the smaller the size of the web page, the shorter the time required for loading and opening. Since most web pages contain a large number of pictures, and the size of the pictures is a main component of the size of the web pages, the size of the pictures in the web pages directly affects the loading and opening speed of the web pages, and further affects the use experience of users. Therefore, how to detect whether the size of the picture in the web page is too large so as to process the too large picture in the web page becomes one of important work contents of developers and testers.
In the prior art, a method for detecting whether the size of a picture in a webpage exceeds a standard is mainly performed in a manual detection mode, and the specific process is as follows:
1) opening a debugger of the browser, and inputting a webpage address of a webpage needing to be detected;
2) clicking a Network option in a debugger;
3) viewing data related to pictures in the Img item, such as picture Size (Size) and picture loading Time (Time), and if the value of the picture Size or the picture loading Time is too large, considering that the Size of the pictures in the webpage may be too large;
4) if the size of the picture in the webpage is judged to be possibly too large, copying a picture link address in the webpage, and opening the picture link address in a new tab page of the browser;
5) after the picture link address is opened to obtain a corresponding picture, the pixel and the size of the picture are checked, and whether the size of the picture exceeds the standard or not is judged by virtue of working experience, for example, if the pixel of the picture is 60 x 60, the size of the picture is about 10K under a general condition, and if the actual size of the picture is 1M, the size of the picture can be considered to exceed the standard.
It can be seen that the existing method for detecting whether the size of the picture in the webpage exceeds the standard depends on the manual operation, the working experience and the subjective judgment of developers or testers, so that the labor cost is high, the efficiency is low, and omission and errors are easily caused.
Disclosure of Invention
The embodiment of the invention provides a method and a device for detecting the excessive size of a picture and a detection server, which can improve the efficiency, accuracy and accuracy of detecting whether the size of the picture exceeds the standard.
The method for detecting the size standard exceeding of the picture provided by the embodiment of the invention specifically comprises the following steps:
obtaining a picture to be detected;
calculating to obtain the pixel value and the size value of the picture to be detected;
obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value;
comparing the size value of the picture to be detected with the upper limit value of the picture size;
and when the size value of the picture to be detected is larger than the upper limit value of the size of the picture, generating corresponding overproof notification information.
Further, before obtaining, according to the pre-obtained picture standard value set and the pixel value of the picture to be detected, a picture size upper limit value corresponding to the pixel value of the picture to be detected, the method further includes:
obtaining at least two training pictures;
calculating to obtain a pixel value and a size value of each training picture;
and training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
Further, the training to obtain the picture standard value set according to the pixel value and the size value of each training picture specifically includes:
generating coordinate points corresponding to the training pictures respectively according to the pixel values and the size values of the training pictures; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
clustering all the coordinate points to obtain at least one coordinate point set;
calculating to obtain a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set;
and obtaining the set of picture standard values according to all the fitted straight lines.
Further, all the coordinate point sets are arranged according to a preset arrangement sequence;
the calculating, according to each coordinate point in each coordinate point set, a fitting straight line of each coordinate point set includes:
judging whether the current coordinate point set is a first coordinate point set or not;
if so, connecting any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
obtaining a fitted straight line of the current coordinate point set according to each first reference straight line;
if not, respectively connecting a coordinate point which is closest to the current coordinate point set in a fitting straight line of a coordinate point set before the current coordinate point set with each coordinate point in the current coordinate point set to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
Further, the obtaining a fitted straight line of the current coordinate point set according to each of the first reference straight lines specifically includes:
judging whether the total number of all the first reference straight lines is an odd number;
if so, setting the first reference straight line with the slope of the median in all the first reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two first reference straight lines with the slopes of the first reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
Further, the obtaining a fitted straight line of the current coordinate point set according to each second reference straight line specifically includes:
judging whether the total number of all the second reference straight lines is an odd number;
if so, setting a second reference straight line with the slope of a median in all the second reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two second reference straight lines with the slopes of the second reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
Further, the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected;
and obtaining the picture to be detected according to the picture link address.
Further, the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
obtaining a corresponding format style according to the format style link address;
analyzing the format style to obtain a picture link address in the format style;
and obtaining the picture to be detected according to the picture connection address.
Further, after obtaining the picture to be detected, before obtaining the picture size upper limit value corresponding to the pixel value of the picture to be detected according to the pre-obtained picture standard value set and the pixel value of the picture to be detected, the method further includes:
identifying the format type of the picture to be detected;
and acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
Correspondingly, the embodiment of the invention also provides a device for detecting the excessive size of the picture, which specifically comprises the following steps:
the image acquisition module is used for acquiring an image to be detected;
the image parameter acquisition module is used for calculating and acquiring the pixel value and the size value of the image to be detected;
the picture size upper limit value obtaining module is used for obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value;
the picture size exceeding detection module is used for comparing the size value of the picture to be detected with the picture size upper limit value; and the number of the first and second groups,
and the overproof notification information generation module is used for generating corresponding overproof notification information when the size value of the picture to be detected is larger than the upper limit value of the size of the picture.
Further, the apparatus for detecting the excessive size of the picture further comprises:
the training picture obtaining module is used for obtaining at least two training pictures;
the training picture parameter obtaining module is used for calculating and obtaining the pixel value and the size value of each training picture; and the number of the first and second groups,
and the picture standard value set training obtaining module is used for training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
Further, the module for training and obtaining the picture standard value set specifically includes:
the training picture coordinate point generating submodule is used for generating coordinate points corresponding to each training picture according to the pixel value and the size value of each training picture; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
a coordinate point clustering submodule, configured to cluster all the coordinate points to obtain at least one coordinate point set;
the coordinate point set fitting straight line calculation submodule is used for calculating and obtaining a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set; and the number of the first and second groups,
and the picture standard value set obtaining submodule is used for obtaining the picture standard value set according to all the fitted straight lines.
Further, all the coordinate point sets are arranged according to a preset arrangement sequence;
the coordinate point set fitting straight line calculation submodule specifically includes:
the current coordinate point set judging unit is used for judging whether the current coordinate point set is a first coordinate point set or not; and the number of the first and second groups,
a first reference straight line obtaining unit, configured to, when the current coordinate point set is a first coordinate point set, connect any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
a first set fitting straight line obtaining unit, configured to obtain a fitting straight line of the current coordinate point set according to each first reference straight line; alternatively, the first and second electrodes may be,
a second reference straight line obtaining unit, configured to, when the current coordinate point set is not the first coordinate point set, respectively connect a coordinate point, which is closest to the current coordinate point set, in a fitting straight line of a previous coordinate point set of the current coordinate point set with each coordinate point in the current coordinate point set, to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and the non-initial set fitting straight line obtaining unit is used for obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
Further, the first set fitting straight line obtaining unit specifically includes:
a first reference straight line total number judging subunit, configured to judge whether the total number of all the first reference straight lines is an odd number; and the number of the first and second groups,
a first initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a first reference straight line having a slope with a median in all the first reference straight lines when a total number of all the first reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two first reference straight lines, of which the slope magnitudes are located at intermediate positions, in all the first reference straight lines, when the total number of all the first reference straight lines is not an odd number.
Further, the non-initial set fitting straight line obtaining unit specifically includes:
a second reference straight line total number judging subunit, configured to judge whether the total number of all the second reference straight lines is an odd number; and the number of the first and second groups,
a first non-initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a second reference straight line having a slope with a median among all the second reference straight lines, when a total number of all the second reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second non-initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two second reference straight lines, of which the slope magnitudes are at intermediate positions, in all the second reference straight lines, when the total number of all the second reference straight lines is not an odd number.
Further, the module for obtaining the picture to be detected specifically includes:
the first webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the first picture link address obtaining unit is used for analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected; and the number of the first and second groups,
and the first picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture link address.
Further, the module for obtaining the picture to be detected specifically includes:
the second webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the format style link address obtaining unit is used for analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
the format style obtaining unit is used for obtaining a corresponding format style according to the format style link address;
the second picture link address obtaining unit is used for analyzing the format style to obtain a picture link address in the format style; and the number of the first and second groups,
and the second picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture connection address.
Further, the apparatus for detecting the excessive size of the picture further comprises:
the picture format type identification module is used for identifying the format type of the picture to be detected; and the number of the first and second groups,
and the picture standard value set acquisition module is used for acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
The embodiment of the invention also provides a detection server, which comprises at least one memory and at least one processor;
the memory including at least one executable program stored therein;
the executable program, when executed by the processor, causes the processor to implement the above-described method of picture over-size detection.
The embodiment of the invention has the following beneficial effects:
according to the method and the device for detecting the excessive size of the picture and the detection server, the standard value set of the picture is obtained in advance, and the size of the picture to be detected is judged according to the standard value set of the picture, so that whether the size of the picture exceeds the standard or not is automatically detected, the intervention of human factors in the detection process can be reduced or even avoided, and the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard or not can be improved.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a method for detecting an over-size of a picture according to the present invention;
fig. 2 is a schematic diagram of a set of 5 coordinate points obtained after clustering in a preferred embodiment of the method for detecting excessive size of a picture according to the present invention;
FIG. 3 is a schematic structural diagram of an embodiment of an apparatus for detecting an over-standard size of a picture according to the present invention;
fig. 4 is a schematic structural diagram of a preferred embodiment of the detection server provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention compares the size value of the picture to be detected with the picture size upper limit value in the picture standard value set obtained in advance, and judges whether the size value of the picture to be detected is larger than the picture size upper limit value, thereby judging whether the size of the picture to be detected exceeds the standard. The picture standard value set can be obtained by training a training picture similar to the picture to be detected. The invention can automatically judge whether the size of the picture to be detected exceeds the standard value according to the pre-obtained picture standard value set, and avoids the intervention of artificial factors in the judging process, thereby improving the efficiency, accuracy and accuracy of detecting whether the size of the picture exceeds the standard value.
It should be noted that the pixel value of a picture refers to the number of pixels in the picture. The size value of a picture refers to the size of the capacity space occupied by the picture when the picture is stored in a storage device such as a memory, an external memory, or a flash memory. For example, a picture has a pixel value of 1024 × 512 and a size value of 215 KB.
As shown in fig. 1, a schematic flowchart of a preferred embodiment of a method for detecting an over-size of a picture according to the present invention includes steps S101 to S105, which are as follows:
s101: obtaining a picture to be detected;
s102: calculating to obtain the pixel value and the size value of the picture to be detected;
s103: obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value;
s104: comparing the size value of the picture to be detected with the upper limit value of the picture size;
s105: and when the size value of the picture to be detected is larger than the upper limit value of the size of the picture, generating corresponding overproof notification information.
It should be noted that the embodiment of the present invention is used for detecting whether the size of the picture exceeds the standard. Before detecting whether the size of the picture to be detected exceeds the standard, firstly, a picture standard value set corresponding to the picture to be detected needs to be obtained. The picture standard value set comprises one or more picture pixel values and corresponding picture size upper limit values. And when the pixel value of the picture to be detected is equal to a certain picture pixel value in the picture standard value set, the size value of the picture to be detected is not larger than the picture size upper limit value corresponding to the picture pixel value, otherwise, the size of the picture to be detected exceeds the standard. Specifically, after obtaining a picture to be detected, the system calculates a pixel value and a size value of the picture to be detected, compares the pixel value of the picture to be detected with each picture pixel value in a picture standard value set, and judges whether the pixel value of the picture to be detected is equal to each picture pixel value in the picture standard value set, so that a picture pixel value equal to the pixel value of the picture to be detected is obtained from the picture standard value set, and further obtains a picture size upper limit value corresponding to the picture pixel value. After obtaining the picture size upper limit value corresponding to the pixel value of the picture to be detected, the system judges whether the picture size upper limit value of the picture to be detected is larger than the picture size upper limit value or not, if so, the size of the picture to be detected is considered to be out of standard, so that corresponding exceeding notification information is generated, and the exceeding notification information is sent to corresponding processing personnel, so that the processing personnel can correspondingly process the picture to be detected with the exceeding size; if not, the size of the picture to be detected is considered to meet the standard, and therefore the picture to be detected is not processed.
According to the embodiment of the invention, the picture standard value set is obtained in advance, and the size of the picture to be detected is judged according to the picture standard value set, so that whether the size of the picture exceeds the standard or not is automatically detected, and therefore, the intervention of human factors in the detection process can be reduced or even avoided, and the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard or not can be improved.
Further, the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected;
and obtaining the picture to be detected according to the picture link address.
More preferably, the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
obtaining a corresponding format style according to the format style link address;
analyzing the format style to obtain a picture link address in the format style;
and obtaining the picture to be detected according to the picture connection address.
It should be noted that the embodiment of the present invention can be applied to detect whether the size of the picture in the web page exceeds the standard. Specifically, the system can crawl the web pages needing detection by adopting a crawler technology. After a webpage to be detected is obtained by crawling, analyzing a source code of the webpage to be detected, extracting and obtaining a picture link address in the webpage to be detected, and downloading a picture pointed by the picture link address to a local folder according to the obtained picture link address so as to obtain the picture to be detected in the webpage to be detected.
Because a large number of pictures in the web page are referred by a format Style (usually CSS, i.e., Cascading Style Sheets), when the system parses the source code of the web page to be detected after crawling the web page to be detected, the system can also extract and obtain the format Style link address therein at the same time, and obtain the corresponding format Style according to the format Style link address. And then, the system further analyzes the obtained source code of the format style so as to extract and obtain the picture link address, and downloads the picture pointed by the picture link address to a local corresponding folder according to the picture link address so as to obtain the picture to be detected in the webpage to be detected.
It should be further noted that, in some specific embodiments, the system may extract and obtain the picture link address and/or the format style connection link address by parsing the source code of the web page by using a regular expression. Similarly, the system can also extract and obtain the picture link address by parsing the format source code by using a regular expression.
According to the embodiment of the invention, the webpage to be detected can be crawled by adopting a crawler technology, the source code of the crawled webpage to be detected is analyzed by adopting the regular expression, and the picture link address of the picture to be detected is obtained, so that all pictures quoted by the webpage to be detected can be comprehensively obtained, and the comprehensiveness and the accuracy of detecting whether the size of the picture in the webpage exceeds the standard can be improved.
In another more preferred embodiment, on the basis of the foregoing embodiment, after obtaining the picture to be detected, before obtaining, according to the pre-obtained set of picture standard values and the pixel value of the picture to be detected, the method further includes:
identifying the format type of the picture to be detected;
and acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
It should be noted that there are many format types of the existing pictures, for example, png, gif, jpg, etc. are all the existing commonly used format types of the pictures. Due to the fact that the compression ratios of the pictures in different formats are different, the pictures need to be classified, that is, different picture standard value sets need to be adopted to detect the pictures to be detected in different formats. Specifically, before detecting whether the size of a picture to be detected exceeds the standard, generating and obtaining a corresponding picture standard value set aiming at different picture format types in advance; after the system obtains the picture to be detected, the format type of the picture to be detected is identified, so that a corresponding picture standard value set is obtained according to the format type of the picture to be detected, and whether the size of the picture to be detected exceeds the standard value set is detected according to the obtained picture standard value set.
In some specific embodiments, when the number of the pictures to be detected is multiple, a folder corresponding to each picture format type may be created locally in advance, and the pictures to be detected identified by the picture format types may be temporarily stored in the corresponding folder. After the identification of the picture format types of all the pictures to be detected is completed, for each folder, the judgment and detection of whether the sizes of all the pictures to be detected in the folder exceed the standard value set of the corresponding pictures can be carried out.
The embodiment of the invention sets the corresponding picture standard value set for each picture format type, adopts different picture standard value sets to detect whether the picture size exceeds the standard according to the different format types of the picture to be detected, and considers the difference of the characteristics of the pictures with different format types, thereby further improving the accuracy and precision of detecting whether the picture size exceeds the standard.
In a further more preferred embodiment, on the basis of the above embodiment, before obtaining, according to a set of picture standard values obtained in advance and a pixel value of the picture to be detected, a picture size upper limit value corresponding to the pixel value of the picture to be detected, the method further includes:
obtaining at least two training pictures;
calculating to obtain a pixel value and a size value of each training picture;
and training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
Further, the training to obtain the picture standard value set according to the pixel value and the size value of each training picture specifically includes:
generating coordinate points corresponding to the training pictures respectively according to the pixel values and the size values of the training pictures; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
clustering all the coordinate points to obtain at least one coordinate point set;
calculating to obtain a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set;
and obtaining the set of picture standard values according to all the fitted straight lines.
Further, all the coordinate point sets are arranged according to a preset arrangement sequence;
the calculating, according to each coordinate point in each coordinate point set, a fitting straight line of each coordinate point set includes:
judging whether the current coordinate point set is a first coordinate point set or not;
if so, connecting any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
obtaining a fitted straight line of the current coordinate point set according to each first reference straight line;
if not, respectively connecting a coordinate point which is closest to the current coordinate point set in a fitting straight line of a coordinate point set before the current coordinate point set with each coordinate point in the current coordinate point set to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
It should be noted that, before detecting whether the size of the picture to be detected exceeds the standard, a corresponding picture standard value set serving as a detection judgment standard needs to be generated. The picture standard value set can be obtained by training a plurality of training pictures. When the picture to be detected is a picture in a webpage, the acquired training picture is a picture in the webpage similar to the type of the webpage to be detected, for example, when the webpage to be detected is a webpage of the game industry, the acquired training picture can be a picture in a webpage of websites such as Tencent game official website, network game official website and the like. The training pictures can be obtained by crawling from the web page by adopting a crawler technology and the like.
After the system obtains a plurality of training pictures, the pixel values and the size values of the training pictures are calculated and obtained, the pixel values of the training pictures are used as the abscissa of the coordinate point, the size values of the training pictures are used as the ordinate of the coordinate point, and a plurality of coordinate points corresponding to the training pictures are obtained.
Subsequently, the system clusters the obtained coordinate points by using a K-means algorithm (K-average algorithm, a hard clustering algorithm), so as to obtain one or more coordinate point sets (i.e. clusters) by calculation. In some more preferred embodiments, the number of sets of coordinate points obtained is 5. As shown in fig. 2, the schematic diagram of 5 coordinate point sets obtained after clustering calculation includes a coordinate point set a, a coordinate point set B, a coordinate point set C, a coordinate point set D, and a coordinate point set E. When there is an overlap between adjacent coordinate point sets, for example, when it is assumed that there is an overlap between coordinate point set a and coordinate point set B, section boundary end point Z between coordinate line set a and coordinate point set B may be determined according to the following steps 1) to 7)A
1) Obtaining the maximum abscissa MAX among the coordinate points in the coordinate point set AAAnd the minimum abscissa MIN of coordinate points in the set B of coordinate pointsB
2) Let ZX=MINB
3) At MAXAAnd MINBBetween which a vertical line x ═ Z is constructedX
4) Calculating that the abscissa in the coordinate point set A is greater than ZXNumber of coordinate points SUMAAnd the abscissa in the set of coordinate points B is smaller than ZXNumber of coordinate points SUMB
5) Let TX=SUMA+SUMB
6) Judgment of TXAnd TX+1A size of between, if TX>TX+1Then let ZA=ZX+1;
7) Let ZX=ZX+1 and repeating the above steps 3) to 6) until ZX=MAXA
After one or more coordinate point sets are obtained through calculation, the system calculates a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set. Specifically, after sequentially arranging the obtained coordinate point sets in a certain arrangement order (generally, the abscissa magnitude order of each coordinate point set), a fitting straight line of the first coordinate point set is first calculated according to the following steps S01 to S07:
s01: creating a first set of reference straight lines;
s02: judging whether the first coordinate point set contains residual unprocessed coordinate points, if so, jumping to S03, and if not, jumping to S07;
s03: connecting any two coordinate points in the first coordinate point set to obtain a straight line a;
s04: judging whether the slope k of the straight line a is greater than 0, if so, jumping to S05, and if not, jumping to S02;
s05: judging whether the ratio of the number of coordinate points below the straight line a in the first coordinate point set to the number of all coordinate points in the whole first coordinate point set is larger than a preset threshold value p1, if so, jumping to S06, and if not, jumping to S02;
s06: adding the straight line a to the first reference straight line set;
s07: and calculating to obtain a fitting straight line of the first coordinate point set according to each first reference straight line in the first reference straight line set.
Subsequently, the system calculates the fitted straight line of each remaining set of coordinate points in turn according to the following steps S08 to S14:
s08: creating a second set of reference straight lines and setting a last coordinate point in a fitted straight line of a previous set of coordinate points of the current set of coordinate points (or a coordinate point in the fitted straight line that is closest to the current set of coordinate points) as a reference coordinate point;
s09: judging whether the current coordinate point set has residual unprocessed coordinate points, if so, jumping to S10, and if not, jumping to S14;
s10: connecting the reference coordinate point with any one coordinate point in the current coordinate point set to obtain a straight line b;
s11: judging whether the slope k of the straight line b is greater than 0, if so, jumping to S12, and if not, jumping to S09;
s12: judging whether the ratio of the number of coordinate points below the straight line b in the current coordinate point set to the number of all coordinate points in the whole current coordinate point set is larger than a preset threshold value p2, if so, jumping to S13, and if not, jumping to S09;
s13: adding the straight line b to the second reference straight line set;
s14: and calculating to obtain a fitting straight line of the current coordinate point set according to each second reference straight line in the second reference straight line set.
The threshold value p1 and the threshold value p2 may have the same value or different values. In some more preferred embodiments, the threshold p1 and the threshold p2 both have values of 95%.
After the fitted straight lines of each coordinate point set are obtained through calculation, a piecewise function F (x) consisting of the fitted straight lines can be obtained, the abscissa of each coordinate point in the piecewise function F (x) is used as a picture pixel value, and the corresponding ordinate is used as a picture size upper limit value, so that the corresponding picture standard value set can be obtained.
And when judging whether the size of the picture to be detected exceeds the standard, taking the pixel value of the picture to be detected as the abscissa of the coordinate point and the size value of the picture to be detected as the ordinate of the coordinate point to obtain the coordinate point corresponding to the picture to be detected, and judging whether the coordinate point is positioned above the piecewise function F (x) or not, namely judging whether the size of the picture to be detected exceeds the standard or not. When the coordinate point is located above the piecewise function f (x), that is, when the size of the picture to be detected exceeds the standard, corresponding exceeding notification information (which may include information such as a connection address of a webpage where the picture to be detected is located, a picture link address, a source, and an identification code) is generated, and corresponding processing personnel is notified in an email or short message manner, so that the processing personnel performs corresponding processing on the picture to be detected whose size exceeds the standard.
It should be further noted that the manner of calculating the reference straight line of each coordinate point set is not limited to the above manner, and in some specific embodiments, for all coordinate point sets, the respective reference straight lines may be calculated and obtained in the manner of steps S01 to S07, or in the manner of steps S08 to S14 (the reference coordinate point at this time may be preset and is not limited to be the last coordinate point in the fitted straight line of the previous coordinate point set of the current coordinate point set or the closest coordinate point in the fitted straight line of the previous coordinate point set to the current coordinate point set) to obtain the respective reference straight lines.
Further, the obtaining a fitted straight line of the current coordinate point set according to each of the first reference straight lines specifically includes:
judging whether the total number of all the first reference straight lines is an odd number;
if so, setting the first reference straight line with the slope of the median in all the first reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two first reference straight lines with the slopes of the first reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
Further, the obtaining a fitted straight line of the current coordinate point set according to each second reference straight line specifically includes:
judging whether the total number of all the second reference straight lines is an odd number;
if so, setting a second reference straight line with the slope of a median in all the second reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two second reference straight lines with the slopes of the second reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
It should be noted that, after calculating one or more reference straight lines of the current coordinate point set (including the first coordinate point set), the system determines whether the total number of the reference straight lines is an odd number, if so, sets a reference straight line with a slope of a median in the reference straight lines as a fitting straight line of the current coordinate point set, and if not, sets any one of two straight lines with a slope of a median in the reference straight lines as a fitting straight line of the current coordinate point set.
For example, assuming that the number of reference straight lines of the current coordinate point set is 5 and the slopes thereof are 2, 5, 7, 9, and 10, respectively, the reference straight line in which the slope is 7 is set as the fitting straight line of the current coordinate point set.
For another example, assuming that the number of reference straight lines of the current coordinate point set is 4 and the slopes thereof are 3, 4, 6, and 10, respectively, the reference straight line of which the slope is 4 is set as the fitting straight line of the current coordinate point set, or the reference straight line of which the slope is 6 is set as the fitting straight line of the current coordinate point set.
It should be further noted that the manner of determining the corresponding fitting straight line according to the reference straight lines of the current coordinate point set is not limited to the above manner, and in some specific embodiments, the corresponding fitting straight line may also be determined by calculating an average value of slopes of all reference straight lines of the current coordinate point set.
According to the method for detecting the excessive size of the picture, the standard value set of the picture is obtained in advance, and the size of the picture to be detected is judged according to the standard value set of the picture, so that whether the size of the picture exceeds the standard or not is automatically detected, the intervention of artificial factors in the detection process can be reduced or even avoided, and the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard or not can be improved. In some embodiments, the web page to be detected can be crawled by adopting a crawler technology, the source code of the crawled web page to be detected is analyzed by adopting a regular expression, and the picture link address of the picture to be detected is obtained, so that all pictures quoted by the web page to be detected can be comprehensively obtained, and the comprehensiveness and the accuracy of detecting whether the size of the picture in the web page exceeds the standard can be improved. In addition, the corresponding picture standard value set is set for each picture format type, different picture standard value sets are adopted to detect whether the picture size exceeds the standard according to the different format types of the picture to be detected, and the difference of the characteristics of the pictures with different format types is considered, so that the accuracy and the precision of detecting whether the picture size exceeds the standard can be further improved.
Correspondingly, the invention also provides a device for detecting the excessive size of the picture, which can realize all the processes of the method for detecting the excessive size of the picture in the embodiment.
As shown in fig. 3, a schematic structural diagram of a preferred embodiment of the apparatus for detecting an excessive picture size provided by the present invention is as follows:
a to-be-detected picture obtaining module 301, configured to obtain a to-be-detected picture;
a to-be-detected picture parameter obtaining module 302, configured to calculate and obtain a pixel value and a size value of the to-be-detected picture;
a picture size upper limit value obtaining module 303, configured to obtain, according to a pre-obtained picture standard value set and a pixel value of the picture to be detected, a picture size upper limit value corresponding to the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value;
a picture size exceeding detection module 304, configured to compare the size value of the picture to be detected with the picture size upper limit value; and the number of the first and second groups,
the superstandard notification information generating module 305 is configured to generate corresponding superstandard notification information when the size value of the to-be-detected picture is greater than the upper limit value of the size of the picture.
Further, the module for obtaining the picture to be detected specifically includes:
the first webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the first picture link address obtaining unit is used for analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected; and the number of the first and second groups,
and the first picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture link address.
More preferably, the to-be-detected picture obtaining module specifically includes:
the second webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the format style link address obtaining unit is used for analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
the format style obtaining unit is used for obtaining a corresponding format style according to the format style link address;
the second picture link address obtaining unit is used for analyzing the format style to obtain a picture link address in the format style; and the number of the first and second groups,
and the second picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture connection address.
In another more preferred embodiment, based on the above embodiment, the apparatus for detecting the over-size of the picture further includes:
the picture format type identification module is used for identifying the format type of the picture to be detected; and the number of the first and second groups,
and the picture standard value set acquisition module is used for acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
In a further preferred embodiment, based on the above embodiment, the apparatus for detecting the over-size of the picture further includes:
the training picture obtaining module is used for obtaining at least two training pictures;
the training picture parameter obtaining module is used for calculating and obtaining the pixel value and the size value of each training picture; and the number of the first and second groups,
and the picture standard value set training obtaining module is used for training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
Further, the module for training and obtaining the picture standard value set specifically includes:
the training picture coordinate point generating submodule is used for generating coordinate points corresponding to each training picture according to the pixel value and the size value of each training picture; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
a coordinate point clustering submodule, configured to cluster all the coordinate points to obtain at least one coordinate point set;
the coordinate point set fitting straight line calculation submodule is used for calculating and obtaining a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set; and the number of the first and second groups,
and the picture standard value set obtaining submodule is used for obtaining the picture standard value set according to all the fitted straight lines.
Further, all the coordinate point sets are arranged according to a preset arrangement sequence;
the coordinate point set fitting straight line calculation submodule specifically includes:
the current coordinate point set judging unit is used for judging whether the current coordinate point set is a first coordinate point set or not; and the number of the first and second groups,
a first reference straight line obtaining unit, configured to, when the current coordinate point set is a first coordinate point set, connect any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
a first set fitting straight line obtaining unit, configured to obtain a fitting straight line of the current coordinate point set according to each first reference straight line; alternatively, the first and second electrodes may be,
a second reference straight line obtaining unit, configured to, when the current coordinate point set is not the first coordinate point set, respectively connect a coordinate point, which is closest to the current coordinate point set, in a fitting straight line of a previous coordinate point set of the current coordinate point set with each coordinate point in the current coordinate point set, to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and the non-initial set fitting straight line obtaining unit is used for obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
Further, the first set fitting straight line obtaining unit specifically includes:
a first reference straight line total number judging subunit, configured to judge whether the total number of all the first reference straight lines is an odd number; and the number of the first and second groups,
a first initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a first reference straight line having a slope with a median in all the first reference straight lines when a total number of all the first reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two first reference straight lines, of which the slope magnitudes are located at intermediate positions, in all the first reference straight lines, when the total number of all the first reference straight lines is not an odd number.
Further, the non-initial set fitting straight line obtaining unit specifically includes:
a second reference straight line total number judging subunit, configured to judge whether the total number of all the second reference straight lines is an odd number; and the number of the first and second groups,
a first non-initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a second reference straight line having a slope with a median among all the second reference straight lines, when a total number of all the second reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second non-initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two second reference straight lines, of which the slope magnitudes are at intermediate positions, in all the second reference straight lines, when the total number of all the second reference straight lines is not an odd number.
According to the picture size exceeding detection device provided by the embodiment of the invention, the picture standard value set is obtained in advance, and the size of the picture to be detected is judged according to the picture standard value set, so that the automatic detection of whether the size of the picture exceeds the standard is realized, the intervention of artificial factors in the detection process can be reduced or even avoided, and the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard can be improved. In some embodiments, the web page to be detected can be crawled by adopting a crawler technology, the source code of the crawled web page to be detected is analyzed by adopting a regular expression, and the picture link address of the picture to be detected is obtained, so that all pictures quoted by the web page to be detected can be comprehensively obtained, and the comprehensiveness and the accuracy of detecting whether the size of the picture in the web page exceeds the standard can be improved. In addition, the corresponding picture standard value set is set for each picture format type, different picture standard value sets are adopted to detect whether the picture size exceeds the standard according to the different format types of the picture to be detected, and the difference of the characteristics of the pictures with different format types is considered, so that the accuracy and the precision of detecting whether the picture size exceeds the standard can be further improved.
The present invention further provides a detection server, as shown in fig. 4, which is a schematic structural diagram of a preferred embodiment of the detection server provided by the present invention, specifically including at least one memory 401 and at least one processor 402;
the memory 401, including at least one executable program stored therein;
the executable program, when executed by the processor 402, causes the processor 402 to implement any of the embodiments of the above-described picture over-size detection method.
It should be noted that fig. 4 only illustrates an example in which one memory in the detection server is connected to one processor, in some specific embodiments, the detection server may further include a plurality of memories and/or a plurality of servers, and the specific number and connection mode thereof may be set and adaptively adjusted according to actual needs.
The detection server provided by the embodiment of the invention can realize the automatic detection of whether the size of the picture exceeds the standard or not by obtaining the picture standard value set in advance and judging the size of the picture to be detected according to the picture standard value set, so that the intervention of human factors in the detection process can be reduced or even avoided, and the efficiency, the accuracy and the accuracy of detecting whether the size of the picture exceeds the standard or not can be improved. In some embodiments, the web page to be detected can be crawled by adopting a crawler technology, the source code of the crawled web page to be detected is analyzed by adopting a regular expression, and the picture link address of the picture to be detected is obtained, so that all pictures quoted by the web page to be detected can be comprehensively obtained, and the comprehensiveness and the accuracy of detecting whether the size of the picture in the web page exceeds the standard can be improved. In addition, the corresponding picture standard value set is set for each picture format type, different picture standard value sets are adopted to detect whether the picture size exceeds the standard according to the different format types of the picture to be detected, and the difference of the characteristics of the pictures with different format types is considered, so that the accuracy and the precision of detecting whether the picture size exceeds the standard can be further improved.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (19)

1. A picture size exceeding detection method is characterized by comprising the following steps:
obtaining a picture to be detected;
calculating to obtain a pixel value and a size value of the picture to be detected, wherein the pixel value of the picture refers to the number of pixel points in the picture;
obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value, and is obtained by training according to the pixel value and the size value of each training picture obtained by calculating at least two training pictures;
comparing the size value of the picture to be detected with the picture size upper limit value corresponding to the pixel value of the picture to be detected;
and when the size value of the picture to be detected is larger than the upper limit value of the size of the picture, generating corresponding overproof notification information.
2. The method according to claim 1, wherein before obtaining the picture size upper limit value corresponding to the pixel value of the picture to be detected according to the pre-obtained picture standard value set and the pixel value of the picture to be detected, the method further comprises:
obtaining at least two training pictures;
calculating to obtain a pixel value and a size value of each training picture;
and training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
3. The method according to claim 2, wherein the obtaining of the set of standard picture values by training according to the pixel values and the size values of each of the training pictures specifically comprises:
generating coordinate points corresponding to the training pictures respectively according to the pixel values and the size values of the training pictures; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
clustering all the coordinate points to obtain at least one coordinate point set;
calculating to obtain a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set;
and obtaining the set of picture standard values according to all the fitted straight lines.
4. The method according to claim 3, wherein all the coordinate point sets are arranged according to a preset arrangement order;
the calculating, according to each coordinate point in each coordinate point set, a fitting straight line of each coordinate point set includes:
judging whether the current coordinate point set is a first coordinate point set or not;
if so, connecting any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
obtaining a fitted straight line of the current coordinate point set according to each first reference straight line;
if not, respectively connecting a coordinate point which is closest to the current coordinate point set in a fitting straight line of a coordinate point set before the current coordinate point set with each coordinate point in the current coordinate point set to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
5. The method according to claim 4, wherein the obtaining a fitted straight line of the current coordinate point set according to each of the first reference straight lines specifically comprises:
judging whether the total number of all the first reference straight lines is an odd number;
if so, setting the first reference straight line with the slope of the median in all the first reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two first reference straight lines with the slopes of the first reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
6. The method according to claim 4, wherein the obtaining a fitted straight line of the current coordinate point set according to each second reference straight line specifically includes:
judging whether the total number of all the second reference straight lines is an odd number;
if so, setting a second reference straight line with the slope of a median in all the second reference straight lines as a fitting straight line of the current coordinate point set;
and if not, setting any one of the two second reference straight lines with the slopes of the second reference straight lines positioned at the middle positions as a fitting straight line of the current coordinate point set.
7. The method according to claim 1, wherein the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected;
and obtaining the picture to be detected according to the picture link address.
8. The method according to claim 1, wherein the obtaining the picture to be detected specifically includes:
acquiring a webpage to be detected;
analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
obtaining a corresponding format style according to the format style link address;
analyzing the format style to obtain a picture link address in the format style;
and obtaining the picture to be detected according to the picture link address.
9. The method according to claim 1, wherein after the obtaining the picture to be detected, before obtaining the picture size upper limit value corresponding to the pixel value of the picture to be detected according to the pre-obtained picture standard value set and the pixel value of the picture to be detected, the method further comprises:
identifying the format type of the picture to be detected;
and acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
10. An apparatus for detecting that a size of a picture exceeds a standard, comprising:
the image acquisition module is used for acquiring an image to be detected;
the image parameter acquisition module is used for calculating and acquiring the pixel value and the size value of the image to be detected, wherein the pixel value of the image refers to the number of pixel points in the image;
the picture size upper limit value obtaining module is used for obtaining a picture size upper limit value corresponding to the pixel value of the picture to be detected according to a picture standard value set obtained in advance and the pixel value of the picture to be detected; the picture standard value set comprises at least one picture pixel value and a picture size upper limit value corresponding to each picture pixel value, and is obtained by training according to the pixel value and the size value of each training picture obtained by calculating at least two training pictures;
the picture size exceeding detection module is used for comparing the size value of the picture to be detected with the picture size upper limit value corresponding to the pixel value of the picture to be detected; and the number of the first and second groups,
and the overproof notification information generation module is used for generating corresponding overproof notification information when the size value of the picture to be detected is larger than the upper limit value of the size of the picture.
11. The apparatus for detecting excessive size of picture according to claim 10, further comprising:
the training picture obtaining module is used for obtaining at least two training pictures;
the training picture parameter obtaining module is used for calculating and obtaining the pixel value and the size value of each training picture; and the number of the first and second groups,
and the picture standard value set training obtaining module is used for training to obtain the picture standard value set according to the pixel value and the size value of each training picture.
12. The apparatus according to claim 11, wherein the module for training and obtaining the standard value set of the picture specifically comprises:
the training picture coordinate point generating submodule is used for generating coordinate points corresponding to each training picture according to the pixel value and the size value of each training picture; the abscissa and the ordinate of each coordinate point are respectively a pixel value and a size value of a corresponding training picture;
a coordinate point clustering submodule, configured to cluster all the coordinate points to obtain at least one coordinate point set;
the coordinate point set fitting straight line calculation submodule is used for calculating and obtaining a fitting straight line of each coordinate point set according to each coordinate point in each coordinate point set; and the number of the first and second groups,
and the picture standard value set obtaining submodule is used for obtaining the picture standard value set according to all the fitted straight lines.
13. The apparatus according to claim 12, wherein all the coordinate point sets are arranged in a preset arrangement order;
the coordinate point set fitting straight line calculation submodule specifically includes:
the current coordinate point set judging unit is used for judging whether the current coordinate point set is a first coordinate point set or not; and the number of the first and second groups,
a first reference straight line obtaining unit, configured to, when the current coordinate point set is a first coordinate point set, connect any two coordinate points in the current coordinate point set to obtain at least one first reference straight line; for each first reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the first reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
a first set fitting straight line obtaining unit, configured to obtain a fitting straight line of the current coordinate point set according to each first reference straight line; alternatively, the first and second electrodes may be,
a second reference straight line obtaining unit, configured to, when the current coordinate point set is not the first coordinate point set, respectively connect a coordinate point, which is closest to the current coordinate point set, in a fitting straight line of a previous coordinate point set of the current coordinate point set with each coordinate point in the current coordinate point set, to obtain at least one second reference straight line; for each second reference straight line, the slope is greater than 0, and the ratio of the number of coordinate points positioned below the second reference straight line in the current coordinate point set to the number of all coordinate points in the current coordinate point set is greater than a preset threshold;
and the non-initial set fitting straight line obtaining unit is used for obtaining a fitting straight line of the current coordinate point set according to each second reference straight line.
14. The apparatus for detecting excessive size of picture according to claim 13, wherein the first set fitting line obtaining unit specifically includes:
a first reference straight line total number judging subunit, configured to judge whether the total number of all the first reference straight lines is an odd number; and the number of the first and second groups,
a first initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a first reference straight line having a slope with a median in all the first reference straight lines when a total number of all the first reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two first reference straight lines, of which the slope magnitudes are located at intermediate positions, in all the first reference straight lines, when the total number of all the first reference straight lines is not an odd number.
15. The apparatus for detecting excessive size of picture according to claim 13, wherein the non-initial set fitting line obtaining unit specifically includes:
a second reference straight line total number judging subunit, configured to judge whether the total number of all the second reference straight lines is an odd number; and the number of the first and second groups,
a first non-initial set fitting straight line determining unit, configured to set, as a fitting straight line of the current coordinate point set, a second reference straight line having a slope with a median among all the second reference straight lines, when a total number of all the second reference straight lines is an odd number; alternatively, the first and second electrodes may be,
and a second non-initial set fitting straight line determining unit, configured to set, as the fitting straight line of the current coordinate point set, any one of two second reference straight lines, of which the slope magnitudes are at intermediate positions, in all the second reference straight lines, when the total number of all the second reference straight lines is not an odd number.
16. The apparatus for detecting excessive size of pictures according to claim 10, wherein the module for obtaining pictures to be detected specifically comprises:
the first webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the first picture link address obtaining unit is used for analyzing the webpage to be detected to obtain a picture link address in the webpage to be detected; and the number of the first and second groups,
and the first picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture link address.
17. The apparatus for detecting excessive size of pictures according to claim 10, wherein the module for obtaining pictures to be detected specifically comprises:
the second webpage to be detected obtaining unit is used for obtaining a webpage to be detected;
the format style link address obtaining unit is used for analyzing the webpage to be detected to obtain a format style link address in the webpage to be detected;
the format style obtaining unit is used for obtaining a corresponding format style according to the format style link address;
the second picture link address obtaining unit is used for analyzing the format style to obtain a picture link address in the format style; and the number of the first and second groups,
and the second picture to be detected obtaining unit is used for obtaining the picture to be detected according to the picture-link address.
18. The apparatus for detecting excessive size of picture according to claim 10, further comprising:
the picture format type identification module is used for identifying the format type of the picture to be detected; and the number of the first and second groups,
and the picture standard value set acquisition module is used for acquiring a corresponding picture standard value set according to the format type of the picture to be detected.
19. A detection server comprising at least one memory and at least one processor;
the memory including at least one executable program stored therein;
the executable program, when executed by the processor, causes the processor to implement a method of over-size detection of a picture as claimed in any one of claims 1 to 9.
CN201710440381.9A 2017-06-12 2017-06-12 Method and device for detecting excessive size of picture and detection server Active CN107423752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710440381.9A CN107423752B (en) 2017-06-12 2017-06-12 Method and device for detecting excessive size of picture and detection server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710440381.9A CN107423752B (en) 2017-06-12 2017-06-12 Method and device for detecting excessive size of picture and detection server

Publications (2)

Publication Number Publication Date
CN107423752A CN107423752A (en) 2017-12-01
CN107423752B true CN107423752B (en) 2021-01-12

Family

ID=60429771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710440381.9A Active CN107423752B (en) 2017-06-12 2017-06-12 Method and device for detecting excessive size of picture and detection server

Country Status (1)

Country Link
CN (1) CN107423752B (en)

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5915359A (en) * 1982-07-16 1984-01-26 Matsushita Graphic Commun Syst Inc Picture contracting method
JP3142279B2 (en) * 1990-03-27 2001-03-07 株式会社リコー Halftone dot area separation device
JPH08329213A (en) * 1995-05-31 1996-12-13 Yazaki Corp Detector and counter for passing object
KR100525785B1 (en) * 2001-06-15 2005-11-03 엘지전자 주식회사 Filtering method for pixel of image
CN101572740B (en) * 2008-04-28 2012-07-18 三星电子株式会社 Method for adjusting picture size in multimedia message
CN101746269B (en) * 2010-01-08 2013-04-03 东南大学 Fatigue driving fusion detection method based on soft computing
CN102457728B (en) * 2010-10-27 2013-12-25 杭州华三通信技术有限公司 Method and device for video image encoding
CN103677939B (en) * 2013-12-25 2018-01-16 广东星辉天拓互动娱乐有限公司 A kind of loading method and device of network game field picture
CN105912611B (en) * 2016-04-05 2019-04-26 中国科学技术大学 A kind of fast image retrieval method based on CNN
CN105912657A (en) * 2016-04-11 2016-08-31 乐视控股(北京)有限公司 Automatic detection and compression method and system of images in application
CN106055575A (en) * 2016-05-19 2016-10-26 天脉聚源(北京)传媒科技有限公司 Method and device for optimized loading of website page
CN106056056B (en) * 2016-05-23 2019-02-22 浙江大学 A kind of non-contacting baggage volume detection system and its method at a distance

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Optimum pixel size for hyperspectral studies of ecosystem function in southern California chaparral and grassland;Abdullah F. Rahman等;《Remote Sensing of Environment 》;20031231;第192–207页 *
通用考生照片批处理系统的设计与实现;白涛等;《计算机与数字工程》;20140731;第42卷(第7期);第1280-1283页 *

Also Published As

Publication number Publication date
CN107423752A (en) 2017-12-01

Similar Documents

Publication Publication Date Title
JP6099793B2 (en) Method and system for automatic selection of one or more image processing algorithms
CN110275958B (en) Website information identification method and device and electronic equipment
EP3335131B1 (en) Systems and methods for automatic content verification
US9355313B2 (en) Detecting and extracting image document components to create flow document
CN108880921B (en) Webpage monitoring method and device, storage medium and server
JP6266656B2 (en) System and method for resizing an image
WO2020019765A1 (en) Depth estimation method and apparatus for binocular image, and device, program and medium
CN110198328B (en) Client identification method and device, computer equipment and storage medium
US11560927B2 (en) Systems and methods for content delivery acceleration of virtual reality and augmented reality web pages
CN110298858B (en) Image clipping method and device
CN109885446A (en) Determine that Website page shows the method and device of state
CN112988557A (en) Search box positioning method, data acquisition device and medium
JP6365024B2 (en) Service providing apparatus, method, and program
CN110969143A (en) Evidence obtaining method and system based on image recognition, computer equipment and storage medium
EP3762873A1 (en) Image extension neural networks
CN111145202B (en) Model generation method, image processing method, device, equipment and storage medium
CN111182332B (en) Video processing method, device, server and storage medium
CN108197638B (en) Method and device for classifying sample to be evaluated
CN106528758B (en) Picture selection method and device
CN107766224B (en) Test method and test device
CN107423752B (en) Method and device for detecting excessive size of picture and detection server
US20130275384A1 (en) System, method, and computer program product for determining whether an electronic mail message is unwanted based on processing images associated with a link in the electronic mail message
CN108804652B (en) Method and device for generating cover picture, storage medium and electronic device
CN109993126B (en) File information determining method, device, equipment and readable storage medium
CN110659347B (en) Associated document determining method, device, computer equipment and storage medium

Legal Events

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