WO2018121414A1 - 电子设备、目标图像识别方法及装置 - Google Patents

电子设备、目标图像识别方法及装置 Download PDF

Info

Publication number
WO2018121414A1
WO2018121414A1 PCT/CN2017/117808 CN2017117808W WO2018121414A1 WO 2018121414 A1 WO2018121414 A1 WO 2018121414A1 CN 2017117808 W CN2017117808 W CN 2017117808W WO 2018121414 A1 WO2018121414 A1 WO 2018121414A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
target image
sample
image sample
Prior art date
Application number
PCT/CN2017/117808
Other languages
English (en)
French (fr)
Inventor
郝志帅
姜野
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018121414A1 publication Critical patent/WO2018121414A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • 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
    • 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/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]

Definitions

  • Embodiments of the present invention relate to, but are not limited to, the field of data network communication, and in particular, an electronic device, a target image recognition method and apparatus.
  • Video or pictures are increasingly used as a means of storing and presenting information. Each frame of video or each picture can be reduced to one image.
  • Image content is often not as easy to find and modify as the content of the document. It is more difficult to replace the local content of the image, such as the target of interest, with new content. There are three key points to achieve this: target recognition, target matching, and target replacement. It is often a manual identification of the target, which is then segmented by a mapping tool and then replaced with new content. There are also some algorithms that can identify or replace known areas or specific targets to a certain extent, such as display scrolling letter area recognition replacement, full screen insertion in the video or partial screen advertisement screen recognition replacement, face and other special object recognition replacement. Since the target and the boundary are easy to obtain, and the target pose has not been considered, it is not applicable to the target recognition replacement with less common predictive information.
  • Embodiments of the present invention provide an electronic device, a target image recognition method, and an apparatus.
  • An embodiment of the present invention provides a target image recognition method, including: matching a target image sample image with an image to be recognized, and obtaining a target image sample matching point and a matching image matching point, wherein the target image sample matching point Corresponding relationship with the image matching point to be identified, the target image sample image includes a target image sample; and in a case where the image to be recognized has at most one target image, according to the target image sample matching point and the corresponding one The image matching point to be identified identifies the target image in the image to be recognized, wherein the target image has the same scale as the target image sample; and it is impossible to determine whether there is one target image or multiple target images in an image to be recognized.
  • the method before the matching the target image sample image with the image to be identified, the method further includes: acquiring the target image sample image; identifying the target image sample from the target image sample image; determining An outer contour point vector of the target image proof, wherein the outer contour is used to demarcate the target image proof and the background.
  • the matching the target image sample image with the image to be recognized, and obtaining the target image sample matching point and the image matching point to be recognized include: the target image sample image and the image to be recognized Matching a selected image to be matched until all the images to be matched are matched; matching the target image sample with a candidate image to be selected sequentially from the image to be identified includes: respectively Obtaining a feature vector of the image to be matched and the image of the target image; matching the feature vector of the target image sample with the feature vector of the image to be matched, and obtaining the target image sample matching point and the waiting relationship Match image matching points.
  • the feature vector of the target image sample is matched with the feature vector of the image to be matched by a storm algorithm Bruce Force algorithm.
  • the acquiring the feature vector of the to-be-matched image and the target image sample respectively includes: extracting a key point of the image to be matched and a key point of the target image sample; according to the image to be matched The key point acquires a feature vector of the image to be matched; and acquires a feature vector of the target image sample according to a key point of the target image sample.
  • a key point of the image to be matched is extracted by a Scale-invariant feature transform (SIFT) algorithm or a Speed Up Robust Features (SURF) algorithm. And the key points of the target image sample.
  • SIFT Scale-invariant feature transform
  • SURF Speed Up Robust Features
  • the method further includes: adopting a European threshold method or the most The Best Bin First (BBF) algorithm performs a false matching verification on the target image sample matching point and the to-be-identified image matching point, wherein the error matching verification is used to verify the target image sample matching point and The correctness of the matching relationship of the to-be-identified image matching points; in the case where the verification does not pass the false matching verification, the target image sample matching point and the to-be-identified image matching point with the matching relationship error are deleted.
  • BBF Best Bin First
  • the identifying the target image in the image to be recognized according to the target image sample matching point and the corresponding image matching point group includes: matching the point according to the target image sample and the corresponding image
  • the image matching point group to be identified determines a target image area in each image to be identified; the target image is determined from the target image area according to the target image sample.
  • determining the target image region in each image to be recognized according to the target image sample matching point and the corresponding image matching point group to be recognized includes: matching points according to the target image sample Corresponding the transformation relationship of the to-be-identified image matching point group obtains a transformation matrix; the target image region in each image to be identified is determined by the transformation matrix and the outer contour point vector of the target image sample.
  • determining the target image from the target image region according to the target image sample includes: determining whether the similarity between the target image sample and the target image region is greater than a threshold; determining the target image If the similarity between the map and the target image region is greater than the threshold, it is determined that the matching is successful; and if it is determined that the similarity between the target image sample and the target image region is not greater than the threshold, the matching failure is determined.
  • determining whether the similarity between the target image sample and the target image region is greater than a threshold comprises: respectively acquiring the target image sample and the texture information of the target image region; according to the target image sample The texture information and the texture information of the target image region determine the similarity between the target image sample and the target image region; and determine whether the similarity between the target image sample and the target image region is greater than a threshold.
  • the method further includes: acquiring a target replacement image sample; The target image in the image to be identified is replaced with the target replacement image sample.
  • the acquiring target replacement image sample includes: acquiring a target replacement image sample; identifying the target replacement image sample from the target replacement image sample; determining an outer contour point vector of the target replacement image sample Wherein the outer contour is used to replace the image with the image and the background boundary.
  • the method further includes: replacing the target image image with the target The target image sample is normalized, wherein the normalization process is used to unify the size of the target replacement image sample and the target image sample.
  • the normalizing the target replacement image sample and the target image sample includes: determining whether the length of the target replacement image sample is smaller than the length of the target image sample; If the length of the target replacement image sample is smaller than the length of the target image sample, the target image sample is scaled down until the target image sample is as long as the target replacement image sample; and the target replacement image is determined.
  • the target replacement image sample is scaled down until the target replacement image sample is as long as the target image sample; determining the target replacement image sample Whether the width is smaller than the width of the target image sample; if it is determined that the width of the target replacement image sample is smaller than the width of the target image sample, the width value of the target replacement image sample is assigned to the target image sample In the case of determining that the width of the target replacement image sample is not less than the width of the target image sample, the width of the target image sample is Alternatively the target value given image sample FIG.
  • the assigning the width value of the target replacement image sample to the target image sample includes: uniformly cropping up and down centering on a width center line of the target image sample, so that the target image sample is The target replaces the image sample image by the same width; the assigning the width value of the target image sample to the target replacement image sample includes: uniformly cropping the center line of the width of the image of the target replacement image, so that the target replaces the image The sample image is as wide as the target image sample.
  • the method before the target image in the image to be identified is replaced with the target replacement image sample, the method further includes: spatially transforming the target image in the acquired image to be recognized according to the acquired image The information corrects the spatial form of the target replacement image sample, wherein the spatial transformation information includes displacement information, expansion and contraction information, and rotation information.
  • Embodiments of the present invention provide a computer readable storage medium storing computer executable instructions that are implemented by a processor to implement the target image recognition method described above.
  • a target image recognition apparatus including: a matching module configured to match a target image sample image with an image to be recognized, to obtain a target image sample matching point and a to-be-recognized image in which a correspondence relationship exists.
  • the target image sample includes a target image sample
  • the first recognition module is configured to match the corresponding image according to the target image sample in a case where the image to be recognized has at most one target image
  • a target image to be recognized identifies a target image in the image to be recognized, wherein the target image has the same scale as the target image sample
  • the second recognition module is configured to: in the image that cannot be determined In the case where there is one target image or multiple target images, or in the case where it is determined that there are multiple target images in an image to be recognized, the matching points of the image to be identified are clustered, and the image matching point group to be identified is obtained. And identifying the image to be recognized according to the target image sample matching point and the corresponding image matching point group to be identified Target image.
  • the apparatus further includes: an acquisition module configured to acquire a target replacement image proof; and a replacement module configured to replace the target image in the image to be recognized with the target replacement image proof.
  • Another embodiment of the present invention provides an electronic device including a processor and a storage unit configured to execute program instructions in the storage unit, the instructions including: performing a target image sample and an image to be identified Matching, obtaining a target image sample matching point and a matching image matching point in a corresponding relationship, wherein the target image sample image includes a target image sample; in a case where the image to be recognized has at most one target image, according to The target image sample matching point and the corresponding one of the to-be-identified image matching points identify the target image in the image to be recognized, wherein the target image has the same scale as the target image sample; In the case where there is one target image or multiple target images in the image, or in the case where it is determined that there are multiple target images in the image to be identified, the matching points of the image to be identified are clustered, and the image to be recognized is matched. Point group; identifying each point to be matched according to the target image sample matching point and the corresponding image to be identified Do not image the target image.
  • the target image sample map and the image to be recognized are matched to obtain a target image sample matching point and a matching image matching point, wherein the target image sample matching point and the to-be-identified image matching point are obtained.
  • the target image sample includes a target image sample; the image matching points of the image to be identified are clustered to obtain a matching image group to be identified; and the target image matching point matches the corresponding image to be identified according to the target image
  • the point group identifies the target image in the image to be identified, wherein the target image has the same scale technical solution as the target image sample, thereby improving the accuracy and accuracy of the image recognition.
  • FIG. 1 is a flow chart of a target image recognition method according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the structure of a target image recognition apparatus according to an embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of a target image recognition apparatus according to an embodiment of the present invention.
  • FIG. 4 is a block diagram showing the structure of an electronic device according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a target image replacement method according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a target image recognition method according to an embodiment of the present invention. As shown in FIG. 1, the method includes steps S102 to S106.
  • Step S102 Matching the target image sample image with the image to be identified, and obtaining a target image sample matching point and a matching image matching point, wherein the target image sample matching point and the to-be-identified image matching point have a corresponding relationship,
  • the target image sample includes the target image sample.
  • the method before the matching the target image sample image with the image to be identified, the method further includes: acquiring the target image sample image; identifying the target image sample from the target image sample image; determining the An outer contour point vector of the target image proof, wherein the outer contour is used to demarcate the target image proof and background.
  • an image recognition algorithm is used to perform target recognition on the target image sample and the target replacement image sample, respectively, and the boundary position between the target and the background is saved as the target outer contour point vector.
  • the target image proof and background boundaries may be delimited using a region growing and watershed algorithm or a grayscale threshold algorithm.
  • the matching method may be: matching the target image sample image with a to-be-matched image sequentially selected from the image to be identified, until all the images to be matched are matched; the target image sample and the image are matched.
  • the matching of the to-be-matched images sequentially selected in the to-be-identified image comprises: acquiring the feature vector of the image to be matched and the target image sample respectively; and selecting a feature vector of the target image sample and a feature of the image to be matched The vector is matched to obtain the target image sample matching point and the matching image matching point in which the correspondence relationship exists.
  • the feature vector of the target image sample is matched with the feature vector of the image to be matched by a Bruce Force algorithm.
  • the image to be matched and the feature vector of the target image sample may be respectively acquired by: extracting a key point of the image to be matched and a key point of the target image sample; And acquiring a feature vector of the image to be matched according to a key point of the image to be matched; acquiring a feature vector of the target image sample according to a key point of the target image sample.
  • a key point of the image to be matched and a key point of the target image sample are extracted by a scale invariant feature transform algorithm (SIFT algorithm) or a fast robust feature algorithm (SURF algorithm).
  • SIFT algorithm scale invariant feature transform algorithm
  • SURF algorithm fast robust feature algorithm
  • the target image sample image is matched with the image to be recognized, and the target image sample matching point and the image matching point to be identified are obtained, the target image sample that is successfully matched is obtained. The correctness of the matching relationship between the matching point and the image matching point to be identified is detected.
  • mismatch verification on the target image sample matching point and the to-be-identified image matching point by using a European threshold method or an optimal node priority BBF algorithm, wherein the error matching verification is used to verify the target image sample matching The correctness of the matching relationship between the point and the image matching point to be identified; in the case where the verification does not pass the error matching verification, the target image sample matching point with the matching matching error is deleted and the image to be recognized is matched point.
  • Step S104 in a case where the image to be recognized has at most one target image, the target image in the image to be recognized is identified according to the target image matching point and the corresponding matching image of the image to be recognized, wherein The target image has the same scale as the target image sample.
  • Step S106 in the case that it is impossible to determine whether there is one target image or a plurality of target images in an image to be recognized, or in the case of determining that a plurality of target images exist in a to-be-identified image, matching the image to be identified
  • the points are clustered to obtain a group of image matching points to be identified; and the target image in the image to be recognized is identified according to the target image sample matching point and the corresponding image matching point group to be identified.
  • the target image is identical in scale to the target image sample, that is, the target image is the same as the image of the target image sample.
  • the target image and the target image proof may be the same image, or may be the same image after rotation, scaling, and brightness change.
  • the matching points may be clustered.
  • the matching points of the image to be identified must be clustered to obtain a matching point group of the image to be identified.
  • step S104 refers to a situation in which it is impossible to determine whether one target image or a plurality of target images exist in an image to be recognized, or to determine that there are multiple images in a to-be-identified image. The case of the target image.
  • a K-means clustering algorithm is used for matching point aggregation.
  • a mean shift clustering algorithm is employed.
  • the target image region in each image to be recognized is determined according to the target image sample matching point and the corresponding image matching point group to be recognized; according to the target image sample image The target image is determined in the target image area.
  • a transformation matrix is obtained according to a transformation relationship between the target image sample matching point and the corresponding image matching point group to be identified; and the outer contour point vector of the transformation matrix and the target image sample is determined by the transformation matrix The target image area in each image to be recognized.
  • determining the target image from the target image region according to the target image sample image includes: determining whether a similarity between the target image sample image and the target image region is greater than a threshold; If the similarity between the target image sample and the target image region is greater than a threshold, determining that the matching is successful; and determining that the similarity between the target image sample and the target image region is not greater than a threshold, determining The match failed.
  • a manner of determining whether the similarity between the target image sample and the target image region is greater than a threshold is respectively acquiring texture information of the target image sample and the target image region; according to the target image sample The texture information and the texture information of the target image region determine a similarity between the target image sample and the target image region; and determine whether the similarity between the target image sample and the target image region is greater than a threshold.
  • the method further includes: acquiring the target Substituting the image proof; replacing the target image in the image to be recognized with the target replacement image proof.
  • acquiring the target replacement image sample includes: acquiring a target replacement image sample; identifying the target replacement image sample from the target replacement image sample; determining an outer contour of the target replacement image sample A point vector, wherein the outer contour is used to replace the target image with the background and the background.
  • the target image sample is subjected to a normalization process, wherein the normalization process is used to unify the size of the target replacement image sample and the target image sample.
  • the normalization processing rule may be based on the number of "small", for example, the target image sample image is smaller than the target replacement image sample length, then the target replacement image sample length is adjusted to The same length as the target image sample.
  • the process of normalizing the target replacement image sample image and the target image sample image is as follows: determining whether the length of the target replacement image sample image is smaller than the target image sample image a length; if it is determined that the length of the target replacement image sample is smaller than the length of the target image sample, the target image sample is scaled down until the target image sample and the target replacement image are The equal length of the map; in the case of determining that the length of the target replacement image sample is not less than the length of the target image sample, scaling down the target replacement image sample until the target replacement image sample and the The target image sample is equal in length; determining whether the width of the target replacement image sample is smaller than the width of the target image sample; and determining that the width of the target replacement image sample is smaller than the width of the target image image
  • assigning a width value of the target replacement image sample to the target image sample includes: uniformly cropping up and down centering on a width center line of the target image sample, such that the target image The sample image is equal to the target replacement image sample image; and the assigning the width value of the target image sample image to the target replacement image sample image includes: centering on a width center line of the target replacement image sample image Uniform cropping such that the target replacement image sample is as wide as the target image sample.
  • the method before the replacing the target image in the image to be identified with the target replacement image proof, the method further includes: according to the acquired image in each of the to-be-identified images
  • the spatial transformation information of the target image corrects a spatial form of the target replacement image sample, wherein the spatial transformation information includes displacement information, expansion and contraction information, and rotation information.
  • Embodiments of the present invention provide a computer readable storage medium storing computer executable instructions that are implemented by a processor to implement the target image recognition method described above.
  • FIG. 2 is a structural block diagram of a target image recognition apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
  • the matching module 22 is configured to match the target image sample image with the image to be identified, to obtain a target image sample matching point and a matching image matching point that have a corresponding relationship, wherein the target image sample image includes the target image sample;
  • the first identification module 24 is configured to identify, in the image to be recognized, the target image matching point and the corresponding one of the to-be-identified image matching points in a case where the image to be recognized has at most one target image a target image, wherein the target image has the same scale as the target image sample;
  • the second identification module 26 is configured to: in a case where it is impossible to determine whether there is one target image or a plurality of target images in an image to be recognized, or in a case where it is determined that a plurality of target images exist in one image to be recognized,
  • the image matching points of the to-be-identified image are clustered to obtain an image matching point group to be identified; and the target image in the to-be-identified image is identified according to the target image sample matching point and the corresponding matching image matching point group.
  • "otherwise” refers to a case where it is impossible to judge whether there is one target image or a plurality of target images in an image to be recognized, or a case where there are a plurality of target images in an image to be recognized. .
  • FIG. 3 is a structural block diagram of a target image recognition apparatus according to an embodiment of the present invention. As shown in FIG. 3, the apparatus further includes:
  • the obtaining module 32 is configured to obtain a target replacement image sample
  • the replacement module 34 is arranged to replace the target image in the image to be recognized with the target replacement image proof.
  • the electronic device includes a processor 42 and a storage unit 44, and the processor 42 is configured to execute program instructions in the storage unit 44.
  • the instruction comprises: matching the target image sample image with the image to be identified, obtaining a target image sample matching point and a matching image matching point of the corresponding relationship, wherein the target image sample image includes the target image sample;
  • the target image in the image to be recognized is identified according to the target image matching point and the corresponding matching image of the image to be recognized, wherein the target image and the target image
  • the target image proofs have the same scale; in the case where it is impossible to judge whether there is one target image or a plurality of target images in one image to be recognized, or in the case of determining that there are multiple target images in one image to be recognized,
  • the image matching points of the to-be-identified image are clustered to obtain a matching point group of the image to
  • "otherwise” refers to a case where it is impossible to judge whether there is one target image or a plurality of target images in an image to be recognized, or a case where there are a plurality of target images in an image to be recognized. .
  • FIG. 5 is a flowchart of a target image replacement method according to an embodiment of the present invention. As shown in FIG. 5, the method includes the following steps:
  • Step S502 acquiring a target replacement image sample image and a target image sample image
  • Step S504 performing target recognition and normalization processing on the target image sample and the target replacement image sample, respectively, to obtain a target image standard map and a target replacement image standard map;
  • Step S506 the target image standard map is sequentially matched with the image to be identified to obtain a matching point
  • Step S508 clustering matching points of the image to be identified to obtain one or more matching point groups
  • Step S510 identifying a target area in the image to be identified according to a vector transformation relationship between the target image standard map matching point and the corresponding matching point group of the to-be-processed source image;
  • Step S512 performing secondary matching on the target image standard map and the target area identified in the image to be identified, and removing the invalid matching area;
  • Step S514 converting the target area in the target replacement image standard map into the target replacement image proof according to the vector transformation relationship between the target image standard map matching point and the corresponding qualified matching point group of the image to be identified;
  • step S5166 the target replacement image sample is replaced with the target area in the image to be recognized, and saved.
  • computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
  • Computer storage media include, but are not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), and Electrically Erasable Programmable Read-only Memory (EEPROM). Flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
  • the electronic device, the target image recognition method and device provided by the embodiments of the invention improve the accuracy and accuracy of image recognition.

