CN111783807A - Picture extraction method and device and computer-readable storage medium - Google Patents

Picture extraction method and device and computer-readable storage medium Download PDF

Info

Publication number
CN111783807A
CN111783807A CN201910349682.XA CN201910349682A CN111783807A CN 111783807 A CN111783807 A CN 111783807A CN 201910349682 A CN201910349682 A CN 201910349682A CN 111783807 A CN111783807 A CN 111783807A
Authority
CN
China
Prior art keywords
picture
image
candidate
candidate picture
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910349682.XA
Other languages
Chinese (zh)
Inventor
莫钟林
安山
周芳汝
车广富
陈宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910349682.XA priority Critical patent/CN111783807A/en
Publication of CN111783807A publication Critical patent/CN111783807A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The disclosure provides a picture extraction method, a picture extraction device and a computer-readable storage medium, and relates to the technical field of image processing. The picture extraction method comprises the following steps: obtaining candidate picture areas in an image through an edge detection algorithm, wherein the image comprises one or more picture areas; determining color characteristic vectors of all candidate picture areas; clustering color feature vectors; and screening out the picture area from the candidate picture area according to the class cluster to which the color feature vector of the candidate picture area belongs. By the method, after the candidate picture region is obtained based on the edge detection, the required picture region can be screened out from the candidate picture region by utilizing the clustering algorithm and the colors of the pictures, so that the interference influence is reduced, and the accuracy of picture extraction is improved.

Description

