CN109993749A - The method and apparatus for extracting target image - Google Patents

The method and apparatus for extracting target image Download PDF

Info

Publication number
CN109993749A
CN109993749A CN201711477652.4A CN201711477652A CN109993749A CN 109993749 A CN109993749 A CN 109993749A CN 201711477652 A CN201711477652 A CN 201711477652A CN 109993749 A CN109993749 A CN 109993749A
Authority
CN
China
Prior art keywords
connected region
feature
object images
feature vector
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711477652.4A
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 CN201711477652.4A priority Critical patent/CN109993749A/en
Publication of CN109993749A publication Critical patent/CN109993749A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20036Morphological image processing

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus for extracting target image, are related to field of computer technology.One specific embodiment of this method includes: to obtain the feature vector of object images;According to the feature vector of the object images, mask location is obtained;According to the mask location and the object images, target image is extracted from the object images.The embodiment automatic interaction extracts the effect of segmentation object image from object images, while improving segmentation precision, reduce the time cost and cost of labor of manual identified consuming, it also is the subsequent important step carried out to image in automation semantic tagger to realize that automatic identification image, semantic lays the foundation.

Description

The method and apparatus for extracting target image
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus for extracting target image.
Background technique
Image segmentation is the process for dividing the image into several regions with unique properties and extracting interesting target, It is a great problem of computer vision field.There are many method of segmentation, and the interactive image segmentation of algorithm GrabCut is cut based on figure It is wherein optimal one of method, it divides the image into problem and is converted into energy minimization problem, by solving in network flow Minimal cut carrys out segmented image.Many information are contained in image, for example, including title, author, publication in the cover image of books Society, subtitle, the information such as key content in book.The semantics recognition that target image is picture material is extracted in segmentation automatically from image It lays a good foundation, while being also the subsequent important step for carrying out automation semantic tagger to image.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
1. there are no the methods for extracting target image directly from object images in the prior art, such as from cover image Extract title image.
2. if GrabCut algorithm is applied to extract in target image, it may be desirable to which a large amount of user's interaction is unable to complete certainly The extraction of dynamicization is divided, and causes efficiency lower.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and apparatus for extracting target image, it can be according to passing through The mask location that the feature vector of object images obtains extracts segmentation object image from object images, realizes automatic interaction Segmentation, while improving segmentation precision, reduce manual identified target image expend time cost and cost of labor, also for Realize automatic identification picture material semanteme lay the foundation, be it is subsequent image is carried out it is important in automation semantic tagger Step.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of side for extracting target image is provided Method, comprising: obtain the feature vector of object images;According to the feature vector of the object images, mask location is obtained;According to institute Mask location and the object images are stated, extracts target image from the object images.
Optionally, according to the mask location and the object images, target image is extracted in the object images, is wrapped It includes: according to the mask location and the object images, using GrabCut algorithm, target figure is extracted from the object images Picture.
Optionally, the feature vector of object images is obtained, comprising: obtain the bianry image of the object images;To described Bianry image carries out expansion process, obtains multiple connected regions;For each connected region, obtain the feature of the connected region to Amount;The feature vector of the object images is made of the feature vector of all connected regions.
Optionally, the feature vector of the connected region is obtained, comprising: obtain direction character, the position of the connected region Feature, diagonal line ratio characteristic and area ratio feature;According to the direction character, the position feature, diagonal line ratio Example feature, the area ratio feature, carry out Fusion Features, obtain the feature vector of the connected region.
Optionally, the direction character of the connected region is obtained, comprising: obtain the horizontal span value of the connected region is, vertical span value js;If is≥js, then the direction character H of the connected region1=0;If is< js, then the connected region Direction character H1=1;
The position feature of the connected region, comprising: if the direction character H of the connected region1=0, the connected region The position feature H in domain2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1=1, institute State the position feature H of connected region2=ja, jaFor longitudinal average value of the connected region;
The diagonal line ratio characteristic of the connected regionWherein, L is outer section of square of minimum of the connected region The catercorner length of shape, LmaxFor the minimum outer maximum cut in rectangle catercorner length of connected regions all in the object images Value;
The area ratio feature of the connected regionWherein, s is the area of the connected region, and S is the company The outer area for cutting rectangle of the minimum in logical region.
Optionally, judge whether the area ratio feature p of the connected region is less than given threshold ε, if then from described The feature vector of the connected region is deleted in the feature vector of object images.
Optionally, Fusion Features include: by the direction character of the connected region, position feature, diagonal line ratio characteristic, Area ratio feature carries out serial combination;Or by the direction character of the connected region, position feature, diagonal line ratio characteristic, Area ratio feature carries out the parallel combined.
Optionally, according to the feature vector of the object images, obtaining mask location includes: using sorter model, root According to the feature vector of the object images, the mask location of the cover image is obtained.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide it is a kind of extract target image dress It sets, comprising: characteristic extracting module, categorization module, target image extraction module;The characteristic extracting module, is used for: obtaining object The feature vector of image;The categorization module, is used for: according to the feature vector of the object images, obtaining mask location;It is described Target image extraction module, is used for: according to the mask location and the object images, extracting target from the object images Image.
Optionally, the characteristic extracting module, is used for: according to the mask location and the object images, using GrabCut algorithm extracts target image from the object images.
Optionally, the characteristic extracting module, is used for: obtaining the bianry image of the object images;To the binary map As carrying out expansion process, multiple connected regions are obtained;For each connected region, the feature vector of the connected region is obtained;Institute The feature vector for stating object images is made of the feature vector of all connected regions.
Optionally, the characteristic extracting module, is used for: obtaining the direction character of the connected region, position feature, diagonal Line ratio characteristic and area ratio feature;According to the direction character, the position feature, the diagonal line ratio characteristic, institute Area ratio feature is stated, Fusion Features is carried out, obtains the feature vector of the connected region.
Optionally, the characteristic extracting module, is used for: obtaining the horizontal span value i of the connected regions, vertical span Value js;If is≥js, then the direction character H of the connected region1=0;If is< js, then the direction character H of the connected region1 =1;
Obtain the position feature of the connected region, comprising: if the direction character H of the connected region1=0, the company The position feature H in logical region2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1= 1, the position feature H of the connected region2=ja, jaFor longitudinal average value of the connected region;
Obtain the diagonal line ratio characteristic of the connected regionWherein, L is that the minimum of the connected region is outer Cut the catercorner length of rectangle, LmaxFor in the minimum outer section of rectangle catercorner length of connected regions all in the object images Maximum value;
Obtain the area ratio feature of the connected regionWherein, s is the area of the connected region, and S is institute State the outer area for cutting rectangle of minimum of connected region.
Optionally, the characteristic extracting module, is used for: judging whether the area ratio feature p of the connected region is less than Given threshold ε, if then deleting the feature vector of the connected region from the feature vector of the object images.
Optionally, the characteristic extracting module, is used for: by the direction character, position feature, diagonal line of the connected region Ratio characteristic, area ratio feature carry out serial combination;Or by the direction character, position feature, diagonal line of the connected region Ratio characteristic, area ratio feature carry out the parallel combined.
Optionally, the categorization module, is used for: being obtained using sorter model according to the feature vector of the object images Obtain the mask location of the cover image.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment, comprising: one A or multiple processors;Storage device, for storing one or more programs, when one or more of programs are one Or multiple processors execute, so that one or more of processors realize the side provided by the present invention for extracting target image Method.
To achieve the above object, according to an embodiment of the present invention in another aspect, provide a kind of computer-readable medium, On be stored with computer program, realized when described program is executed by processor it is provided by the present invention extract target image side Method.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that by the spy of object images because according to The mask location that sign vector automatically obtains, overcomes the problem for needing a large number of users interaction in the prior art, realizes automatic friendship The effect that segmentation object image is mutually extracted from object images reduces manual identified consuming while improving segmentation precision Time cost and cost of labor, also for realize automatic identification picture material semanteme lay the foundation, be subsequent to image Carry out the important step in automation semantic tagger.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the basic procedure of the method according to an embodiment of the present invention for extracting target image;
Fig. 2 is the schematic diagram of the preferred flow of the method according to an embodiment of the present invention for extracting target image;
Fig. 3 is the schematic diagram of the basic module of the device according to an embodiment of the present invention for extracting target image;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Existing GrabCut algorithm is a kind of image partition method, and major function is segmentation and scratches figure, it is being initialized Stage needs user by direct frame to select target to obtain an initial box, the pixel of party's outer frame as background pixel TB, And the pixel in the box is as the pixel TU that may be target.It may require that a large amount of user's interaction in this way, be unable to complete automatic The extraction of change is divided, and causes efficiency lower.
Fig. 1 is the schematic diagram of the basic procedure of the method according to an embodiment of the present invention for extracting target image, such as Fig. 1 institute Show, the embodiment of the invention provides a kind of methods for extracting target image, may include:
The feature vector of step S101. acquisition object images;
Step S102. obtains mask location according to the feature vector of the object images;
Step S103. extracts target image from the object images according to the mask location and the object images.
Wherein, the object images of the embodiment of the present invention can include but is not limited to cover, newpapers and periodicals etc.;For example, object images The cover that can be books, the target image to be extracted can be the title image of the book cover.Step S102 can be used Sorter model obtains mask location according to the feature vector of object images.Sorter model is using machine learning algorithm structure It builds, machine learning algorithm can include but is not limited to clustering method, k-nearest neighbor, neural network, support vector machine method.It covers Film location, that is, Mask value refers to target position range optimal in object images, can be connected region where target most The coordinate value of small boundary rectangle.For example, mask location can be title position model optimal in cover in book cover image It encloses.Step of embodiment of the present invention S103 can use GrabCut algorithm or its modified hydrothermal process, extract target image.
It is all by manually selecting to obtain an initial side come frame when using GrabCut algorithm segmented image in the prior art Frame, the embodiment of the present invention can be realized by the mask location i.e. initial box obtained automatically in conjunction with GrabCut algorithm Automatic interaction extracts the effect of segmentation object image from object images, improve segmentation precision while, reduces artificial The time cost and cost of labor that recognition target image expends, the method robustness of the embodiment of the present invention is also fine, to realize certainly The semanteme of dynamicization identification picture material lays the foundation, and is the subsequent important step carried out in automation semantic tagger to image.
In the embodiment of the present invention, the feature vector of the object images is obtained, may include: to obtain the object images Bianry image;Expansion process is carried out to the bianry image, obtains multiple connected regions;For each connected region, obtaining should The feature vector of connected region;The feature vector of the object images is made of the feature vector of all connected regions.This implementation Example can obtain bianry image by carrying out pretreatment to the object images, and preprocessing process may include gray processing, put down Sliding denoising and binaryzation;Wherein it is possible to using Gaussian filter removal noise and make image smoothing;It is also optional for removal noise With the methods of sef-adapting filter, median filter.The embodiment of the present invention can be using the plavini of mathematical morphology to described Bianry image carries out expansion process.
The embodiment of the present invention needs to be arranged expansion parameters size when using the plavini of mathematical morphology, by expansion The connected region obtained afterwards can be more significant, and the feature vector of the connected region obtained from can be more accurate, also mentions simultaneously The high target image precision extracted.
In the embodiment of the present invention, the feature vector of the connected region is obtained, may include: the side for obtaining the connected region To feature, the position feature of the connected region, the diagonal line ratio characteristic of the connected region, the connected region area Ratio characteristic;According to the direction character of the connected region, the position feature of the connected region, the connected region it is diagonal The area ratio feature of line ratio characteristic, the connected region carries out Fusion Features, obtain the feature of the connected region to Amount.
The embodiment of the present invention can more accurately identify connected region by extracting above four features, to improve extraction Target image precision.
In the embodiment of the present invention, it can include but is not limited to using seed fill algorithm, Scanning-line Filling algorithm, side filling Algorithm etc. calculates connected region, obtains the coordinate value of each pixel in connected region.According to these coordinate values, can obtain Take the direction character of the connected region, comprising: obtain the horizontal span value i of the connected regions, the connected region hangs down Straight across angle value js;If is≥js, then the direction character H of the connected region1=0;If is< js, then the direction of the connected region Feature H1=1;Wherein, horizontal span value isFor the pixel abscissa maximum value and pixel abscissa minimum in connected region The difference of value;Vertical span value jsFor the difference of pixel ordinate maximum value and pixel ordinate minimum value in connected region.
Obtain the position feature of the connected region, comprising: if the direction character H of the connected region1=0, the company The position feature H in logical region2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1= 1, the position feature H of the connected region2=ja, jaFor longitudinal average value of the connected region;Lateral average value is connected region The average value of the abscissa of all pixels point in domain, longitudinal average value are that the ordinate of all pixels point in connected region is averaged Value.
Obtain the diagonal line ratio characteristic of the connected regionWherein, L is that the minimum of the connected region is outer Cut the catercorner length of rectangle, LmaxFor in the minimum outer section of rectangle catercorner length of connected regions all in the object images Maximum value;
Obtain the area ratio feature of the connected regionWherein, s is the area of the connected region, connected region The area in domain can be acquired by shaded area calculating method;S is the outer area for cutting rectangle of minimum of the connected region.
The embodiment of the present invention can more accurately identify each connected region by extracting above four features, make to pass through classification The mask location that device model obtains is more accurate, to improve the target image precision of extraction.
In the embodiment of the present invention, judge whether the area ratio feature p of the connected region is less than given threshold ε, if The feature vector of the connected region is then deleted from the feature vector of the object images.Pass through the feature vector to connected region It is screened, the mask location obtained by sorter model can be made more accurate, to improve the target image essence of extraction Degree.
In the embodiment of the present invention, Fusion Features may include: by the direction character of the connected region, the connected region Position feature, the diagonal line ratio characteristic of the connected region, the connected region area ratio feature carry out serial group It closes;Or by the direction character of the connected region, the position feature of the connected region, the connected region diagonal line ratio Feature, the area ratio feature of the connected region carry out the parallel combined.Serial combination refers to such as two groups of feature vectors are first Tail, which is connected, generates a joint vector as new feature vector, carries out feature extraction in the vector space of more higher-dimension;Parallel group Conjunction, which refers to, is merged such as two groups of feature vectors of same sample using complex vector, is carried out feature in complex vector space and is mentioned It takes.
The embodiment of the present invention keeps the mask location obtained by sorter model more accurate by Fusion Features, makes simultaneously Assorting process is rapider, to improve the target image accuracy and speed of extraction.
Fig. 2 is the schematic diagram of the preferred flow of the method according to an embodiment of the present invention for extracting target image, such as Fig. 2 institute Show, object images is pre-processed to obtain binary map after obtaining object images, using the plavini of mathematical morphology to described Bianry image carry out expansion process, obtain significant connected region, to connected region carry out feature extraction after, to multiple features into The processing of row multiple features fusion, obtains the feature vector of object images.Using support vector machines (Support Vector Machine) sorter model obtains mask location Mask according to the feature vector of object images, using GrabCut algorithm, root Segmentation object image is extracted from object images according to mask location Mask.
By taking title image is extracted in segmentation in the cover image from books as an example, cover image is pre-processed to obtain cover The binary map of image carries out expansion process to bianry image using the plavini of mathematical morphology, obtains multiple connected regions.It is right Each connected region carries out feature extraction, obtains the feature vector of connected region, comprising: direction character, position feature, diagonal line Ratio characteristic and area ratio feature.By obtained direction character, position feature, diagonal line ratio characteristic, area ratio feature Carry out the fusion of serial or parallel.According to the feature vector of each connected region, the feature vector of cover image is obtained.Using basis The sorter model that machine learning algorithm training obtains obtains mask location Mask according to the feature vector of cover image.Using GrabCut algorithm extracts segmentation title image according to mask location Mask and cover image from cover image.
Fig. 3 is the schematic diagram of the basic module of the device according to an embodiment of the present invention for extracting target image, such as Fig. 3 institute Show, it may include: characteristic extracting module 301, classification that the embodiment of the invention provides a kind of devices 300 for extracting target image Module 302, target image extraction module 303;The characteristic extracting module 301, can be used for: obtain the features of object images to Amount;The categorization module 302, can be used for: according to the feature vector of object images, obtain mask location;The target image Extraction module 303, can be used for: according to the mask location and the object images, extract target from the object images Image.The embodiment of the present invention can use GrabCut algorithm or its modified hydrothermal process, and target figure is extracted from the object images Picture.Categorization module 302, can be used for: using sorter model, according to the feature vector of object images, obtains mask location.
The embodiment of the present invention uses GrabCut algorithm according to the mask location of the feature vector acquisition by object images Technological means realizes the effect that automatic interaction extracts segmentation object image from object images, is improving the same of segmentation precision When, the time cost and cost of labor of manual identified consuming are reduced, also the semanteme for realization automatic identification image is laid Basis is the subsequent important step carried out in automation semantic tagger to image.
In the embodiment of the present invention, the characteristic extracting module 301 can be used for: obtain the binary map of the object images Picture;Expansion process is carried out to the bianry image, obtains multiple connected regions;For each connected region, the connected region is obtained The feature vector in domain;The feature vector of the object images is made of the feature vector of all connected regions.The embodiment of the present invention Expansion process can be carried out to the bianry image using the plavini of mathematical morphology.
The embodiment of the present invention needs to be arranged expansion parameters size when using the plavini of mathematical morphology, by expansion The connected region obtained afterwards can be more significant, and the feature vector of the connected region obtained from can be more accurate, also mentions simultaneously The high target image precision extracted.
In the embodiment of the present invention, the characteristic extracting module 301 can be used for: the direction for obtaining the connected region is special The area ratio of sign, the position feature of the connected region, the diagonal line ratio characteristic of the connected region, the connected region Feature;According to the direction character of the connected region, the position feature of the connected region, the connected region diagonal line ratio Example feature, the area ratio feature of the connected region, carry out Fusion Features, obtain the feature vector of the connected region.
The embodiment of the present invention can more accurately identify connected region by extracting above four features, to improve extraction Target image precision.
In the embodiment of the present invention, the characteristic extracting module 301 can be used for: obtain the connected region it is horizontal across Angle value is, the connected region vertical span value js;If is≥js, then the direction character H of the connected region1=0;If is< js, then the direction character H of the connected region1=1;
Obtain the position feature of the connected region, comprising: if the direction character H of the connected region1=0, the company The position feature H in logical region2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1= 1, the position feature H of the connected region2=ja, jaFor longitudinal average value of the connected region;
Obtain the diagonal line ratio characteristic of the connected regionWherein, L is that the minimum of the connected region is outer Cut the catercorner length of rectangle, LmaxFor in the minimum outer section of rectangle catercorner length of connected regions all in the object images Maximum value;
Obtain the area ratio feature of the connected regionWherein, s is the area of the connected region, and S is institute State the outer area for cutting rectangle of minimum of connected region.
The embodiment of the present invention can more accurately identify each connected region by extracting above four features, make to pass through classification The mask location that device model obtains is more accurate, to improve the target image precision of extraction.
In the embodiment of the present invention, the characteristic extracting module 301 can be used for: judge the area ratio of the connected region Whether example feature p is less than given threshold ε, if then deleting the feature of the connected region from the feature vector of the object images Vector.It is screened by the feature vector to connected region, the mask location obtained by sorter model can be made more Accurately, to improve the target image precision of extraction.
In the embodiment of the present invention, the characteristic extracting module 301 can be used for: by the direction character of the connected region, The position feature of the connected region, the diagonal line ratio characteristic of the connected region, the area ratio of the connected region are special Sign carries out serial combination;Or by the direction character of the connected region, the position feature of the connected region, the connected region Diagonal line ratio characteristic, the connected region area ratio feature carry out the parallel combined.
The embodiment of the present invention keeps the mask location obtained by sorter model more accurate by Fusion Features, makes simultaneously Assorting process is rapider, to improve the target image accuracy and speed of extraction.
Fig. 4 is shown can be using the method for the extraction target image of the embodiment of the present invention or the device of extraction target image Exemplary system architecture 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405. Network 404 between terminal device 401,402,403 and server 405 to provide the medium of communication link.Network 404 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can believe the product received The data such as breath inquiry request carry out the processing such as analyzing, and processing result is fed back to terminal device.
It should be noted that the embodiment of the present invention provided by from object images extract target image method generally by Server 405 executes, and correspondingly, the device for extracting target image is generally positioned in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, the present invention also provides a kind of electronic equipment and a kind of computer-readable storage medium Matter.
The a kind of electronic equipment of the embodiment of the present invention, comprising: one or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more A processor realizes the method provided by the present invention for extracting target image.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed Device realizes the method provided by the present invention for extracting target image when executing.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 509, and/or from can Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor, special Levy extraction module, categorization module, target image extraction module.Wherein, the title of these modules is not constituted under certain conditions Restriction to the module itself, for example, characteristic extracting module, be also described as " for obtain the features of object images to The module of amount ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: the feature vector that step S101. obtains object images;Step S102. is according to the features of the object images Vector obtains mask location;Step S103. is mentioned from the object images according to the mask location and the object images Take target image.
Technical solution according to an embodiment of the present invention, the exposure mask position automatically obtained according to the feature vector by object images It sets, overcomes the problem for needing a large number of users interaction in the prior art, realize automatic interaction and extract segmentation from object images The effect of target image reduces the time cost and cost of labor of manual identified consuming while improving segmentation precision, It is the subsequent important step carried out to image in automation semantic tagger to realize that automatic identification image, semantic lays the foundation Suddenly.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (18)