Landscapes

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

Abstract

电子设备、目标图像识别方法及装置,其中该方法包括:将目标图像样图与待识别图像进行匹配,得到目标图像样图匹配点和待识别图像匹配点;在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像;否则,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像。

Description

电子设备、目标图像识别方法及装置 技术领域
本发明实施例涉及但不限于数据网络通信领域,尤其是电子设备、目标图像识别方法及装置。
背景技术
视频或图片作为信息存储与展现的手段越来越广泛地被使用。每一帧视频画面或每张图片都可以归结为一副图像。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
图像内容很多时候并没有像文档内容那样容易查找和修改,将图像的局部内容,例如感兴趣的目标,替换为新的内容,实现难度较大。实现这一操作的关键点有三个:目标识别、目标匹配、目标替换。往往是人工识别目标,接着通过抠图工具将目标分割出来,然后替换为新的内容。也有一些算法可以在一定程度上将已知区域或者特定目标识别与替换,例如显示屏滚动字母区域识别替换、视频中插播的整屏或者局部屏幕广告画面识别替换、人脸等特殊目标识别替换。由于目标以及边界容易获取,且目标姿态未曾考虑,不适用于通用的预知信息更少的目标识别替换。上述技术虽然能够实现图像识别和替换,但是其存在如下缺点:只能对特定图像区域或者已知特征的图像目标区域进行识别替换。对于无先验知识的图像普通目标区域的识别替换,则主要依赖人工进行,效率极低。
本发明实施例提供了提供了电子设备、目标图像识别方法及装置。
本发明的实施例提供一种目标图像识别方法,包括:将目标图像样图与待识别图像进行匹配,得到目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图匹配点和该待识别图像匹配点存在对应关系,该目标图像样 图中包括目标图像样张;在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度;在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群,根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像。
在示例性的实施方式中,在该将目标图像样图与待识别图像进行匹配之前,该方法还包括:获取该目标图像样图;从该目标图像样图中识别出该目标图像样张;确定该目标图像样张的外轮廓点向量,其中,该外轮廓用于将该目标图像样张和背景分界。
在示例性的实施方式中,该将目标图像样图与待识别图像进行匹配,得到该目标图像样图匹配点和该待识别图像匹配点包括:将该目标图像样图与从该待识别图像中依次选择出来的一幅待匹配图像进行匹配,直至所有待匹配图像均进行匹配;该将该目标图像样图与从该待识别图像中依次选择出来的一幅待匹配图像进行匹配包括:分别获取该待匹配图像和该目标图像样图的特征向量;将该目标图像样图的特征向量与该待匹配图像的特征向量进行匹配,得到存在对应关系的该目标图像样图匹配点和该待匹配图像匹配点。
在示例性的实施方式中,通过暴风算法Brute Force算法将该目标图像样图的特征向量与该待匹配图像的特征向量进行匹配。
在示例性的实施方式中,该分别获取该待匹配图像和该目标图像样图的特征向量包括:提取该待匹配图像的关键点和该目标图像样图的关键点;根据该待匹配图像的关键点获取该待匹配图像的特征向量;根据该目标图像样图的关键点获取该目标图像样图的特征向量。
在示例性的实施方式中,通过尺度不变特征变换(Scale-invariant feature transform,简称为SIFT)算法或快速鲁棒特征(Speed Up Robust Features,简称为SURF)算法提取该待匹配图像的关键点和该目标图像样图的关键点。
在示例性的实施方式中,在该将目标图像样图与待识别图像进行匹配,得到该目标图像样图匹配点和该待识别图像匹配点之后,该方法还包括:通 过欧式阈值法或最优节点优先(Best Bin First,简称为BBF)算法对该目标图像样图匹配点和该待识别图像匹配点进行误匹配验证,其中,该误匹配验证用于验证该目标图像样图匹配点和该待识别图像匹配点的匹配关系的正确性;在验证存在未通过该误匹配验证的情况下,删除匹配关系错误的该目标图像样图匹配点和该待识别图像匹配点。
在示例性的实施方式中,该根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像包括:根据该目标图像样图匹配点与对应的该待识别图像匹配点群确定出每幅待识别图像中的目标图像区域;根据该目标图像样图从该目标图像区域中确定目标图像。
在示例性的实施方式中,该根据该目标图像样图匹配点与对应的该待识别图像匹配点群确定出每幅待识别图像中的目标图像区域包括:根据该目标图像样图匹配点与对应的该待识别图像匹配点群的变换关系得到变换矩阵;通过该变换矩阵和目标图像样张的外轮廓点向量确定出每幅待识别图像中的目标图像区域。
在示例性的实施方式中,该根据该目标图像样图从该目标图像区域中确定目标图像包括:判断该目标图像样图和该目标图像区域的相似度是否大于阈值;在判断该目标图像样图和该目标图像区域的相似度大于阈值的情况下,确定匹配成功;在判断该目标图像样图和该目标图像区域的相似度不大于阈值的情况下,确定匹配失败。
在示例性的实施方式中,该判断该目标图像样图和该目标图像区域的相似度是否大于阈值包括:分别获取该目标图像样图和该目标图像区域的纹理信息;根据该目标图像样图的纹理信息与该目标图像区域的纹理信息确定该目标图像样图和该目标图像区域的相似度;判断该目标图像样图和该目标图像区域的相似度是否大于阈值。
在示例性的实施方式中,在该根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像之后,该方法还包括:获取目标替换图像样张;将该待识别图像中的目标图像替换为该目标替换图像样张。
在示例性的实施方式中,该获取目标替换图像样张包括:获取目标替换 图像样图;从该目标替换图像样图中识别出该目标替换图像样张;确定该目标替换图像样张的外轮廓点向量,其中,该外轮廓用于将该目标替换图像样张和背景分界。
在示例性的实施方式中,在该获取目标替换图像样张之后,该将该待识别图像中的目标图像替换为该目标替换图像样张之前,该方法还包括:将该目标替换图像样图和该目标图像样图进行归一化处理,其中,该归一化处理用于统一该目标替换图像样图和该目标图像样图的大小。
在示例性的实施方式中,该将该目标替换图像样图和该目标图像样图进行归一化处理包括:判断该目标替换图像样图的长度是否小于该目标图像样图的长度;在判断该目标替换图像样图的长度小于该目标图像样图的长度的情况下,等比例缩小该目标图像样图直至该目标图像样图与该目标替换图像样图等长;在判断该目标替换图像样图的长度不否小于该目标图像样图的长度的情况下,等比例缩小该目标替换图像样图直至该目标替换图像样图与该目标图像样图等长;判断该目标替换图像样图的宽度是否小于该目标图像样图的宽度;在判断该目标替换图像样图的宽度小于该目标图像样图的宽度的情况下,将该目标替换图像样图的宽度值赋予该目标图像样图;在判断该目标替换图像样图的宽度不小于该目标图像样图的宽度的情况下,将该目标图像样图的宽度值赋予该目标替换图像样图。
在示例性的实施方式中,该将该目标替换图像样图的宽度值赋予该目标图像样图包括:以该目标图像样图的宽度中心线为中心上下均匀裁剪,使得该目标图像样图与该目标替换图像样图等宽;该将该目标图像样图的宽度值赋予该目标替换图像样图包括:以该目标替换图像样图的宽度中心线为中心上下均匀裁剪,使得该目标替换图像样图与该目标图像样图等宽。
在示例性的实施方式中,在该将该待识别图像中的目标图像替换为该目标替换图像样张之前,该方法还包括:根据获取到的该每幅待识别图像中的目标图像的空间变换信息修正该目标替换图像样张的空间形态,其中,该空间变换信息包括位移信息、伸缩信息和旋转信息。
本发明实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现上述的目标图像识别方法。
本发明的另一实施例提供一种目标图像识别装置,包括:匹配模块,设置成将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图中包括目标图像样张;第一识别模块,设置成在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度;第二识别模块,设置成:在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像。
在示例性的实施方式中,该装置还包括:获取模块,设置成获取目标替换图像样张;替换模块,设置成将该待识别图像中的目标图像替换为该目标替换图像样张。
本发明的另一个实施例提供一种电子设备,包括处理器和存储单元,该处理器被配置为执行该存储单元中的程序指令,该指令包括:将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图中包括目标图像样张;在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度;在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别每幅待识别图像中的目标图像。
通过本发明的实施例,采用将目标图像样图与待识别图像进行匹配,得到目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图匹配点和该待识别图像匹配点存在对应关系,该目标图像样图中包括目标图像样张;对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图 像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度的技术方案,提高图像识别的准确度和精确度。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1是根据本发明实施例的目标图像识别方法的流程图;
图2是根据本发明实施例的目标图像识别装置的结构框图;
图3是根据本发明实施例的目标图像识别装置的结构框图;
图4是根据本发明实施例的电子设备的结构框图;
图5是根据本发明实施例的目标图像替换方法的流程图。
本发明的实施方式
下文中将参考附图并结合实施例来详细说明本公开。
在本实施例中提供了电子设备、目标图像识别方法及装置,图1是根据本发明实施例的目标图像识别方法的流程图,如图1所示,该方法包括步骤S102-步骤S106。
步骤S102,将目标图像样图与待识别图像进行匹配,得到目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图匹配点和该待识别图像匹配点存在对应关系,该目标图像样图中包括目标图像样张。
在示例性的实施方式中,在将目标图像样图与待识别图像进行匹配之前,该方法还包括:获取该目标图像样图;从该目标图像样图中识别出该目标图像样张;确定该目标图像样张的外轮廓点向量,其中,该外轮廓用于将该目标图像样张和背景分界。在示例性的实施方式中,采用图像识别算法分别对目标图像样图和目标替换图像样图进行目标识别,将目标和背景之间的分界线位置保存为目标外轮廓点向量。在示例性的实施方式中,可以使用区域生长与分水岭算法或者灰度阈值算法对目标图像样张和背景分界进行分界。
在示例性的实施方式中,存在不止一幅待识别图像,该将目标图像样图与待识别图像进行匹配,得到该目标图像样图匹配点和该待识别图像匹配点包括,将待识别图像依次与目标图像样图进行匹配,并得到每幅待识别图像与目标图像样图的匹配点。
选择目标图像样图与待识别图像中的一幅图像作为待匹配图像,分别提取目标图像样图和待识别图像的关键点,并分别计算得到目标图像样图特征向量和待识别图像特征向量,通过图像匹配算法得到目标图像样图特征向量和待识别图像特征向量的匹配点。换言之,匹配方法可以为:将该目标图像样图与从该待识别图像中依次选择出来的一幅待匹配图像进行匹配,直至所有待匹配图像均进行匹配;该将该目标图像样图与从该待识别图像中依次选择出来的一幅待匹配图像进行匹配包括:分别获取该待匹配图像和该目标图像样图的特征向量;将该目标图像样图的特征向量与该待匹配图像的特征向量进行匹配,得到存在对应关系的该目标图像样图匹配点和该待匹配图像匹配点。
在示例性的实施方式中,通过Brute Force算法将所述目标图像样图的特征向量与所述待匹配图像的特征向量进行匹配。
在示例性的实施方式中,可以通过如下方式分别获取该待匹配图像和该目标图像样图的特征向量:提取所述待匹配图像的关键点和所述目标图像样图的关键点;根据所述待匹配图像的关键点获取所述待匹配图像的特征向量;根据所述目标图像样图的关键点获取所述目标图像样图的特征向量。在示例性的实施方式中,通过尺度不变特征变换算法(SIFT算法)或快速鲁棒特征算法(SURF算法)提取所述待匹配图像的关键点和所述目标图像样图的关键点。
在示例性的实施方式中,在所述将目标图像样图与待识别图像进行匹配,得到所述目标图像样图匹配点和所述待识别图像匹配点之后,对匹配成功的目标图像样图匹配点和待识别图像匹配点的匹配关系正确性进行检测。
通过欧式阈值法或最优节点优先BBF算法对所述目标图像样图匹配点和所述待识别图像匹配点进行误匹配验证,其中,所述误匹配验证用于验证所述目标图像样图匹配点和所述待识别图像匹配点的匹配关系的正确性;在 验证存在未通过所述误匹配验证的情况下,删除匹配关系错误的所述目标图像样图匹配点和所述待识别图像匹配点。
步骤S104,在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度。
步骤S106,在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像。
上述目标图像与所述目标图像样张在尺度上相同,即目标图像与目标图像样张的图形相同。可以分成两种情形:所述目标图像与所述目标图像样张可以是相同的图像,也可以是发生旋转、缩放、亮度变化后相同的图像。
在示例性的实施方式中,在确定每幅待识别图像中最多只有一个目标图像的情况下,可以对匹配点进行聚类处理。在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,必须对该待识别图像匹配点进行聚类,得到待识别图像匹配点群。
在示例性的实施方式中,步骤S104中的“否则”指的是无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况,或者是判断一幅待识别图像中存在多个目标图像的情况。
在示例性的实施方式中,在对待识别图像匹配点进行聚类处理时,如果可以确定每幅待识别图像中目标图像的个数,采用K均值(k-means)聚类算法进行匹配点聚类,如果不能确定每幅待识别图像中目标图像的个数,则采用均值漂移(meanshift)聚类算法。
在示例性的实施方式中,根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群确定出每幅待识别图像中的目标图像区域;根据所述目标图像样图从所述目标图像区域中确定目标图像。
在示例性的实施方式中,根据所述目标图像样图匹配点与对应的所述待 识别图像匹配点群的变换关系得到变换矩阵;通过所述变换矩阵和目标图像样张的外轮廓点向量确定出每幅待识别图像中的目标图像区域。
在示例性的实施方式中,上述根据所述目标图像样图从所述目标图像区域中确定目标图像包括:判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值;在判断所述目标图像样图和所述目标图像区域的相似度大于阈值的情况下,确定匹配成功;在判断所述目标图像样图和所述目标图像区域的相似度不大于阈值的情况下,确定匹配失败。
一种判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值的方式为分别获取所述目标图像样图和所述目标图像区域的纹理信息;根据所述目标图像样图的纹理信息与所述目标图像区域的纹理信息确定所述目标图像样图和所述目标图像区域的相似度;判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值。
值得一提的是,在所述根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像之后,可以对识别出来的目标图像进行图像替换。在示例性的实施方式中,在所述根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像之后,该方法还包括:获取目标替换图像样张;将所述待识别图像中的目标图像替换为所述目标替换图像样张。
在示例性的实施方式中,获取目标替换图像样张包括:获取目标替换图像样图;从所述目标替换图像样图中识别出所述目标替换图像样张;确定所述目标替换图像样张的外轮廓点向量,其中,所述外轮廓用于将所述目标替换图像样张和背景分界。
在示例性的实施方式中,在所述获取目标替换图像样张之后,所述将所述待识别图像中的目标图像替换为所述目标替换图像样张之前,将所述目标替换图像样图和所述目标图像样图进行归一化处理,其中,所述归一化处理用于统一所述目标替换图像样图和所述目标图像样图的大小。
在示例性的实施方式中,归一化处理规则可以为以数量“小”的一方为准,例如目标图像样图比目标替换图像样图长度小,那么就将目标替换图像样图长度调整为目标图像样图一样的长度。在示例性的实施方式中,将所述 目标替换图像样图和所述目标图像样图进行归一化处理的流程如下:判断所述目标替换图像样图的长度是否小于所述目标图像样图的长度;在判断所述目标替换图像样图的长度小于所述目标图像样图的长度的情况下,等比例缩小所述目标图像样图直至所述目标图像样图与所述目标替换图像样图等长;在判断所述目标替换图像样图的长度不小于所述目标图像样图的长度的情况下,等比例缩小所述目标替换图像样图直至所述目标替换图像样图与所述目标图像样图等长;判断所述目标替换图像样图的宽度是否小于所述目标图像样图的宽度;在判断所述目标替换图像样图的宽度小于所述目标图像样图的宽度的情况下,将所述目标替换图像样图的宽度值赋予所述目标图像样图;在判断所述目标替换图像样图的宽度不小于所述目标图像样图的宽度的情况下,将所述目标图像样图的宽度值赋予所述目标替换图像样图。
在示例性的实施方式中,将所述目标替换图像样图的宽度值赋予所述目标图像样图包括:以所述目标图像样图的宽度中心线为中心上下均匀裁剪,使得所述目标图像样图与所述目标替换图像样图等宽;所述将所述目标图像样图的宽度值赋予所述目标替换图像样图包括:以所述目标替换图像样图的宽度中心线为中心上下均匀裁剪,使得所述目标替换图像样图与所述目标图像样图等宽。
在示例性的实施方式中,在所述将所述待识别图像中的目标图像替换为所述目标替换图像样张之前,所述方法还包括:根据获取到的所述每幅待识别图像中的目标图像的空间变换信息修正所述目标替换图像样张的空间形态,其中,所述空间变换信息包括位移信息、伸缩信息和旋转信息。
通过上述步骤,提高图像识别的准确度和精确度。
本发明实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现上述的目标图像识别方法。
图2是根据本发明实施例的目标图像识别装置的结构框图,如图2所示,该装置包括:
匹配模块22,设置成将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图中包括目标图像样张;
第一识别模块24,设置成在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度;
第二识别模块26,设置成:在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别该待识别图像中的目标图像。
在示例性的实施方式中,“否则”指的是无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况,或者是判断一幅待识别图像中存在多个目标图像的情况。
图3是根据本发明实施例的目标图像识别装置的结构框图,如图3所示,该装置还包括:
获取模块32,设置成获取目标替换图像样张;
替换模块34,设置成将该待识别图像中的目标图像替换为该目标替换图像样张。
图4是根据本发明实施例的电子设备的结构框图,如图4所示,该电子设备包括处理器42和存储单元44,该处理器42被配置为执行该存储单元44中的程序指令,该指令包括:将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,该目标图像样图中包括目标图像样张;在一幅该待识别图像最多有一幅目标图像的情况下,根据该目标图像样图匹配点与对应的一幅该待识别图像匹配点识别该待识别图像中的目标图像,其中,该目标图像与该目标图像样张具有相同的尺度;在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对该待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据该目标图像样图匹配点与对应的该待识别图像匹配点群识别每幅待识别图像中的目标图像。
在示例性的实施方式中,“否则”指的是无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况,或者是判断一幅待识别图像中存在多个目标图像的情况。
下面结合实施例对本公开进行进一步说明。
图5是根据本发明实施例的目标图像替换方法的流程图,如图5所示,该方法包括以下步骤:
步骤S502,获取目标替换图像样图和目标图像样图;
步骤S504,分别对目标图像样图和目标替换图像样图进行目标识别并归一化处理,得到目标图像标准图和目标替换图像标准图;
步骤S506,将目标图像标准图依次与待识别图像进行匹配并得到匹配点;
步骤S508,将待识别图像的匹配点聚类,得到一个或多个匹配点群;
步骤S510,依据目标图像标准图匹配点分别与待处理源图像的对应匹配点群之间的向量变换关系,在待识别图像中识别出目标区域;
步骤S512,将目标图像标准图和待识别图像中识别出的目标区域进行二次匹配,去除无效匹配区域;
步骤S514,依据目标图像标准图匹配点分别与待识别图像的对应合格匹配点群之间的向量变换关系,将目标替换图像标准图中的目标区域变换为目标替换图像样张;
步骤S516,将目标替换图像样张替换到待识别图像中的目标区域,并保存。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质) 和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(RAM,Random Access Memory)、只读存储器(ROM,Read-Only Memory)、电可擦除只读存储器(EEPROM,Electrically Erasable Programmable Read-only Memory)、闪存或其他存储器技术、光盘只读存储器(CD-ROM,Compact Disc Read-Only Memory)、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
本领域的普通技术人员可以理解,可以对本公开的技术方案进行修改或者等同替换,而不脱离本公开技术方案的精神和范围,均应涵盖在本公开的权利要求范围当中。
工业实用性
通过本发明实施例提供的电子设备、目标图像识别方法及装置,提高了图像识别的准确度和精确度。