Picture extraction method and device and computer-readable storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for extracting a picture, and a computer-readable storage medium.
Background
In the article introduction details of a webpage, a long graph is often used, and the long graph comprises a plurality of detail graphs and display graphs. The pictures in the long picture are analyzed, processed and reused respectively, so that the utilization rate of the information in the picture can be effectively improved, and the flexible application of the pictures is improved.
Disclosure of Invention
One object of the present disclosure is to improve the accuracy of picture extraction.
According to an aspect of some embodiments of the present disclosure, there is provided a picture extraction method, including: obtaining candidate picture areas in an image through an edge detection algorithm, wherein the image comprises one or more picture areas; determining color characteristic vectors of all candidate picture areas; clustering color feature vectors; and screening out the picture area from the candidate picture area according to the class cluster to which the color feature vector of the candidate picture area belongs.
In some embodiments, filtering out a picture region from the candidate picture regions comprises: and filtering the candidate picture region according to the number of vectors in a cluster to which the color feature vector of the candidate picture region belongs or the distance between the center of the cluster and a preset cluster center, and determining the picture region.
In some embodiments, determining the color feature vector for each candidate picture region comprises: determining the number of pixels belonging to each predetermined color range for each candidate picture region; the color feature vector is determined according to the number and the order of the attributed predetermined color range in the predetermined feature vector.
In some embodiments, filtering out a picture region from the candidate picture regions comprises: acquiring the number of vectors in a cluster to which color feature vectors of a candidate picture region belong; determining a class cluster with the least vector quantity; and excluding the candidate picture area of the cluster with the least number of vectors to which the color feature vector belongs, and determining the picture area.
In some embodiments, filtering out a picture region from the candidate picture regions comprises: determining the center of each cluster; acquiring the distance between the center of each cluster and a preset cluster center, wherein the preset cluster center is the cluster center of a color feature vector of a prestored picture area; determining a cluster of the class farthest from the predetermined cluster center; and excluding the candidate picture area of which the color feature vector belongs to the cluster farthest from the preset cluster center, and determining the picture area.
In some embodiments, obtaining the candidate picture region in the image by the edge detection algorithm comprises: extracting edge lines through a Canny operator; extracting line segments with the length larger than or equal to a preset length in the edge lines through hough transformation; extracting horizontal and vertical line segments according to the slope of the line segments, and acquiring rectangular areas cut by the line segments; and acquiring a region satisfying a preset size and a preset length-width ratio in the rectangular region as a candidate picture region.
In some embodiments, the Canny operator's parameters for extracting edge lines include at least one of: the upper threshold interval is [195,205], the lower threshold interval is [45,55], or the filter size is 3, 5, or 7.
In some embodiments, extracting the parameters of the line segment having the slope within the predetermined range in the edge line by the hough transform includes at least one of: the distance accuracy is 1 pixel and the angle accuracy is pi/180 radians, or the threshold parameter of the accumulation plane is 100.
In some embodiments, obtaining the candidate picture region in the image by the edge detection algorithm comprises: acquiring derivative information of the image in the horizontal and vertical directions through a Sobel operator; respectively acquiring the number of pixels of which the reciprocal information falls within a preset threshold range in the same row and the same column; cutting the image along a first direction according to the number of pixels falling within a preset threshold range, and acquiring a primary cut image region, wherein the method comprises the following steps: if the number of the pixels falling within the range of the preset threshold is smaller than the threshold of the preset number, determining that the pixel in the second direction to which the current pixel belongs and the previous pixel in the first direction belong to the same picture; if the number of pixels falling within the range of the preset threshold is larger than the threshold of the preset number, determining that a pixel in a second direction to which the current pixel belongs and a previous pixel in a first direction belong to different pictures, wherein the first direction is any one of a horizontal direction or a vertical direction on an image plane, and the second direction is perpendicular to the first direction on the image plane; cutting the primary cut image area along a second direction according to the number of pixels falling within a preset threshold range to obtain a secondary cut image area; and acquiring a region satisfying a preset length-width ratio in the secondary cutting picture region as a candidate picture region.
In some embodiments, the predetermined threshold range is [5,255 ].
In some embodiments, the picture extraction method further comprises: converting the color image into a gray image; and obtaining the candidate picture area in the image by an edge detection algorithm to extract the candidate picture area from the gray level image.
In some embodiments, the picture extraction method further comprises: and generating a rolling display image based on the screened picture area.
By the method, after the candidate picture region is obtained based on the edge detection, the required picture region can be screened out from the candidate picture region by utilizing the clustering algorithm and the colors of the pictures, so that the interference influence is reduced, and the accuracy of picture extraction is improved.
According to an aspect of some other embodiments of the present disclosure, a picture extracting apparatus is provided, including: the image candidate unit is configured to acquire candidate image areas in an image through an edge detection algorithm, wherein the image comprises one or more image areas; a feature vector determination unit configured to determine color feature vectors of the respective candidate picture regions; a clustering unit configured to cluster the color feature vectors; and the screening unit is configured to screen out the picture region from the candidate picture region according to the class cluster to which the color feature vector of the candidate picture region belongs.
In some embodiments, the picture extraction device further comprises: an image conversion unit configured to convert the color image into a grayscale image; the picture candidate unit is configured to extract a candidate picture region from the grayscale image.
In some embodiments, the picture extraction device further comprises: and the picture application unit is configured to generate a rolling display image based on the screened picture areas.
According to an aspect of some embodiments of the present disclosure, a picture extracting apparatus is provided, including: a memory; and a processor coupled to the memory, the processor configured to perform any of the above picture extraction methods based on instructions stored in the memory.
The image extracting device can screen out the required image area from the candidate image area by utilizing the clustering algorithm and the color of the image after the candidate image area is obtained based on the edge detection, thereby reducing the interference influence and improving the accuracy of image extraction.
According to an aspect of still further embodiments of the present disclosure, a computer-readable storage medium is proposed, on which computer program instructions are stored, which instructions, when executed by a processor, implement the steps of any one of the above picture extraction methods.
By executing the instructions on the computer-readable storage medium, after the candidate picture area is obtained based on the edge detection, the required picture area can be screened out from the candidate picture area by using a clustering algorithm and the color of the picture, so that the interference influence is reduced, and the accuracy of picture extraction is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this disclosure, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure and not to limit the disclosure. In the drawings:
fig. 1 is a flow diagram of some embodiments of a picture extraction method of the present disclosure.
Fig. 2 is a flow chart of other embodiments of a picture extraction method of the present disclosure.
Fig. 3 is a flowchart of some embodiments of obtaining candidate picture regions in the picture extraction method of the present disclosure.
Fig. 4 is a flowchart illustrating another embodiment of obtaining a candidate picture region in a picture extraction method according to the present disclosure.
Fig. 5 is a flowchart of still other embodiments of the image extraction method of the present disclosure.
Fig. 6A-6E are schematic diagrams of some embodiments of a picture extraction method of the present disclosure.
Fig. 7 is a schematic diagram of some embodiments of a picture extraction device of the present disclosure.
Fig. 8 is a schematic diagram of another embodiment of a picture taking apparatus according to the present disclosure.
Fig. 9 is a schematic diagram of still other embodiments of the image capturing device of the present disclosure.
Detailed Description
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
A flow diagram of some embodiments of the picture extraction method of the present disclosure is shown in fig. 1.
In step 101, candidate picture regions in an image are obtained through an edge detection algorithm, wherein the image comprises one or more picture regions. In some embodiments, edge lines in the image may be determined by an edge detection algorithm, extracting a rectangular region as the candidate picture region. In some embodiments, candidate picture regions may be extracted by the Canny operator in conjunction with the huff transform; in other embodiments, the candidate picture region may be extracted by a Sobel operator.
In step 102, color feature vectors for respective candidate picture regions are determined. In some embodiments, the color partition range, for example, the [0,255] values of red, green, and blue, may be respectively partitioned into a plurality of ranges, each range corresponds to one dimension of the color feature vector, and color statistics of each dimension is performed on each candidate picture region to determine the color feature vector of each candidate picture region.
In step 103, the color feature vectors are clustered. In some embodiments, the color feature vectors may be clustered by the K-means algorithm.
In step 104, a picture region is selected from the candidate picture region according to the class cluster to which the color feature vector of the candidate picture region belongs. In some embodiments, the candidate picture region corresponding to one or some of the clusters may be deleted as needed, and the remaining color feature region may be used as a picture region.
Due to the fact that the long image containing the multiple images often comprises character and model information, through the method, after the candidate image area is obtained based on edge detection, the required image area can be screened out from the candidate image area through a clustering algorithm and the color of the image, interference influence is reduced, and the accuracy of image extraction is improved.
Flow diagrams of further embodiments of the picture extraction methods of the present disclosure are shown in fig. 2.
In step 201, candidate picture regions in the image are obtained by an edge detection algorithm,
in step 202, for each candidate picture region, the number of pixels attributed to each predetermined color range is determined.
In step 203, a color feature vector is obtained according to the number and the order of the attributed predetermined color range in the predetermined feature vector.
In some embodiments, the distribution of colors in the picture can be reflected by a color histogram, and the frequency of the colors is counted for each channel bucket. For example, setting the bucket number of each channel to be 16, for an RGB three-channel image, the color histogram feature of one graph is a color feature vector of 16 × 3 or 48 dimensions.
In step 204, the color feature vectors are clustered. And screening candidate picture areas based on the cluster obtained by clustering.
In some embodiments, different class cluster screening strategies may be selected according to requirements, for example, in a case that an image has a uniform and uniform background color, or a background color is similar to a color of a picture region to be obtained, the method from step 211 to step 213 may be adopted to determine a deleted class cluster.
In step 211, the number of vectors in the cluster to which the color feature vector of the candidate picture region belongs is obtained.
In step 212, the cluster of the class with the least number of vectors is determined.
In step 213, the candidate picture region having the color feature vector belonging to the cluster with the least number of vectors is excluded, and the picture region is determined.
The number of pictures in the image is more than the number of the character areas and the size tables under most conditions, the colors of the pictures are often rich, and the colors of the characters and the sizes are often single, so that the distance between the pictures and the color feature vectors of other parts is larger, and the candidate picture areas to which the characters and the size tables belong can be deleted by deleting the clusters with smaller sample number after clustering, so that the picture areas are obtained.
In other embodiments, to avoid the erroneous deletion caused by the image having no text or size table area or having more text or size table area, the operations in steps 221 to 224 may be performed.
In step 221, the center of each cluster class is determined by a clustering algorithm.
In step 222, the distance between the center of each cluster and a predetermined cluster center is obtained, where the predetermined cluster center is a cluster center of a color feature vector of a pre-stored picture region. In some embodiments, a larger amount of picture data can be used for clustering, and after the cluster of the non-information page picture is obtained, the value of the clustering center is stored and is not changed in the subsequent use process.
In step 223, the cluster of the class that is farthest from the predetermined cluster center is determined.
In step 224, the candidate picture region whose color feature vector belongs to the cluster most distant from the predetermined cluster center is excluded, and the picture region is determined.
By the method, the problem that the image has no text and size table area or has more text and size table areas to cause error deletion can be avoided, and the successful extraction rate of the image area is improved.
A flowchart of some embodiments of obtaining candidate picture regions in the picture extraction method of the present disclosure is shown in fig. 3.
In step 301, edge lines are extracted by Canny operator. In some embodiments, the image may be binarized using the Canny operator to outline all edges in the image. In some embodiments, an implementation of OpenCV (open source computer vision library) may be employed, setting the upper and lower thresholds and filter sizes, respectively.
Regarding each pixel point, if the pixel point is smaller than the lower threshold, the pixel point is not an edge; an edge if the value is greater than the upper threshold; and when the value is between the upper threshold and the lower threshold, if the pixel connected with the current pixel is an edge, the current pixel is considered to be the edge, otherwise, the current pixel is not the edge. The two thresholds together constitute the degree of sensitivity for detecting an edge, and a lower upper threshold makes it easier to determine that a pixel is an edge, and a higher lower threshold makes it easier to determine that a pixel is not an edge. The size of the filter determines how many pixels participate in the operation when the Canny value of each pixel point is calculated. In some embodiments, the upper and lower thresholds may be set to 200 and 50, respectively, with a filter size of 3. In some embodiments, the upper threshold may be set to an interval of [195,205], the lower threshold to an interval of [45,55], or the filter size to 3, 5, or 7.
In step 302, line segments of a predetermined length or more in the edge line are extracted by the hough transform. In some embodiments, the hough transform can detect all straight lines, and can be implemented by HoughLinesP (statistical hough transform) of OpenCV. In some embodiments, the parameters of the hough transform may be adjusted by setting one or more of the distance accuracy rho, the angle accuracy theta, and the threshold parameter threshold of the accumulation plane, such as setting rho 1, theta pi/180, and threshold 100.
In step 303, horizontal (slope is 0) and vertical (slope is 90 degrees) line segments are extracted according to the slopes of the line segments, all horizontal lines and vertical lines are combined, a plurality of small rectangles can be cut, and rectangular areas cut by the line segments are obtained. Line segments that are segmented may be deleted in some embodiments to reduce the amount of data for the operation.
In step 304, a region satisfying a predetermined size and a predetermined aspect ratio among the rectangular regions is acquired as a candidate picture region. In some embodiments, a predetermined size section, a predetermined aspect ratio section, and pictures with sizes larger and smaller, and pictures with aspect ratios not within the range of the predetermined aspect ratio section may be eliminated to form candidate picture regions.
By the method, the Canny operator is matched with the workflow of the Hough transform and matched with adaptive parameters to extract the candidate picture region in the image, the efficiency is improved, meanwhile, the region obviously not conforming to the picture characteristics can be deleted through the judgment of the slope, the size and the proportion, the extraction accuracy is improved, and the operation amount in the following operation process is reduced.
Fig. 4 shows a flowchart of another embodiment of the image extraction method of the present disclosure for obtaining a candidate image region.
In step 401, derivative information of the image in the horizontal and vertical directions is obtained by a Sobel operator. In some embodiments, two different Sobel operators may be used for the calculation, one for calculating the X-direction derivatives and one for calculating the Y-direction derivatives, and in particular in Sobel implementations using OpenCV, dx-0 and dy-1 for one operator and dx-1 and dy-0 for the other operator.
In step 402, the number of pixels in the same row and in the same column for which the reciprocal information falls within a predetermined threshold range is acquired. In some embodiments, taking the statistics of the Y direction (vertical direction) as an example, a threshold range is set, and the number of pixels in a row (horizontal X direction) falling within the threshold range is counted. In some embodiments, the two one-dimensional arrays can be obtained by first binarizing with the threshold of OpenCV and then directly accumulating.
In step 403, the image is cut in the first direction according to the number of pixels falling within the predetermined threshold range, and a cut picture region is obtained once. The first direction is any one of a horizontal direction or a vertical direction on the image plane, and the second direction is perpendicular to the first direction on the image plane. The strategy of cutting may include: if the number of the pixels falling within the range of the preset threshold is smaller than the threshold of the preset number, determining that the pixel in the second direction to which the current pixel belongs and the previous pixel in the first direction belong to the same picture; and if the number of the pixels falling within the preset threshold range is larger than the preset number threshold, determining that the pixel in the second direction to which the current pixel belongs and the previous pixel in the first direction belong to different pictures.
In step 404, the image area is cut once along the second direction according to the number of pixels falling within the predetermined threshold range, and a secondary cut image area is obtained. The logic of the cutting is the same as that of one cutting in step 403.
In step 405, a region satisfying a predetermined aspect ratio section in the twice-cut picture region is acquired as a candidate picture region.
By the method, the continuity of the picture in the horizontal direction and the vertical direction can be detected by fully utilizing the mathematical principle of the Sobel operator, so that the picture boundary can be judged. The method needs less manual parameter configuration and is beneficial to improving the automation degree of candidate image extraction.
A flowchart of still other embodiments of the image extraction method of the present disclosure is shown in fig. 5.
In step 501, the color image is converted to a grayscale image, as shown in FIG. 6A.
In step 502, candidate picture regions in the image are obtained by an edge detection algorithm. The extraction of candidate picture regions may employ an algorithm as employed in fig. 3 or 4. In some embodiments, for the image in fig. 6A, candidate picture regions as in fig. 6B-6E may be cut out. As can be seen from fig. 6A, a partially defective picture is located at the lowest part of the image, and the region is discarded due to the aspect ratio anomaly, and therefore, the region is not considered as a candidate picture region.
In step 503, color feature vectors of the respective candidate picture regions are acquired.
In step 504, color feature vectors are clustered.
In step 505, according to the class cluster to which the color feature vector of the candidate picture region belongs, the picture region is filtered out from the candidate picture region, for example, the size table region of fig. 6C is deleted, and the regions 6B, 6D, and 6E are obtained.
In a related picture clipping method, micro features are often extracted first, a large number of rules are used for generating and filtering possible boundary lines after the features are combined, more manual rules need to be written, and the performance and generalization capability are insufficient. By the method in the embodiment of the disclosure, the accuracy of determining the picture region can be improved, the number of parameters configured artificially can be reduced, and the generalization capability can be improved.
In some embodiments, step 506 may be further included, where the screened-out picture region is applied to perform a specific application, such as analyzing picture details. In some embodiments, in order to reduce the operation of sliding the page by the user, the scroll display image may be generated based on the screened image area, so that a large page is not required to be occupied, the image may be displayed to the user in a scroll display mode in the same page area, the automation degree of page display is improved, and the occupation amount of the page area is also reduced.
By the method, the color picture can be converted into the gray image firstly, and then the candidate picture region can be extracted, so that the operation accuracy of the Sobel operator and the Canny operator is improved, and the accuracy of the candidate picture region identification and extraction is improved.
A schematic diagram of some embodiments of the picture taking apparatus of the present disclosure is shown in fig. 7.
The picture candidate unit 701 can acquire a candidate picture region in an image by an edge detection algorithm, where the image includes one or more picture regions. In some embodiments, edge lines in the image may be determined by an edge detection algorithm, extracting a rectangular region as the candidate picture region. In some embodiments, the picture candidate unit 701 may extract the candidate picture region by using the method in the embodiment shown in fig. 3 or fig. 4.
The feature vector determination unit 702 is capable of determining color feature vectors for the respective candidate picture regions. In some embodiments, the number of pixels attributed to each predetermined color range may be determined for each candidate picture region; the color feature vector is obtained according to the number and the order of the attributed predetermined color range in the predetermined feature vector.
The clustering unit 703 is capable of clustering the color feature vectors. In some embodiments, the color feature vectors may be clustered by the K-means algorithm.
The filtering unit 704 can filter out the picture region from the candidate picture region according to the class cluster to which the color feature vector of the candidate picture region belongs. In some embodiments, the candidate picture region corresponding to one or some of the clusters may be deleted as needed, and the remaining color feature region may be used as a picture region.
After the candidate picture area is obtained based on the edge detection, the required picture area can be screened out from the candidate picture area by using the clustering algorithm and the colors of the pictures, so that the interference influence is reduced, and the accuracy of picture extraction is improved.
In some embodiments, as shown in fig. 7, the picture extraction apparatus may further include an image conversion unit 705, which is capable of converting a color image into a grayscale image, so as to improve the operation accuracy of the Sobel operator and the Canny operator, and improve the accuracy of candidate picture region identification and extraction.
In some embodiments, as shown in fig. 7, the picture extracting apparatus may further include a picture applying unit 706, which is capable of applying the screened-out picture region to perform a specific application, such as analyzing picture details. In some embodiments, in order to reduce the operation of sliding the page by the user, the scroll display image may be generated based on the screened image area, so that a large page is not required to be occupied, the image may be displayed to the user in a scroll display mode in the same page area, the automation degree of page display is improved, and the occupation amount of the page area is also reduced.
Fig. 8 shows a schematic structural diagram of an embodiment of the image capturing device according to the present disclosure. The picture extraction means comprises a memory 801 and a processor 802. Wherein: the memory 801 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory is for storing instructions in the corresponding embodiments of the picture extraction method above. Coupled to the memory 801, the processor 802 may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 802 is configured to execute instructions stored in the memory, so as to reduce interference and improve accuracy of picture extraction.
In one embodiment, as also shown in fig. 9, the picture taking apparatus 900 includes a memory 901 and a processor 902. The processor 902 is coupled to the memory 901 via a BUS 903. The picture taking apparatus 900 may be further connected to an external storage device 905 through a storage interface 904 for calling external data, and may be further connected to a network or another computer system (not shown) through a network interface 906. And will not be described in detail herein.
In the embodiment, the data instruction is stored in the memory, and the instruction is processed by the processor, so that the interference influence can be reduced, and the accuracy of picture extraction is improved.
In another embodiment, a computer-readable storage medium has stored thereon computer program instructions which, when executed by a processor, implement the steps of the method in the corresponding embodiment of the picture extraction method. As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, apparatus, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Thus far, the present disclosure has been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
Finally, it should be noted that: the above examples are intended only to illustrate the technical solutions of the present disclosure and not to limit them; although the present disclosure has been described in detail with reference to preferred embodiments, those of ordinary skill in the art will understand that: modifications to the specific embodiments of the disclosure or equivalent substitutions for parts of the technical features may still be made; all such modifications are intended to be included within the scope of the claims of this disclosure without departing from the spirit thereof.