1. a kind of method for extracting target image characterized by comprising
Obtain the feature vector of object images;
According to the feature vector of the object images, mask location is obtained;
According to the mask location and the object images, target image is extracted from the object images.
2. the method according to claim 1, wherein according to the mask location and the object images, from institute It states and extracts target image in object images, comprising:
According to the mask location and the object images, using GrabCut algorithm, target figure is extracted from the object images Picture.
3. method according to claim 1 or 2, which is characterized in that obtain the feature vector of object images, comprising:
Obtain the bianry image of the object images;
Expansion process is carried out to the bianry image, obtains multiple connected regions;
For each connected region, the feature vector of the connected region is obtained;
The feature vector of the object images is made of the feature vector of all connected regions.
4. according to the method described in claim 3, it is characterized in that, obtaining the feature vector of the connected region, comprising:
Obtain direction character, position feature, diagonal line ratio characteristic and the area ratio feature of the connected region;
According to the direction character, the position feature, the diagonal line ratio characteristic, the area ratio feature, carry out special Sign fusion, obtains the feature vector of the connected region.
5. according to the method described in claim 4, it is characterized in that, obtaining the direction character of the connected region, comprising: obtain The horizontal span value i of the connected regions, vertical span value js;If is≥js, then the direction character H of the connected region1=0; If is< js, then the direction character H of the connected region1=1;
The position feature of the connected region, comprising: if the direction character H of the connected region1=0, the position of the connected region Set feature H2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1=1, the connection The position feature H in region2=ja, jaFor longitudinal average value of the connected region;
The diagonal line ratio characteristic of the connected regionWherein, L is outer section of rectangle of minimum of the connected region Catercorner length, LmaxFor the minimum outer maximum value cut in rectangle catercorner length of connected regions all in the object images;
The area ratio feature of the connected regionWherein, s is the area of the connected region, and S is the connected region The outer area for cutting rectangle of the minimum in domain.
6. according to the method described in claim 5, it is characterized in that, judge the connected region area ratio feature p whether Less than given threshold ε, if then deleting the feature vector of the connected region from the feature vector of the object images.
7. according to the method described in claim 4, it is characterized in that, Fusion Features include: that the direction of the connected region is special Sign, position feature, diagonal line ratio characteristic, area ratio feature carry out serial combination;
Or the direction character of the connected region, position feature, diagonal line ratio characteristic, area ratio feature are carried out parallel group It closes.
8. the method according to the description of claim 7 is characterized in that obtaining exposure mask according to the feature vector of the object images Position includes:
The mask location of the cover image is obtained according to the feature vector of the object images using sorter model.
9. a kind of device for extracting target image characterized by comprising characteristic extracting module, categorization module, target image mention Modulus block;
The characteristic extracting module, is used for: obtaining the feature vector of object images;
The categorization module, is used for: according to the feature vector of the object images, obtaining mask location;
The target image extraction module, is used for: according to the mask location and the object images, from the object images The logo image of extraction.
10. device according to claim 9, which is characterized in that the characteristic extracting module is used for: according to the exposure mask Position and the object images extract target image from the object images using GrabCut algorithm.
11. device according to claim 9 or 10, which is characterized in that the characteristic extracting module is used for:
Obtain the bianry image of the object images;
Expansion process is carried out to the bianry image, obtains multiple connected regions;
For each connected region, the feature vector of the connected region is obtained;
The feature vector of the object images is made of the feature vector of all connected regions.
12. device according to claim 11, which is characterized in that the characteristic extracting module is used for:
Obtain direction character, position feature, diagonal line ratio characteristic and the area ratio feature of the connected region;
According to the direction character, the position feature, the diagonal line ratio characteristic, the area ratio feature, carry out special Sign fusion, obtains the feature vector of the connected region.
13. device according to claim 12, which is characterized in that the characteristic extracting module is used for:
Obtain the horizontal span value i of the connected regions, vertical span value js;If is≥js, then the direction of the connected region is special Levy H1=0;If is< js, then the direction character H of the connected region1=1;
Obtain the position feature of the connected region, comprising: if the direction character H of the connected region1=0, the connected region Position feature H2=ia, iaFor the lateral average value of the connected region;The direction character H of the connected region1=1, it is described The position feature H of connected region2=ja, jaFor longitudinal average value of the connected region;
Obtain the diagonal line ratio characteristic of the connected regionWherein, L is outer section of square of minimum of the connected region The catercorner length of shape, LmaxFor the minimum outer maximum cut in rectangle catercorner length of connected regions all in the object images Value;
Obtain the area ratio feature of the connected regionWherein, s is the area of the connected region, and S is the company The outer area for cutting rectangle of the minimum in logical region.
14. device according to claim 13, which is characterized in that the characteristic extracting module is used for:
Judge whether the area ratio feature p of the connected region is less than given threshold ε, if then from the spy of the object images The feature vector of the connected region is deleted in sign vector.
15. device according to claim 12, which is characterized in that the characteristic extracting module is used for:
The direction character of the connected region, position feature, diagonal line ratio characteristic, area ratio feature are carried out serial group It closes;
Or the direction character of the connected region, position feature, diagonal line ratio characteristic, area ratio feature are carried out parallel group It closes.
16. device according to claim 15, which is characterized in that the categorization module is used for:
The mask location of the cover image is obtained according to the feature vector of the object images using sorter model.
17. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method described in any one of claims 1-8.
18. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method described in any one of claims 1-8 is realized when row.
CN201711477652.4A 2017-12-29 2017-12-29 The method and apparatus for extracting target image Pending CN109993749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711477652.4A CN109993749A (en) 2017-12-29 2017-12-29 The method and apparatus for extracting target image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711477652.4A CN109993749A (en) 2017-12-29 2017-12-29 The method and apparatus for extracting target image