Claims (20)

  1. 一种目标图像识别方法,包括:
    将目标图像样图与待识别图像进行匹配,得到目标图像样图匹配点和待识别图像匹配点,其中,所述目标图像样图匹配点和所述待识别图像匹配点存在对应关系,所述目标图像样图中包括目标图像样张;
    在一幅所述待识别图像最多有一幅目标图像的情况下,根据所述目标图像样图匹配点与对应的一幅所述待识别图像匹配点识别所述待识别图像中的目标图像,其中,所述目标图像与所述目标图像样张具有相同的尺度;
    在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对所述待识别图像匹配点进行聚类,得到待识别图像匹配点群,根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像。
  2. 根据权利要求1所述的方法,在所述将目标图像样图与待识别图像进行匹配之前,所述方法还包括:
    获取所述目标图像样图;
    从所述目标图像样图中识别出所述目标图像样张;
    确定所述目标图像样张的外轮廓点向量,其中,所述外轮廓用于将所述目标图像样张和背景分界。
  3. 根据权利要求1所述的方法,其中,所述将目标图像样图与待识别图像进行匹配,得到所述目标图像样图匹配点和所述待识别图像匹配点包括:
    将所述目标图像样图与从所述待识别图像中依次选择出来的一幅待匹配图像进行匹配,直至所有待匹配图像均进行匹配;
    所述将所述目标图像样图与从所述待识别图像中依次选择出来的一幅待匹配图像进行匹配包括:
    分别获取所述待匹配图像和所述目标图像样图的特征向量;
    将所述目标图像样图的特征向量与所述待匹配图像的特征向量进行匹配, 得到存在对应关系的所述目标图像样图匹配点和所述待匹配图像匹配点。
  4. 根据权利要求3所述的方法,其中,通过暴风算法Brute Force算法将所述目标图像样图的特征向量与所述待匹配图像的特征向量进行匹配。
  5. 根据权利要求3所述的方法,其中,所述分别获取所述待匹配图像和所述目标图像样图的特征向量包括:
    提取所述待匹配图像的关键点和所述目标图像样图的关键点;
    根据所述待匹配图像的关键点获取所述待匹配图像的特征向量;
    根据所述目标图像样图的关键点获取所述目标图像样图的特征向量。
  6. 根据权利要求5所述的方法,其中,通过尺度不变特征变换SIFT算法或快速鲁棒特征SURF算法提取所述待匹配图像的关键点和所述目标图像样图的关键点。
  7. 根据权利要求1所述的方法,在所述将目标图像样图与待识别图像进行匹配,得到所述目标图像样图匹配点和所述待识别图像匹配点之后,所述方法还包括:
    通过欧式阈值法或最优节点优先BBF算法对所述目标图像样图匹配点和所述待识别图像匹配点进行误匹配验证,其中,所述误匹配验证用于验证所述目标图像样图匹配点和所述待识别图像匹配点的匹配关系的正确性;
    在验证存在未通过所述误匹配验证的情况下,删除匹配关系错误的所述目标图像样图匹配点和所述待识别图像匹配点。
  8. 根据权利要求2所述的方法,其中,所述根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像包括:
    根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群确定出每幅待识别图像中的目标图像区域;
    根据所述目标图像样图从所述目标图像区域中确定目标图像。
  9. 根据权利要求8所述的方法,其中,所述根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群确定出每幅待识别图像中的目标图像区域包括:
    根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群的变换关系得到变换矩阵;
    通过所述变换矩阵和目标图像样张的外轮廓点向量确定出每幅待识别图像中的目标图像区域。
  10. 根据权利要求8所述的方法,其中,所述根据所述目标图像样图从所述目标图像区域中确定目标图像包括:
    判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值;
    在判断所述目标图像样图和所述目标图像区域的相似度大于阈值的情况下,确定匹配成功;
    在判断所述目标图像样图和所述目标图像区域的相似度不大于阈值的情况下,确定匹配失败。
  11. 根据权利要求10所述的方法,其中,所述判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值包括:
    分别获取所述目标图像样图和所述目标图像区域的纹理信息;
    根据所述目标图像样图的纹理信息与所述目标图像区域的纹理信息确定所述目标图像样图和所述目标图像区域的相似度;
    判断所述目标图像样图和所述目标图像区域的相似度是否大于阈值。
  12. 根据权利要求1-11中任一项所述的方法,在所述根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像之后,所述方法还包括:
    获取目标替换图像样张;
    将所述待识别图像中的目标图像替换为所述目标替换图像样张。
  13. 根据权利要求12所述的方法,其中,所述获取目标替换图像样张包括:
    获取目标替换图像样图;
    从所述目标替换图像样图中识别出所述目标替换图像样张;
    确定所述目标替换图像样张的外轮廓点向量,其中,所述外轮廓用于将 所述目标替换图像样张和背景分界。
  14. 根据权利要求13所述的方法,在所述获取目标替换图像样张之后,所述将所述待识别图像中的目标图像替换为所述目标替换图像样张之前,所述方法还包括:
    将所述目标替换图像样图和所述目标图像样图进行归一化处理,其中,所述归一化处理用于统一所述目标替换图像样图和所述目标图像样图的大小。
  15. 根据权利要求14所述的方法,其中,所述将所述目标替换图像样图和所述目标图像样图进行归一化处理包括:
    判断所述目标替换图像样图的长度是否小于所述目标图像样图的长度;
    在判断所述目标替换图像样图的长度小于所述目标图像样图的长度的情况下,等比例缩小所述目标图像样图直至所述目标图像样图与所述目标替换图像样图等长;
    在判断所述目标替换图像样图的长度不小于所述目标图像样图的长度的情况下,等比例缩小所述目标替换图像样图直至所述目标替换图像样图与所述目标图像样图等长;
    判断所述目标替换图像样图的宽度是否小于所述目标图像样图的宽度;
    在判断所述目标替换图像样图的宽度小于所述目标图像样图的宽度的情况下,将所述目标替换图像样图的宽度值赋予所述目标图像样图;
    在判断所述目标替换图像样图的宽度不小于所述目标图像样图的宽度的情况下,将所述目标图像样图的宽度值赋予所述目标替换图像样图。
  16. 根据权利要求15所述的方法,其中,
    所述将所述目标替换图像样图的宽度值赋予所述目标图像样图包括:
    以所述目标图像样图的宽度中心线为中心上下均匀裁剪,使得所述目标图像样图与所述目标替换图像样图等宽;
    所述将所述目标图像样图的宽度值赋予所述目标替换图像样图包括:
    以所述目标替换图像样图的宽度中心线为中心上下均匀裁剪,使得所述目标替换图像样图与所述目标图像样图等宽。
  17. 根据权利要求12所述的方法,在所述将所述待识别图像中的目标图像替换为所述目标替换图像样张之前,所述方法还包括:
    根据获取到的所述每幅待识别图像中的目标图像的空间变换信息修正所述目标替换图像样张的空间形态,其中,所述空间变换信息包括位移信息、伸缩信息和旋转信息。
  18. 一种目标图像识别装置,包括:
    匹配模块,设置成将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,所述目标图像样图中包括目标图像样张;
    第一识别模块,设置成在一幅所述待识别图像最多有一幅目标图像的情况下,根据所述目标图像样图匹配点与对应的一幅所述待识别图像匹配点识别所述待识别图像中的目标图像,其中,所述目标图像与所述目标图像样张具有相同的尺度;
    第二识别模块,设置成:在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对所述待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别所述待识别图像中的目标图像。
  19. 根据权利要求18所述的方法,所述装置还包括:
    获取模块,设置成获取目标替换图像样张;
    替换模块,设置成将所述待识别图像中的目标图像替换为所述目标替换图像样张。
  20. 一种电子设备,包括处理器和存储单元,所述处理器被配置为执行所述存储单元中的程序指令,所述指令包括:
    将目标图像样图与待识别图像中进行匹配,得到存在对应关系的目标图像样图匹配点和待识别图像匹配点,其中,所述目标图像样图中包括目标图像样张;
    在一幅所述待识别图像最多有一幅目标图像的情况下,根据所述目标图 像样图匹配点与对应的一幅所述待识别图像匹配点识别所述待识别图像中的目标图像,其中,所述目标图像与所述目标图像样张具有相同的尺度;
    在无法判断一幅待识别图像中存在一个目标图像还是多个目标图像的情况下,或者是在判断一幅待识别图像中存在多个目标图像的情况下,对所述待识别图像匹配点进行聚类,得到待识别图像匹配点群;根据所述目标图像样图匹配点与对应的所述待识别图像匹配点群识别每幅待识别图像中的目标图像。