Claims (16)

1. An image extraction method comprises the following steps:
obtaining candidate picture areas in an image through an edge detection algorithm, wherein the image comprises one or more picture areas;
determining a color feature vector of each candidate picture region;
clustering the color feature vectors;
and screening out the picture region from the candidate picture region according to the class cluster to which the color feature vector of the candidate picture region belongs.
2. The method of claim 1, wherein the filtering out picture regions from the candidate picture regions comprises:
and filtering the candidate picture region according to the number of vectors in a cluster to which the color feature vector of the candidate picture region belongs or the distance between the center of the cluster and a preset cluster center, and determining the picture region.
3. The method of claim 1, wherein the determining color feature vectors for the respective candidate picture regions comprises:
determining, for each of the candidate picture regions, a number of pixels attributed to each of the predetermined color ranges;
determining the color feature vector according to the number and the order of the attributed predetermined color range in a predetermined feature vector.
4. The method of claim 1, 2 or 3, wherein said screening out picture regions from said candidate picture regions comprises:
acquiring the number of vectors in a cluster to which the color feature vectors of the candidate picture region belong;
determining a class cluster with the least vector quantity;
and excluding the candidate picture region of which the color feature vector belongs to the cluster with the least number of vectors, and determining the picture region.
5. The method of claim 1, 2 or 3, wherein said screening out picture regions from said candidate picture regions comprises:
determining the center of each cluster;
acquiring the distance between the center of each cluster and a preset cluster center, wherein the preset cluster center is the cluster center of a color feature vector of a prestored picture area;
determining a cluster of classes that is farthest from the predetermined cluster center;
and excluding the candidate picture region of which the color feature vector belongs to the cluster farthest from the preset cluster center, and determining the picture region.
6. The method of claim 1, wherein the obtaining the candidate picture region in the image by the edge detection algorithm comprises:
extracting edge lines through a Canny operator;
extracting line segments with slopes within a preset range in the edge lines through hough transformation;
extracting horizontal and vertical line segments according to the slope of the line segments, and acquiring a rectangular area cut by the line segments;
acquiring a region satisfying a predetermined size and a predetermined aspect ratio among the rectangular regions as the candidate picture region.
7. The method of claim 6, comprising at least one of:
the Canny operator parameters for extracting the edge line comprise at least one of the following: the interval of the upper threshold is [195,205], the interval of the lower threshold is [45,55], or the filter size is 3, 5 or 7;
or the like, or, alternatively,
the parameter for extracting the line segment with the length greater than or equal to the preset length in the edge line through the hough transformation comprises at least one of the following items: the distance accuracy is 1 pixel and the angle accuracy is pi/180 radians, or the threshold parameter of the accumulation plane is 100.
8. The method of claim 1, wherein the obtaining the candidate picture region in the image by the edge detection algorithm comprises:
acquiring derivative information of the image in the horizontal and vertical directions by a Sobel operator;
respectively acquiring the number of pixels of which the reciprocal information falls within a preset threshold range in the same row and the same column;
cutting the image along a first direction according to the number of pixels falling within a preset threshold range, and acquiring a cut image area, wherein the cutting method comprises the following steps: if the number of the pixels falling within the range of the preset threshold is smaller than the threshold of the preset number, determining that the pixel in the second direction to which the current pixel belongs and the previous pixel in the first direction belong to the same picture; if the number of pixels falling within the range of the preset threshold is larger than the threshold of the preset number, determining that a pixel in a second direction to which a current pixel belongs and a previous pixel in the first direction belong to different pictures, wherein the first direction is any one of a horizontal direction or a vertical direction on the image plane, and the second direction is perpendicular to the first direction on the image plane;
cutting the primary cut image area along a second direction according to the number of pixels falling within a preset threshold range to obtain a secondary cut image area;
and acquiring a region which meets a preset length-width ratio in the secondary cutting picture region as the candidate picture region.
9. The method of claim 8, wherein the predetermined threshold range is [5,255 ].
10. The method of any of claims 1, 6-9, further comprising:
converting the color image into a gray image;
the obtaining of the candidate picture area in the image through the edge detection algorithm is to extract the candidate picture area from the gray level image.
11. The method of claim 1, further comprising:
and generating a rolling display image based on the screened picture area.
12. A picture extraction device, comprising:
the image candidate unit is configured to acquire candidate image areas in an image through an edge detection algorithm, wherein the image comprises one or more image areas;
a feature vector determination unit configured to determine color feature vectors of the respective candidate picture regions;
a clustering unit configured to cluster the color feature vectors;
and the screening unit is configured to screen out the picture areas from the candidate picture areas according to the class clusters to which the color feature vectors of the candidate picture areas belong.
13. The apparatus of claim 12, further comprising:
an image conversion unit configured to convert the color image into a grayscale image;
the picture candidate unit is configured to extract the candidate picture region from the grayscale image.
14. The apparatus of claim 12, further comprising:
and the picture application unit is configured to generate a rolling display image based on the screened picture areas.
15. A picture extraction device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the method of any of claims 1-11 based on instructions stored in the memory.
16. A computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 11.
CN201910349682.XA 2019-04-28 2019-04-28 Picture extraction method and device and computer-readable storage medium Pending CN111783807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910349682.XA CN111783807A (en) 2019-04-28 2019-04-28 Picture extraction method and device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910349682.XA CN111783807A (en) 2019-04-28 2019-04-28 Picture extraction method and device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN111783807A true CN111783807A (en) 2020-10-16