Publications (1)

Publication Number Publication Date
CN109993749A true CN109993749A (en) 2019-07-09

Family

ID=67109673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711477652.4A Pending CN109993749A (en) 2017-12-29 2017-12-29 The method and apparatus for extracting target image

Country Status (1)

Country Link
CN (1) CN109993749A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111145305A (en) * 2019-12-04 2020-05-12 宁波华高信息科技有限公司 Document image processing method
CN111369496A (en) * 2020-02-18 2020-07-03 中北大学 Pupil center positioning method based on star ray
CN112464828A (en) * 2020-12-01 2021-03-09 广州视源电子科技股份有限公司 Data labeling method, device and equipment for document image edge and storage medium
CN113781584A (en) * 2021-01-14 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for taking color of picture

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533517A (en) * 2009-04-15 2009-09-16 北京联合大学 Structure feature based on Chinese painting and calligraphy seal image automatic extracting method
CN103034856A (en) * 2012-12-18 2013-04-10 深圳深讯和科技有限公司 Method and device for locating text area in image
CN104680161A (en) * 2015-01-09 2015-06-03 安徽清新互联信息科技有限公司 Digit recognition method for identification cards
CN105261110A (en) * 2015-10-26 2016-01-20 江苏国光信息产业股份有限公司 Efficient DSP banknote serial number recognizing method
CN105761351A (en) * 2016-01-08 2016-07-13 东方通信股份有限公司 Structure characteristic-based character recognition method
CN106097332A (en) * 2016-06-07 2016-11-09 浙江工业大学 A kind of container profile localization method based on Corner Detection
CN106156712A (en) * 2015-04-23 2016-11-23 信帧电子技术(北京)有限公司 A kind of based on the ID (identity number) card No. recognition methods under natural scene and device
CN106339704A (en) * 2015-07-14 2017-01-18 富士通株式会社 Character recognition method and character recognition equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533517A (en) * 2009-04-15 2009-09-16 北京联合大学 Structure feature based on Chinese painting and calligraphy seal image automatic extracting method
CN103034856A (en) * 2012-12-18 2013-04-10 深圳深讯和科技有限公司 Method and device for locating text area in image
CN104680161A (en) * 2015-01-09 2015-06-03 安徽清新互联信息科技有限公司 Digit recognition method for identification cards
CN106156712A (en) * 2015-04-23 2016-11-23 信帧电子技术(北京)有限公司 A kind of based on the ID (identity number) card No. recognition methods under natural scene and device
CN106339704A (en) * 2015-07-14 2017-01-18 富士通株式会社 Character recognition method and character recognition equipment
CN105261110A (en) * 2015-10-26 2016-01-20 江苏国光信息产业股份有限公司 Efficient DSP banknote serial number recognizing method
CN105761351A (en) * 2016-01-08 2016-07-13 东方通信股份有限公司 Structure characteristic-based character recognition method
CN106097332A (en) * 2016-06-07 2016-11-09 浙江工业大学 A kind of container profile localization method based on Corner Detection

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111145305A (en) * 2019-12-04 2020-05-12 宁波华高信息科技有限公司 Document image processing method
CN111369496A (en) * 2020-02-18 2020-07-03 中北大学 Pupil center positioning method based on star ray
CN111369496B (en) * 2020-02-18 2022-07-01 中北大学 Pupil center positioning method based on star ray
CN112464828A (en) * 2020-12-01 2021-03-09 广州视源电子科技股份有限公司 Data labeling method, device and equipment for document image edge and storage medium
CN112464828B (en) * 2020-12-01 2024-04-05 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for marking data of document image edge
CN113781584A (en) * 2021-01-14 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for taking color of picture