PCT/CN2017/117808 2016-12-30 2017-12-21 电子设备、目标图像识别方法及装置 WO2018121414A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611264125.0A CN108268881A (zh) 2016-12-30 2016-12-30 电子设备、目标图像识别方法及装置
CN201611264125.0 2016-12-30

Publications (1)

Publication Number Publication Date
WO2018121414A1 true WO2018121414A1 (zh) 2018-07-05

Family

ID=62707827

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/117808 WO2018121414A1 (zh) 2016-12-30 2017-12-21 电子设备、目标图像识别方法及装置

Country Status (2)

Country Link
CN (1) CN108268881A (zh)
WO (1) WO2018121414A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113066039A (zh) * 2019-12-12 2021-07-02 北京沃东天骏信息技术有限公司 图像主体识别的方法和装置
CN113075648A (zh) * 2021-03-19 2021-07-06 中国舰船研究设计中心 一种无人集群目标定位信息的聚类与滤波方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109316202B (zh) * 2018-08-23 2021-07-02 苏州佳世达电通有限公司 影像校正方法及检测装置
CN110751071A (zh) * 2019-10-12 2020-02-04 上海上湖信息技术有限公司 人脸识别方法及装置、存储介质、计算设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090110303A1 (en) * 2007-10-31 2009-04-30 Kabushiki Kaisha Toshiba Object recognizing apparatus and method
CN102930296A (zh) * 2012-11-01 2013-02-13 长沙纳特微视网络科技有限公司 一种图像识别方法及装置
CN104077569A (zh) * 2014-06-24 2014-10-01 纵横壹旅游科技(成都)有限公司 一种图像识别方法及系统
CN105844290A (zh) * 2016-03-16 2016-08-10 网易(杭州)网络有限公司 匹配图像中多个相同对象的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9465813B1 (en) * 2012-11-09 2016-10-11 Amazon Technologies, Inc. System and method for automatically generating albums
CN103679159B (zh) * 2013-12-31 2017-10-17 海信集团有限公司 人脸识别方法
CN105069457B (zh) * 2015-07-15 2020-02-11 杭州易现先进科技有限公司 图像识别方法和装置
CN106095806A (zh) * 2016-05-30 2016-11-09 宁波萨瑞通讯有限公司 一种自动匹配系统及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090110303A1 (en) * 2007-10-31 2009-04-30 Kabushiki Kaisha Toshiba Object recognizing apparatus and method
CN102930296A (zh) * 2012-11-01 2013-02-13 长沙纳特微视网络科技有限公司 一种图像识别方法及装置
CN104077569A (zh) * 2014-06-24 2014-10-01 纵横壹旅游科技(成都)有限公司 一种图像识别方法及系统
CN105844290A (zh) * 2016-03-16 2016-08-10 网易(杭州)网络有限公司 匹配图像中多个相同对象的方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113066039A (zh) * 2019-12-12 2021-07-02 北京沃东天骏信息技术有限公司 图像主体识别的方法和装置
CN113075648A (zh) * 2021-03-19 2021-07-06 中国舰船研究设计中心 一种无人集群目标定位信息的聚类与滤波方法
CN113075648B (zh) * 2021-03-19 2024-05-17 中国舰船研究设计中心 一种无人集群目标定位信息的聚类与滤波方法