Family

ID=72755037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910349682.XA Pending CN111783807A (en) 2019-04-28 2019-04-28 Picture extraction method and device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN111783807A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593277A (en) * 2008-05-30 2009-12-02 电子科技大学 A kind of complicated color image Chinese version zone automatic positioning method and device
JP2011087144A (en) * 2009-10-16 2011-04-28 Nippon Telegr & Teleph Corp <Ntt> Telop character area detection method, telop character area detection device, and telop character area detection program
JP2011248702A (en) * 2010-05-28 2011-12-08 Sharp Corp Image processing device, image processing method, image processing program, and program storage medium
CN105096347A (en) * 2014-04-24 2015-11-25 富士通株式会社 Image processing device and method
CN105825203A (en) * 2016-03-30 2016-08-03 大连理工大学 Ground arrowhead sign detection and identification method based on dotted pair matching and geometric structure matching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593277A (en) * 2008-05-30 2009-12-02 电子科技大学 A kind of complicated color image Chinese version zone automatic positioning method and device
JP2011087144A (en) * 2009-10-16 2011-04-28 Nippon Telegr & Teleph Corp <Ntt> Telop character area detection method, telop character area detection device, and telop character area detection program
JP2011248702A (en) * 2010-05-28 2011-12-08 Sharp Corp Image processing device, image processing method, image processing program, and program storage medium
CN105096347A (en) * 2014-04-24 2015-11-25 富士通株式会社 Image processing device and method
CN105825203A (en) * 2016-03-30 2016-08-03 大连理工大学 Ground arrowhead sign detection and identification method based on dotted pair matching and geometric structure matching

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
徐勤燕: "复杂背景中基于纹理和颜色的车牌定位研究", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 6, pages 9 - 46 *
李林青等: "基于边缘分析和颜色统计的车牌精确定位新方法", 计算机应用研究, vol. 29, no. 1, pages 336 - 343 *
闻京;张凌;袁华;: "一种复杂背景图像中文字区域提取算法", 中山大学学报(自然科学版), no. 1 *