Similar Documents

Publication Publication Date Title
CN108229341B (en) Classification method and device, electronic equipment and computer storage medium
CN109934181A (en) Text recognition method, device, equipment and computer-readable medium
CN109993749A (en) The method and apparatus for extracting target image
CN109308681A (en) Image processing method and device
CN109344762B (en) Image processing method and device
CN105184289B (en) Character identifying method and device
CN108596940A (en) A kind of methods of video segmentation and device
CN110348511A (en) A kind of picture reproduction detection method, system and electronic equipment
CN108830329A (en) Image processing method and device
CN108629823A (en) The generation method and device of multi-view image
CN109086780A (en) Method and apparatus for detecting electrode piece burr
CN108764319A (en) A kind of sample classification method and apparatus
CN109255337A (en) Face critical point detection method and apparatus
CN110458173A (en) Method and apparatus for generating article color value
CN106919711A (en) The method and apparatus of the markup information based on artificial intelligence
CN110349158A (en) A kind of method and apparatus handling point cloud data
CN109871791A (en) Image processing method and device
CN108090885A (en) For handling the method and apparatus of image
CN108595448A (en) Information-pushing method and device
CN108597034B (en) Method and apparatus for generating information
CN109285181A (en) The method and apparatus of image for identification
CN110032914A (en) A kind of method and apparatus marking picture
CN110110666A (en) Object detection method and device
CN108182457A (en) For generating the method and apparatus of information
CN110443899A (en) Method and apparatus for handling data

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