Also Published As

Publication number Publication date
CN108268881A (zh) 2018-07-10

Similar Documents

Publication Publication Date Title
CN106355188B (zh) 图像检测方法及装置
JP5775225B2 (ja) マルチレイヤ連結成分をヒストグラムと共に用いるテキスト検出
CN109344727B (zh) 身份证文本信息检测方法及装置、可读存储介质和终端
WO2018121414A1 (zh) 电子设备、目标图像识别方法及装置
WO2020010547A1 (zh) 字符识别方法、装置、存储介质及电子设备
US9773322B2 (en) Image processing apparatus and image processing method which learn dictionary
WO2019042419A1 (zh) 图像跟踪点获取方法、设备及存储介质
US9934444B2 (en) Image processing apparatus, image processing method and computer-readable storage medium
EP2660753B1 (en) Image processing method and apparatus
WO2018233055A1 (zh) 保单信息录入的方法、装置、计算机设备及存储介质
CN109255300B (zh) 票据信息提取方法、装置、计算机设备及存储介质
CN111339979B (zh) 基于特征提取的图像识别方法及图像识别装置
JP6997369B2 (ja) プログラム、測距方法、及び測距装置
US20150146991A1 (en) Image processing apparatus and image processing method of identifying object in image
US9256792B2 (en) Image processing apparatus, image processing method, and program
US11281922B2 (en) Face recognition system, method for establishing data of face recognition, and face recognizing method thereof
US20210065350A1 (en) Computing device and non-transitory storage medium implementing target object identification method
US10796143B2 (en) Information processing apparatus, information processing system, and non-transitory computer readable medium
CN112287905A (zh) 车辆损伤识别方法、装置、设备及存储介质
CN112287763A (zh) 图像处理方法、装置、设备及介质
US10783649B2 (en) Aligning digital images by selectively applying pixel-adjusted-gyroscope alignment and feature-based alignment models
WO2019163699A1 (ja) 特徴抽出装置、特徴抽出方法、照合システム、および記憶媒体
US8417019B2 (en) Image correction system and method
JP2019021297A (ja) 画像処理装置及び方法、電子機器
US10380463B2 (en) Image processing device, setting support method, and non-transitory computer-readable media

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17887425

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17887425

Country of ref document: EP

Kind code of ref document: A1