Similar Documents

Publication Publication Date Title
CN107330979B (en) Vector diagram generation method and device for building house type and terminal
CN106960208B (en) Method and system for automatically segmenting and identifying instrument liquid crystal number
US9530045B2 (en) Method, system and non-transitory computer storage medium for face detection
US9311533B2 (en) Device and method for detecting the presence of a logo in a picture
US10748023B2 (en) Region-of-interest detection apparatus, region-of-interest detection method, and recording medium
EP4071665A1 (en) Character segmentation method and apparatus, and computer-readable storage medium
US9792507B2 (en) Method and system for ground truth determination in lane departure warning
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
CN110598566A (en) Image processing method, device, terminal and computer readable storage medium
JP2013196136A (en) Image forming apparatus and image forming method
CN110569774A (en) Automatic line graph image digitalization method based on image processing and pattern recognition
CN111062331A (en) Mosaic detection method and device for image, electronic equipment and storage medium
CN108107611B (en) Self-adaptive defect detection method and device and electronic equipment
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN110807457A (en) OSD character recognition method, device and storage device
CN107784644B (en) method and device for determining interface of immiscible liquid
CN110084117B (en) Document table line detection method and system based on binary image segmentation projection
CN111783807A (en) Picture extraction method and device and computer-readable storage medium
CN111695557B (en) Image processing method and device
CN113538500B (en) Image segmentation method and device, electronic equipment and storage medium
CN112132141A (en) Character merging method and device, electronic equipment and storage medium
US20170147895A1 (en) Method and device for digit separation
JP2004334461A (en) Character recognition device and character recognition program
CN109785383B (en) Method and device for positioning and identifying test line in TVlines image and readable storage medium
CN112215783B (en) Image noise point identification method, device, storage medium and equipment

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