WO2019136897A1 - 图像处理方法、装置、电子设备及存储介质 - Google Patents

图像处理方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2019136897A1
WO2019136897A1 PCT/CN2018/086905 CN2018086905W WO2019136897A1 WO 2019136897 A1 WO2019136897 A1 WO 2019136897A1 CN 2018086905 W CN2018086905 W CN 2018086905W WO 2019136897 A1 WO2019136897 A1 WO 2019136897A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
processed
historical
matching
feature vector
Prior art date
Application number
PCT/CN2018/086905
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 WO2019136897A1 publication Critical patent/WO2019136897A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • 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/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • G06V10/507Summing image-intensity values; Histogram projection analysis

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, and storage medium.
  • the embodiments of the present application provide an image processing method, apparatus, electronic device, and storage medium.
  • an embodiment of the present application provides an image processing method, where the method includes: obtaining an to-be-matched feature vector of the to-be-processed image based on an edge histogram descriptor of an image to be processed, wherein the edge histogram The descriptor is a distribution item in the edge histogram; the feature vector to be matched is matched with the historical feature vector of the historical image stored in the database to obtain a matching vector distance; and the image to be processed is obtained based on the matching vector distance The degree of repetition with the historical image.
  • the edge histogram descriptor based on the to-be-processed image obtains the to-be-matched feature vector of the to-be-processed image, including:
  • the obtaining the degree of repetition between the image to be processed and the historical image based on the matching vector distance includes:
  • a mapping between the matching vector distance and the repetition degree is performed to obtain a degree of repetition between the image to be matched and the historical image.
  • mapping between the matching vector distance and the repetition degree uses the following formula:
  • Dist max is the maximum matching distance
  • Dist j is the matching vector distance
  • Similar j is the repeating degree.
  • Dist max 10000 can be taken.
  • the method further includes:
  • the method further includes:
  • the image to be processed is associated with the historical image corresponding to the maximum degree of repetition.
  • the method further includes:
  • the historical data of the history image corresponding to the maximum repetition degree stored in the database is output.
  • the method further includes:
  • the feature vector of the image to be processed is stored as a historical feature vector.
  • performing the feature matching between the feature vector to be matched and the historical feature vector of the historical image stored in the database to obtain a matching vector distance including:
  • the matching the feature vector to be matched with the historical feature vector of the historical image stored in the database to obtain a matching vector distance further includes:
  • the to-be-matched feature vector is stored in the database as a historical feature vector of the historical image of the video stream.
  • the method before the obtaining the to-be-matched feature vector of the to-be-processed image based on the edge histogram descriptor of the to-be-processed image, the method further includes:
  • the video stream is video-decoded based on a preset video decoding algorithm to obtain the image to be processed.
  • an embodiment of the present application provides an image processing apparatus, where the apparatus includes a vector obtaining module, a feature matching module, and a repetition degree obtaining module, wherein the vector obtaining module is configured to be based on an edge histogram of an image to be processed. Determining a feature vector to be matched of the image to be processed, wherein the edge histogram descriptor is a distribution item in an edge histogram; the feature matching module is configured to store the to-be-matched feature vector and a database The historical feature vector of the historical image is feature-matched to obtain a matching vector distance; the repeatability obtaining module is configured to obtain a degree of repetition between the image to be processed and the historical image based on the matching vector distance.
  • the vector obtaining module includes a first data acquiring unit, a second data acquiring unit, and a vector generating unit, where
  • the first data acquiring unit is configured to obtain values of n distribution items in an edge histogram of the image to be processed based on n edge histogram descriptors;
  • the second data acquiring unit is configured to normalize values of the n distribution items to obtain n normalized data
  • the vector generation unit is configured to generate an n-dimensional feature vector based on the n normalized data to obtain the to-be-matched feature vector.
  • an embodiment of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores computer instructions, when the computer instructions are read and executed by the processor, The processor performs the image processing method provided by the above first aspect.
  • an embodiment of the present application provides a storage medium, where the computer instruction stores a computer instruction, wherein the computer instruction executes the image processing method provided by the first aspect when being read and executed.
  • the image processing method, the device, the electronic device and the storage medium provided by the embodiment of the present application obtain the to-be-matched feature vector of the to-be-processed image by using an edge histogram descriptor of the image to be processed, and then the feature vector to be matched and the database
  • the historical feature vectors of the stored historical images are feature-matched to obtain a matching vector distance, and then the degree of repetition between the image to be processed and the historical image is obtained based on the matching vector distance.
  • the image processing method, device, electronic device and storage medium obtain feature vectors by edge histogram descriptors, so that in the process of obtaining the degree of repetition between images, the structural information of the image content is considered, and the obtained images are repeated.
  • the accuracy is high, and the problem that the similarity between the two pictures cannot be accurately judged in the prior art is solved.
  • FIG. 1 is a block diagram showing an electronic device according to an embodiment of the present application
  • FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of step S110 in the image processing method provided by the embodiment of the present application.
  • FIG. 4 is a block diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 5 is a block diagram of a vector acquisition module in an image processing apparatus according to an embodiment of the present application.
  • FIG. 1 is a structural block diagram of an electronic device that can be applied to an embodiment of the present application.
  • the electronic device 100 includes a memory 102 , a memory controller 104 , one or more (only one shown) processor 106 , a peripheral interface 108 , a radio frequency module 110 , an audio module 112 , and a display unit 114 . Wait. These components communicate with one another via one or more communication bus/signal lines 116.
  • the memory 102 can be configured to store software programs and modules, such as image processing methods and apparatus corresponding to the program instructions/modules in the embodiments of the present application, and the processor 106 executes various programs by running software programs and modules stored in the memory 102.
  • Functional application and data processing such as the image processing method provided by the embodiments of the present application.
  • Memory 102 can include high speed random access memory and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. Access to the memory 102 by the processor 106 and other possible components can be performed under the control of the memory controller 104.
  • non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. Access to the memory 102 by the processor 106 and other possible components can be performed under the control of the memory controller 104.
  • Peripheral interface 108 couples various input/output devices to processor 106 and memory 102.
  • peripheral interface 108, processor 106, and memory controller 104 can be implemented in a single chip. In other instances, they can be implemented by separate chips.
  • the radio frequency module 110 is configured to receive and transmit electromagnetic waves, and realize mutual conversion between electromagnetic waves and electric signals, thereby communicating with a communication network or other devices.
  • the audio module 112 provides an audio interface to the user, which may include one or more microphones, one or more speakers, and audio circuitry.
  • the display unit 114 provides a display interface between the electronic device 100 and the user.
  • display unit 114 displays video output to the user, the content of which may include text, graphics, video, and any combination thereof.
  • FIG. 1 is merely illustrative, and the electronic device 100 may further include more or less components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the components shown in Figure 1 can be implemented in hardware, software, or a combination thereof.
  • FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application. Referring to Figure 2, the method includes:
  • Step S110 The processor obtains a to-be-matched feature vector of the to-be-processed image based on an edge histogram descriptor of the to-be-processed image, where the edge histogram descriptor is a distribution item in the edge histogram.
  • the image to be processed may be an image stored in a database, an image acquired from another terminal device, or a video image obtained from a video stream.
  • the video when the image to be processed is a video image in the video stream, the video may be video-decoded to obtain an image in the video.
  • a video image with high image repetition degree may exist in the video stream corresponding to the live broadcast (image repetition degree refers to two images, and the ratio of pixels at the same position is consistent; the higher the ratio, the higher the repetition rate ), so in order to de-emphasize the video image of the live broadcast of the live platform (image de-duplication refers to two images with higher pixel consistency, using image feature extraction and feature matching method to evaluate image content repeatability)
  • image feature extraction refers to the method and process of extracting characteristic information in images by using computer; image feature matching: refers to the matching method for calculating the registration between features by calculating the similarity between image features)
  • the processing method may further include:
  • the processor performs video decoding on a video stream based on a preset video decoding algorithm to obtain the image to be processed.
  • the preset video decoding algorithm may be an MPEG/H.264 video decoding algorithm, so that a video image in the video of the video stream can be obtained as the image to be processed.
  • the video image of the live broadcast is deduplicated, the video image of the video stream corresponding to the live broadcast may be video-decoded by using a video decoding algorithm to obtain an image to be processed.
  • the processor may be an image of the to-be-matched feature vector of the image to be processed, that is, an image feature of the image to be processed, based on an edge histogram descriptor of the image to be processed. Therefore, after the image to be processed is obtained, the image to be processed can be processed to obtain image features of the image to be processed.
  • the embodiment of the present application introduces an edge histogram descriptor based on the image content as an image feature, and the edge histogram descriptor is a distribution item in the edge histogram.
  • Edge histograms are an important way to extract image texture features, and the spatial distribution of edges can contain important texture information.
  • the edge histogram is also a type of MPEG-7 standard texture descriptor.
  • the edge histogram provides five types of texture edges: vertical edge texture, horizontal edge texture, 45 degree edge texture, 135 degree edge texture, and non-directional edge texture.
  • the image to be processed may be divided into 4*4 sub-blocks, and the local features of each sub-block may be represented by the edge distribution histogram formed, so the histogram will contain 5 representative edge types.
  • an edge histogram of the image to be processed can be obtained, and each of the distribution items in the edge histogram is the above-described edge histogram descriptor.
  • the semi-global and global edge distributions may be added to obtain an edge histogram containing 150 bins.
  • the processor obtains the to-be-matched feature vector of the image to be processed based on the edge histogram description of the image to be processed, and may include:
  • Step S111 The processor obtains values of n distribution items in the edge histogram of the image to be processed based on the n edge histogram descriptors.
  • the processor can obtain the values of the plurality of bins, that is, the distribution items in the edge histogram of the image to be processed, based on the plurality of edge histogram descriptors obtained above.
  • the edge histogram obtained above contains 80 bins
  • the value of 80 distribution items can be obtained
  • the obtained edge histogram contains 150 bins
  • the value of 150 distribution items can be obtained.
  • Step S112 The processor normalizes the values of the n distribution items to obtain n normalized data.
  • the values of the n distribution items may be normalized separately, so that the value of each distribution item is between 0 and 1, thereby obtaining n normalized data.
  • Step S113 The processor generates an n-dimensional feature vector based on the n normalized data, thereby obtaining the to-be-matched feature vector.
  • an n-dimensional feature vector is generated from the n normalized data.
  • the processor may quantize the n normalized data, and specifically, multiply each normalized data by 255, so that each data is between 0 and 255, so as to improve subsequent The performance of feature matching, as well as saving storage space when images need to be stored. Then, an n-dimensional feature vector is generated according to the quantized n data, that is, the above-mentioned feature vector to be matched is obtained.
  • Step S120 The processor performs feature matching on the feature vector to be matched with the historical feature vector of the historical image stored in the database to obtain a matching vector distance.
  • the processor after obtaining the to-be-matched feature vector of the image to be processed, performs feature matching on the historical feature vector corresponding to the historical image stored in the database to obtain a matching vector distance, thereby obtaining a matching vector distance. It is used to determine the degree of similarity between the image to be processed and the historical image.
  • the processor when performing image deduplication on a video image of a video stream, for example, when performing image deduplication on an image between live broadcasts, the processor may first determine whether the history of the live broadcast exists in the database. The historical feature vector of the image.
  • the processor may determine whether the historical feature vector of the historical image corresponding to the video stream is stored in the database before the feature vector to be matched is matched with the historical feature vector.
  • the step of performing feature matching between the feature vector to be matched and the historical feature vector is performed.
  • the feature matching here refers to image feature matching, and the image feature matching refers to a matching method for calculating the registration between features by calculating the similarity between image features.
  • the processor determines that the historical feature vector of the historical image corresponding to the video stream is not stored in the database
  • the historical feature vector of the historical image of the video stream may be stored in the database in the database. Subsequent to image deduplication of other images of the video stream, historical feature vectors are matched thereto.
  • Step S130 The processor obtains a degree of repetition between the image to be processed and the history image based on the matching vector distance.
  • the processor maps the matching vector distance and the repetition degree in advance.
  • the formula can be:
  • Dist max is the maximum matching distance
  • Dist j is the matching vector distance
  • Similar j is the repeating degree.
  • Dist max 10000 can be taken.
  • the specific Dist max is not limited in the embodiment of the present application, and the specific selection may be obtained according to the actual sample set.
  • the degree of repetition between the image to be matched and the historical image can be obtained.
  • the image repeatability refers to a ratio of two images, and the pixels at the same position are consistent; the higher the ratio, the higher the degree of repetition.
  • the processor may de-weight the image to be matched and the plurality of historical images to obtain a degree of repetition. That is, the image processing method may further include: acquiring at least one degree of repetition between the image to be processed and the at least one other history image.
  • the method for the processor to obtain the at least one degree of repetition between the image to be processed and the at least one other historical image may refer to the foregoing steps S120 to S130, and details are not described herein again.
  • a historical feature vector of a plurality of historical images may be stored in the database, and the processor performs feature matching on each historical feature vector to obtain a plurality of matching vector distances, and then according to multiple matching vector distances. The degree of repetition between the image to be matched and the plurality of historical images is obtained, so that the user can know the historical image with the highest similarity to the image to be matched.
  • the degree of repetition between the image to be matched and the plurality of history images that is, a plurality of degrees of repetition, can be obtained.
  • the image processing method may further include:
  • the processor obtains a maximum repetition degree of the plurality of repetition degrees; determines whether the maximum repetition degree is greater than a preset threshold; and when the maximum repetition degree is greater than a preset threshold, the image to be processed is corresponding to the maximum repetition degree
  • the historical images are associated.
  • the processor first obtains the maximum repetition degree among the plurality of repetition degrees obtained as described above, that is, obtains the maximum repetition degree among the repetition degrees of the image to be matched and the plurality of history images. Then, it can be determined whether the maximum repetition degree is greater than a preset threshold. When it is determined that the maximum repetition degree is greater than a preset threshold, the image to be processed can be determined as a repeated image, that is, the image to be processed corresponds to the maximum repetition degree. Historical images are repeated. Therefore, the image to be processed can be associated with the historical image corresponding to the maximum degree of repetition.
  • the historical analysis processing result of the historical image corresponding to the maximum repetition degree may be directly used as the analysis processing result of the image to be processed, thereby avoiding analyzing and processing the image to be processed again, thereby saving calculation. Resources.
  • the image processing method may further include:
  • the processor outputs historical data of the historical image corresponding to the maximum repetition degree stored in the database.
  • the historical analysis processing result, the historical marking information, and the like of the historical image corresponding to the maximum repetition degree can be output, so that the user does not need to perform related analysis and processing on the image to be processed, thereby saving calculation of the electronic device. Resources and user time.
  • the feature vector of the image to be processed may be stored as a historical feature vector.
  • the image processing method provided by the first embodiment of the present invention obtains the feature vector of the image by using the edge histogram operator of the image when performing image deduplication, and then uses the feature vector to perform feature matching, and considering the structural information of the image, The accuracy of de-duplication of the image is improved, that is, the reliability of the duplication between images is improved.
  • the image processing method may include the following steps:
  • a processor extracts image features: using the video decoding algorithm, among the extracted broadcast video stream corresponding to a current image frame Room current IMG current;
  • b processor calculates the image feature vectors: based on edge histogram descriptor sub-image content, calculating a current image frame to be matched feature vectors of IMG current Feat current, can be calculated using the following formula:
  • the present application performs feature quantization on matching feature vectors, and the specific formula is as follows:
  • . c historical feature vector processor looks: using a fast search algorithm to find the database, current whether there is a history feature vector Feat history between current live Room;
  • processor storage features current history if the feature vector does not exist between the current live Room, will be matched feature vector generated in step b as a history written to the database feature vector Feat history;
  • Dist j D(Feat current ,Feat history ),1 ⁇ j ⁇ n
  • the historical feature vector Feat history has a total of N, sorted according to the feature write time, and in order to speed up the calculation performance, the present application only takes the first n features close to the current image frame IMG current for feature matching, and n satisfies the condition 1 ⁇ n ⁇ N;
  • the processor calculates the degree of repetition: due to the matching vector distance Dist j generated by the step e, in the distance space instead of the absolute confidence, the corresponding relationship mapping is performed, and the repetition degree Similar j is calculated.
  • the specific formula is as follows:
  • Index max is the index of the highest repetition Similar max and satisfies 1 ⁇ Index max ⁇ n;
  • the processor determines whether it is a repeated graph: according to step g, finds the highest degree of repetition, Similar max , and compares it with the expected threshold T to determine whether it is a repeated graph.
  • the specific formula is as follows:
  • the current image frame IMG current is a repeated image in the Room current between the live broadcasts, and the historical calculation result indexed as Index max can be extracted and fed back to the system without performing feature storage; thus, the optimal repeatability is completed. Obtain.
  • the second embodiment of the present application provides an image processing apparatus 200.
  • the image processing apparatus 200 includes a vector acquisition module 210, a feature matching module 220, and a repetition degree obtaining module 230.
  • the vector obtaining module 210 is configured to obtain a to-be-matched feature vector of the to-be-processed image based on an edge histogram descriptor of the to-be-processed image, where the edge histogram descriptor is a distribution item in the edge histogram;
  • the feature matching module 220 is configured to perform feature matching on the to-be-matched feature vector and the historical feature vector of the historical image stored in the database to obtain a matching vector distance;
  • the repetition degree obtaining module 230 is configured to be based on the matching vector distance Obtaining a degree of repetition between the image to be processed and the history image.
  • the vector obtaining module 210 may include a first data acquiring unit 211, a second data acquiring unit 212, and a vector generating unit 213.
  • the first data acquiring unit 211 is configured to obtain values of n distribution items in the edge histogram of the image to be processed based on the n edge histogram descriptors;
  • the second data acquiring unit 212 is configured to Normalizing the values of the n distribution items to obtain n normalized data;
  • the vector generation unit 213 is configured to generate an n-dimensional feature vector based on the n normalized data, thereby obtaining the The feature vector to be matched.
  • the image processing apparatus 200 may further include a processing execution module configured to acquire at least one degree of repetition between the image to be processed and at least one other history image.
  • the image processing apparatus 200 further includes a maximum value obtaining module, a repetition degree determining module, and an associated executing module.
  • the maximum value obtaining module is configured to obtain a maximum repetition degree of the plurality of the repetition degrees;
  • the repetition degree determining module is configured to determine whether the maximum repetition degree is greater than a preset threshold;
  • the association execution module is configured to be at the maximum repetition degree When the threshold is greater than the preset threshold, the image to be processed is associated with the historical image corresponding to the maximum degree of repetition.
  • the image processing apparatus 200 may further include an output execution module configured to output historical data of the historical image corresponding to the maximum repetition degree stored in the database.
  • the image processing apparatus 200 may further include a video decoding module configured to perform video decoding on a video stream based on a preset video decoding algorithm, thereby obtaining the to-be-processed image.
  • a video decoding module configured to perform video decoding on a video stream based on a preset video decoding algorithm, thereby obtaining the to-be-processed image.
  • a third embodiment of the present application provides an electronic device 100.
  • the electronic device 100 includes a memory 102 and a processor 106.
  • the memory 102 stores computer instructions when the computer instructions are used by the processor.
  • the processor 106 reads and executes, the processor 106 is caused to execute the image processing method provided by the first embodiment of the present application.
  • a fourth embodiment of the present application provides a storage medium in which computer instructions are stored, wherein the computer instructions perform the image processing method provided by the first embodiment of the present application when being read and executed.
  • the image processing method, device, electronic device, and storage medium obtained by the embodiments of the present application obtain the to-be-matched feature vector of the to-be-processed image by using an edge histogram descriptor based on the image to be processed, and then to be matched.
  • the feature vector is feature-matched with the historical feature vector of the historical image stored in the database to obtain a matching vector distance, and then the degree of repetition between the image to be processed and the historical image is obtained based on the matching vector distance.
  • the image processing method, device, electronic device and storage medium obtain feature vectors by edge histogram descriptors, so that in the process of obtaining the degree of repetition between images, the structural information of the image content is considered, and the obtained images are repeated.
  • the accuracy is high, and the problem that the similarity between the two pictures cannot be accurately judged in the prior art is solved.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • each functional module in each embodiment of the present application may be integrated to form a separate part, or each module may exist separately, or two or more modules may be integrated to form a separate part.
  • the functions, if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present application which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
  • the image processing method, the device, the electronic device and the storage medium provided by the embodiments of the present application can be applied to the de-duplication process of the massive image of the Internet.
  • the process of obtaining the degree of repetition between images can be considered.
  • the structural information of the image content enables the accuracy of the degree of repetition between the obtained images to be high, and the image data is deduplicated quickly and accurately in the massive image information, thereby saving computational resources.

Abstract

本申请提供了一种图像处理方法、装置、电子设备及存储介质,涉及图像处理技术领域。该图像处理方法包括:基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。该图像处理方法、装置、电子设备及存储介质可以准确的获取待处理图像与历史图像之间的重复度。

Description

图像处理方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2018年01月10日提交中国专利局的申请号为2018100242831、名称为“图像处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、装置、电子设备及存储介质。
背景技术
随着互联网行业的快速发展,图像与视频信息膨胀式产生,而如何在对大量图像信息进行分析、处理时,对海量图像信息快速、精准地对图像数据进行去重,节约计算资源,是目前的一个难点。
目前图像去重的方法大多为计算图像的哈希值,然后再比较哈希值的相似程度来完成图像去重。但是基于哈希值的图像去重方法忽视了图像内容的结构信息,无法对两张图片的相似度进行精准的评判。
发明内容
有鉴于此,本申请实施例提供了一种图像处理方法、装置、电子设备及存储介质。
为了实现上述目的中的至少一个目的,本申请采用的技术方案如下:
第一方面,本申请实施例提供了一种图像处理方法,所述方法包括:基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
可选地,所述基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,包括:
基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值;
将所述n个分布项的值进行归一化,获得n个归一化数据;
基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
所述基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度,包括:
将所述匹配向量距离与所述重复度之间进行映射,得到待匹配图像与历史图像之间的重复度。
可选地,所述将所述匹配向量距离与所述重复度之间进行映射利用以下公式:
Figure PCTCN2018086905-appb-000001
其中,Dist max为最大匹配距离,Dist j为匹配向量距离,Similar j为重复度。在本申请实施例中可以取Dist max=10000。
可选地,所述基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度之后,所述方法还包括:
获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度。
可选地,所述获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度之后,所述方法还包括:
获得多个所述重复度中的最大重复度;
判断所述最大重复度是否大于预设阈值;
在为是时,将所述待处理图像与所述最大重复度对应的历史图像进行关联。
可选地,所述在为是时,将所述待处理图像与所述最大重复度对应的历史图像进行关联之后,所述方法还包括:
输出所述数据库中存储的所述最大重复度对应的历史图像的历史数据。
可选地,所述获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度之后,所述方法还包括:
在为否时,将该待处理图像的特征向量作为历史特征向量进行存储。
可选地,所述将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,包括:
在获得待处理图像的待匹配特征向量之后,确定数据库中是否存储有与所述待处理图像对应的历史图像的历史特征向量;
若有,将待匹配特征向量与数据库中存储的历史图像对应的历史特征向量进行特征匹配,得到匹配向量距离。
可选地,所述将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,还包括:
若无,将该待匹配特征向量作为该视频流的历史图像的历史特征向量存储于所述数据库中。
可选地,所述基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量之前,所述方法还包括:
基于预设视频解码算法对一视频流进行视频解码,从而获得所述待处理图像。
第二方面,本申请实施例提供了一种图像处理装置,所述装置包括向量获取模块、特征匹配模块以及重复度获得模块,其中,所述向量获取模块配置成基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;所述特征匹配模块配置成将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;所述重复度获得模块配置成基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
可选地,所述向量获取模块包括第一数据获取单元、第二数据获取单元以及向量生成单元,其中,
所述第一数据获取单元配置成基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值;
所述第二数据获取单元配置成将所述n个分布项的值进行归一化,获得n个归一化数据;
所述向量生成单元配置成基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
第三方面,本申请实施例提供了一种电子设备,所述电子设备包括存储器和处理器,所述存储器存储有计算机指令,当所述计算机指令由所述处理器读取并执行时,使所述处理器执行上述第一方面提供的图像处理方法。
第四方面,本申请实施例提供了一种存储介质,所述存储介质中存储有计算机指令,其中,所述计算机指令在被读取并运行时执行上述第一方面提供的图像处理方法。
本申请实施例提供的图像处理方法、装置、电子设备及存储介质,通过基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,再将待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,然后基于匹配向量距离获得待处理图像与历史图像之间的重复度。该图像处理方法、装置、电子设备及存储介质通过边缘直方图描述子获得特征向量,从而在获得图像之间重复度过程中,考虑了图像内容的结构信息,使获得的图像之间的重复度的准确度高,解决现有技术中无法对两张图片的相似度进行精准的评判的问题。
为使本申请的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本 申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1示出了本申请实施例提供的电子设备的方框示意图;
图2示出了本申请实施例提供的图像处理方法的流程图;
图3示出了本申请实施例提供的图像处理方法中步骤S110的流程图;
图4示出了本申请实施例提供的图像处理装置的模块图;
图5示出了本申请实施例提供的图像处理装置中向量获取模块的模块图。
具体实施方式
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
图1示出了一种可应用于本申请实施例中的电子设备的结构框图。如图1所示,电子设备100包括存储器102、存储控制器104,一个或多个(图中仅示出一个)处理器106、外设接口108、射频模块110、音频模块112、显示单元114等。这些组件通过一条或多条通讯总线/信号线116相互通讯。
存储器102可配置成存储软件程序以及模块,如本申请实施例中的图像处理方法及装置对应的程序指令/模块,处理器106通过运行存储在存储器102内的软件程序以及模块,从而执行各种功能应用以及数据处理,如本申请实施例提供的图像处理方法。
存储器102可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。处理器106以及其他可能的组件对存储器102的访问可在存储控制器104的控制下进行。
外设接口108将各种输入/输出装置耦合至处理器106以及存储器102。在一些实施例中,外设接口108,处理器106以及存储控制器104可以在单个芯片中实现。在其他一些实例中,他们可以分别由独立的芯片实现。
射频模块110配置成接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。
音频模块112向用户提供音频接口,其可包括一个或多个麦克风、一个或者多个扬声器以及音频电路。
显示单元114在电子设备100与用户之间提供一个显示界面。具体地,显示单元114向用户显示视频输出,这些视频输出的内容可包括文字、图形、视频及其任意组合。
可以理解,图1所示的结构仅为示意,电子设备100还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。图1中所示的各组件可以采用硬件、软件或其组合实现。
第一实施例
如图2示出了本申请实施例提供的图像处理方法的流程图。请参见图2,该方法包括:
步骤S110:处理器基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项。
在本申请实施例中,待处理图像可以是对数据库中存储的图像,也可以是从其他终端设备获取的图像,也可以是从视频流中获得的视频图像。
在本申请实施例中,在待处理图像为视频流中的视频图像时,可以先对视频进行视频解码,从而获得视频中的图像。
在本申请实施例中,由于直播间对应的视频流中可能存在图像重复度高的视频图像(图像重复度是指两张图像,相同位置像素一致的比例;此比例越高,重复度越高),所以为了可以对直播平台的直播间的视频图像进行图像去重(图像去重是指将两张具有较高像素一致性的图像,使用图像特征提取与特征匹配方法,评价图像内容重复度的方法;图像特征提取是指使用计算机提取图像中属于特征性的信息的方法及过程;图像特征匹配:是指通过计算图像特征间的相似度,以实现特征间配准的匹配方法),图像处理方法还可以包括:
处理器基于预设视频解码算法对一视频流进行视频解码,从而获得所述待处理图像。
在本申请实施例中,预设视频解码算法可以是MPEG/H.264视频解码算法,从而可以获得视频流的视频中的视频图像,作为上述待处理图像。在对直播间的视频图像进行去重时,可以是利用视频解码算法对直播间对应的视频流的视频图像进行视频解码,从而获得待处理图像。
在本申请实施例中,处理器可以是基于待处理图像的边缘直方图描述子获得待处理图像的待匹配特征向量,即待处理图像的图像特征。所以在获得待处理图像之后,可以对待处理图像进行处理,从而获得待处理图像的图像特征。
其中,为了考虑图像内容的结构信息,本申请实施例引入基于图像内容的边缘直方图描述子作为图像特征,边缘直方图描述子为边缘直方图中的分布项。边缘直方图是提取图像纹理特征的一个重要方式,边缘的空间分布能够包含重要的纹理信息。边缘直方图也是 MPEG-7标准纹理描述符的一种。边缘直方图提供了5种纹理边缘类型:垂直边缘的纹理、水平边缘的纹理、45度边缘的纹理、135度边缘的纹理和无方向边缘的纹理。
处理器在对待处理图像进行处理时,可以是将待处理图像分成4*4个子块,每个子块的局部特征可以用其形成的边缘分布直方图表示,因此直方图会包含5个代表边缘类型出现概率的bins(直方图中的分布项),由于分成4*4个子块处理,因此可以得出5*4*4=80个包含与位置和边缘类型相关的带有边缘纹理信息的bins。从而可以获得待处理图像的边缘直方图,边缘直方图中的每个分布项即为上述边缘直方图描述子。
当然,也可以在上述获取边缘直方图方法的基础上,加进半全局和全局的边缘分布,获得包含150个bins的边缘直方图。
在本申请实施例中,请参见图3,处理器基于待处理图像的边缘直方图描述子获得待处理图像的待匹配特征向量,可以包括:
步骤S111:处理器基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值。
可以理解的是,处理器基于上述获得的多个边缘直方图描述子,可以获得待处理图像的边缘直方图中的多个bins即分布项的值。
例如,上述获得的边缘直方图包含80个bins时,则可以获得80个分布项的值,上述获得的边缘直方图包含150个bins时,则可以获得150个分布项的值。
步骤S112:处理器将所述n个分布项的值进行归一化,获得n个归一化数据。
在处理器获得n个分布项的值之后,可以将n个分布项的值分别进行归一化,使每个分布项的值均介于0~1之间,从而获得n个归一化数据。
步骤S113:处理器基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
在获得n归一化数据之后,再根据n个归一化数据生成n维的特征向量。
在本申请实施例中,处理器可以将n个归一化数据进行量化,具体可以是将每个归一化数据乘以255,使每个数据介于0~255之间,以便于提升后续进行特征匹配的性能,以及在图像特需要进行存储时,节约存储空间。然后,再根据量化后的n个数据生成n维的特征向量,即获得了上述的待匹配特征向量。
步骤S120:处理器将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离。
在本申请实施例中,处理器在获得待处理图像的待匹配特征向量之后,再将待匹配特征向量与数据库中存储的历史图像对应的历史特征向量进行特征匹配,从而获得匹配向量距离,以用于判断待处理图像与历史图像之间的相似程度。
在本申请实施例中,如在对一视频流的视频图像进行图像去重时,例如在对一直播间的图像进行图像去重时,处理器可以先确定是否数据库中存在该直播间的历史图像的历史特征向量。
因此,处理器可以在将待匹配特征向量与历史特征向量进行特征匹配之前,确定上述数据库中是否存储有该视频流对应的历史图像的历史特征向量。
在处理器确定上述数据库中存储有该视频流对应的历史图像的历史特征时,再进行将待匹配特征向量与历史特征向量进行特征匹配的步骤。这里的特征匹配指图像特征匹配,图像特征匹配是指通过计算图像特征间的相似度,以实现特征间配准的匹配方法。
在处理器确定上述数据库中没有存储有该视频流对应的历史图像的历史特征向量时,则可以将该待匹配特征向量作为该视频流的历史图像的历史特征向量存储于上述数据库中,以便于后续在对该视频流的其他图像进行图像去重时,有历史特征向量与之进行匹配。
步骤S130:处理器基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
在本申请实施例中,由于匹配向量距离不能直观地表现出待匹配图像与历史图像之间的重复度,因此处理器预先将匹配向量距离与重复度之间进行映射。具体的,公式可以是:
Figure PCTCN2018086905-appb-000002
其中,Dist max为最大匹配距离,Dist j为匹配向量距离,Similar j为重复度。在本申请实施例中可以取Dist max=10000。当然,具体的Dist max在本申请实施例中并不作为限定,具体的选取可以依据实际样本集进行获取。
从而,可以获得待匹配图像与历史图像之间的重复度,在本发明实施例中,图像重复度是指两张图像,相同位置像素一致的比例;此比例越高,重复度越高。
在本申请实施例中,处理器可以将待匹配图像与多个历史图像之间进行去重,获得重复度。即该图像处理方法还可以包括:获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度。
在本申请实施例中,处理器获取待处理图像与至少一个其他历史图像之间的至少一个重复度的方法可以参照上述步骤S120至步骤S130的方法,在此不再赘述。
可以理解的是,数据库中可能存储有多个历史图像的历史特征向量,在处理器将待处理图像与每个历史特征向量进行特征匹配获得多个匹配向量距离之后,再根据多个匹配向量距离获得上述待匹配图像分别与多个历史图像之间的重复度,以便于用户获知与待匹配图像的相似度最高的历史图像。
从而,可以获得待匹配图像分别与多个历史图像之间的重复度,即多个重复度。
在本申请实施例中,处理器在获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度之后,该图像处理方法还可以包括:
处理器获得多个所述重复度中的最大重复度;判断所述最大重复度是否大于预设阈值;在最大重复度大于预设阈值时,将所述待处理图像与所述最大重复度对应的历史图像进行关联。
可以理解的是,处理器先获得上述获得的多个重复度中的最大重复度,即获得待匹配图像与多个历史图像的重复度中的最大重复度。然后,可以再判断该最大重复度是否大于预设阈值,在判断为该最大重复度大于预设阈值时,可以将该待处理图像判定为重复图像,即该待处理图像与最大重复度对应的历史图像重复。因此,可以将该待处理图像与该最大重复度对应的历史图像进行关联。以使在对待处理图像进行分析处理时,可以直接将该最大重复度对应的历史图像的历史分析处理结果作为该待处理图像的分析处理结果,避免再次对该待处理图像进行分析处理,节约计算资源。
因此,在本申请实施例中,该图像处理方法还可以包括:
处理器输出所述数据库中存储的所述最大重复度对应的历史图像的历史数据。
可以理解的是,可以将该最大重复度对应的历史图像的历史分析处理结果、历史标记信息等输出,以使用户不用再对该待处理图像进行相关的分析、处理等,节约电子设备的计算资源以及用户的时间。
另外,在判断为最大重复度不大于(即小于或者等于)预设阈值时,则表示该待处理图像不是重复图像,因此可以将该待处理图像的特征向量作为历史特征向量进行存储。
本申请第一实施例提供的图像处理方法在进行图像去重时,利用图像的边缘直方图算子获得图像的特征向量,再利用该特征向量进行特征匹配,考虑到了图像的结构信息,因此可以使图像去重的准确度提高,即图像之间的重复度的可靠性提升。
第二实施例
为了便于充分的理解第一实施例,在实际应用中,图像处理方法可以包括以下步骤:
a.处理器提取图像特征:采用视频解码算法,提取直播间对应的视频流Room current的当前图像帧IMG current
b.处理器计算图像的特征向量:基于图像内容的边缘直方图描述子,计算当前图像帧IMG current的待匹配特征向量Feat current,可使用如下公式计算:
Figure PCTCN2018086905-appb-000003
其中,Dim feat为边缘直方图特征描述子的特征长度,本申请中取Dim feat=80,i为特征索引;
同时,为节约存储空间与提升特征匹配的性能,本申请对待匹配特征向量进行特征量化,具体公式如下:
Figure PCTCN2018086905-appb-000004
此时,待匹配特征向量取值范围为
Figure PCTCN2018086905-appb-000005
c.处理器查找历史特征向量:使用快速查找算法,查找数据库中,当前直播间Room current是否存在历史特征向量Feat history
d.处理器进行特征入库:若当前直播间Room current不存在历史特征向量,则将步骤b生成的待匹配特征向量作为历史特征向量Feat history写入数据库;
e.处理器进行特征匹配:若当前直播间Room current存在历史特征向量Feat history,则将步骤b生成的待匹配特征向量Feat current与历史特征向量Feat history进行特征匹配,假设匹配向量距离为Dist j,可简化公式如下:
Dist j=D(Feat current,Feat history),1≤j≤n
其中,假设历史特征向量Feat history共有N条,按特征写入时间进行排序,同时为加快计算性能,本申请仅取靠近当前图像帧IMG current的前n条特征进行特征匹配,且n满足条件1≤n≤N;
其中,j为具体的匹配距离索引;
f.处理器计算重复度:由于步骤e生成的匹配向量距离Dist j,在距离空间上而非绝对的置信度,特进行相应的关系映射,计算重复度Similar j,具体公式如下:
Figure PCTCN2018086905-appb-000006
其中,Dist max为最大匹配距离,具体Dist max的选取需依据实际样本集进行获取,本申请Dist max=10000;
g.处理器查找分值最高重复度:依据步骤f生成的重复度Similar j,对其进行排序,并查找到分值最高的重复度Similar max及其索引Index max,具体公式如下:
Figure PCTCN2018086905-appb-000007
其中,Index max为最高的重复度Similar max的索引,且满足1≤Index max≤n;
h.处理器判定是否为重复图:依据步骤g查找到分值最高的重复度Similar max,与期望阈值T进行比较,判定是否为重复图,具体公式如下:
Figure PCTCN2018086905-appb-000008
其中,T为期望阈值,依据实际样本集进行选取,本申请T=90;
若,判定结果Similar=0,则跳转到步骤d,进行特征入库;
否则,则判定当前图像帧IMG current在直播间Room current中是重复图像,即可提取索引为Index max的历史计算结果,并反馈给系统,且无需进行特征入库;至此即完成最优重复度获取。
第三实施例
本申请第二实施例提供了一种图像处理装置200,请参见图4,该图像处理装置200包括向量获取模块210、特征匹配模块220以及重复度获得模块230。其中,所述向量获取模块210配置成基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;所述特征匹配模块220配置成将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;所述重复度获得模块230配置成基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
在本申请实施例中,请参见图5,所述向量获取模块210可以包括第一数据获取单元211、第二数据获取单元212以及向量生成单元213。其中,所述第一数据获取单元211配置成基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值;所述第二数据获取单元212配置成将所述n个分布项的值进行归一化,获得n个归一化数据;所述向量生成单元213配置成基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
在本申请实施例中,该图像处理装置200还可以包括处理执行模块,处理执行模块配 置成获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度。
在本申请实施例中,该图像处理装置200还包括最大值获得模块、重复度判断模块以及关联执行模块。其中,最大值获得模块配置成获得多个所述重复度中的最大重复度;重复度判断模块配置成判断所述最大重复度是否大于预设阈值;关联执行模块配置成在所述最大重复度大于预设阈值时,将所述待处理图像与所述最大重复度对应的历史图像进行关联。
在本申请实施例中,该图像处理装置200还可以包括输出执行模块,输出执行模块配置成输出所述数据库中存储的所述最大重复度对应的历史图像的历史数据。
在本申请实施例中,该图像处理装置200还可以包括视频解码模块,视频解码模块配置成基于预设视频解码算法对一视频流进行视频解码,从而获得所述待处理图像。
第四实施例
本申请第三实施例提供了一种电子设备100,请参见图1,该电子设备100包括存储器102和处理器106,所述存储器102存储有计算机指令,当所述计算机指令由所述处理器106读取并执行时,使所述处理器106执行本申请第一实施例提供的图像处理方法。
第五实施例
本申请第四实施例提供了一种存储介质,所述存储介质中存储有计算机指令,其中,所述计算机指令在被读取并运行时执行本申请第一实施例提供的图像处理方法。
综上所述,本申请实施例提供的图像处理方法、装置、电子设备及存储介质,通过基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,再将待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,然后基于匹配向量距离获得待处理图像与历史图像之间的重复度。该图像处理方法、装置、电子设备及存储介质通过边缘直方图描述子获得特征向量,从而在获得图像之间重复度过程中,考虑了图像内容的结构信息,使获得的图像之间的重复度的准确度高,解决现有技术中无法对两张图片的相似度进行精准的评判的问题。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一 部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。
工业实用性
本申请实施例提供的图像处理方法、装置、电子设备及存储介质,可以应用于互联网 海量图像的去重过程中,通过应用本申请的技术方案,可以在获得图像之间重复度过程中,考虑图像内容的结构信息,使获得的图像之间的重复度的准确度高,实现在海量图像信息中快速、精准地对图像数据进行去重,节约计算资源。

Claims (15)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;
    将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;
    基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
  2. 根据权利要求1所述的方法,其特征在于,所述基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,包括:
    基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值;
    将所述n个分布项的值进行归一化,获得n个归一化数据;
    基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度,包括:
    将所述匹配向量距离与所述重复度之间进行映射,得到待匹配图像与历史图像之间的重复度。
  4. 根据权利要求3所述的方法,其特征在于,所述将所述匹配向量距离与所述重复度之间进行映射利用以下公式:
    Figure PCTCN2018086905-appb-100001
    其中,Dist max为最大匹配向量距离,Dist j为匹配向量距离,Similar j为重复度。在本申请实施例中可以取Dist max=10000。
  5. 根据权利要求1所述的方法,其特征在于,所述基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度之后,所述方法还包括:
    获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度。
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度之后,所述方法还包括:
    获得多个所述重复度中的最大重复度;
    判断所述最大重复度是否大于预设阈值;
    在为是时,将所述待处理图像与所述最大重复度对应的历史图像进行关联。
  7. 根据权利要求6所述的方法,其特征在于,所述在为是时,将所述待处理图像与所 述最大重复度对应的历史图像进行关联之后,所述方法还包括:
    输出所述数据库中存储的所述最大重复度对应的历史图像的历史数据。
  8. 根据权利要求7所述的方法,其特征在于,所述获取所述待处理图像与至少一个其他历史图像之间的至少一个重复度之后,所述方法还包括:
    在为否时,将该待处理图像的特征向量作为历史特征向量进行存储。
  9. 根据权利要求1所述的方法,其特征在于,所述将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,包括:
    在获得待处理图像的待匹配特征向量之后,确定数据库中是否存储有与所述待处理图像对应的历史图像的历史特征向量;
    若有,将待匹配特征向量与数据库中存储的历史图像对应的历史特征向量进行特征匹配,得到匹配向量距离。
  10. 根据权利要求9所述的方法,其特征在于,所述将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离,还包括:
    若无,将该待匹配特征向量作为该视频流的历史图像的历史特征向量存储于所述数据库中。
  11. 根据权利要求1-10中任一权项所述的方法,其特征在于,所述基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量之前,所述方法还包括:
    基于预设视频解码算法对一视频流进行视频解码,从而获得所述待处理图像。
  12. 一种图像处理装置,其特征在于,所述装置包括向量获取模块、特征匹配模块以及重复度获得模块,其中,
    所述向量获取模块配置成基于待处理图像的边缘直方图描述子获得所述待处理图像的待匹配特征向量,其中,所述边缘直方图描述子为边缘直方图中的分布项;
    所述特征匹配模块配置成将所述待匹配特征向量与数据库中存储的历史图像的历史特征向量进行特征匹配,获得匹配向量距离;
    所述重复度获得模块配置成基于所述匹配向量距离获得所述待处理图像与所述历史图像之间的重复度。
  13. 根据权利要求12所述的装置,其特征在于,所述向量获取模块包括第一数据获取单元、第二数据获取单元以及向量生成单元,其中,
    所述第一数据获取单元配置成基于n个所述边缘直方图描述子获得所述待处理图像的边缘直方图中n个分布项的值;
    所述第二数据获取单元配置成将所述n个分布项的值进行归一化,获得n个归一化数据;
    所述向量生成单元配置成基于所述n个归一化数据生成n维的特征向量,从而获得所述待匹配特征向量。
  14. 一种电子设备,其特征在于,所述电子设备包括存储器和处理器,所述存储器存储有计算机指令,当所述计算机指令由所述处理器读取并执行时,使所述处理器执行如权利要求1-11中任一权项所述的方法。
  15. 一种存储介质,其特征在于,所述存储介质中存储有计算机指令,其中,所述计算机指令在被读取并运行时执行如权利要求1-11中任一权项所述的方法。
PCT/CN2018/086905 2018-01-10 2018-05-15 图像处理方法、装置、电子设备及存储介质 WO2019136897A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810024283.1 2018-01-10
CN201810024283.1A CN108256532A (zh) 2018-01-10 2018-01-10 图像处理方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2019136897A1 true WO2019136897A1 (zh) 2019-07-18

Family

ID=62726210

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/086905 WO2019136897A1 (zh) 2018-01-10 2018-05-15 图像处理方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN108256532A (zh)
WO (1) WO2019136897A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565909A (zh) * 2020-11-30 2021-03-26 维沃移动通信有限公司 视频播放方法、装置、电子设备及可读存储介质
CN112907972A (zh) * 2021-04-06 2021-06-04 昭通亮风台信息科技有限公司 基于无人机的道路车流量检测方法、系统及计算机可读存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110866131A (zh) * 2018-08-21 2020-03-06 北京京东尚科信息技术有限公司 图像去重方法、装置、介质及电子设备
CN109308463B (zh) * 2018-09-12 2021-08-13 北京奇艺世纪科技有限公司 一种视频目标识别方法、装置及设备
CN109389081A (zh) * 2018-09-30 2019-02-26 Oppo广东移动通信有限公司 多媒体数据处理方法及装置、可读存储介质
CN111245884B (zh) * 2019-03-21 2020-12-01 青田县武莲科技有限公司 多功能网络控制方法
CN110381287A (zh) * 2019-03-21 2019-10-25 泰州市朗嘉尚网络科技有限公司 多功能网络控制平台
CN110399344A (zh) * 2019-07-23 2019-11-01 北京明略软件系统有限公司 选取重复图像的方法及装置
CN111325712B (zh) * 2020-01-20 2024-01-23 北京百度网讯科技有限公司 用于检测图像有效性的方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1470131A (zh) * 2000-10-21 2004-01-21 ��������ͨ���о�Ժ 用于检索图象数据的非线性量化方法和相似性匹配方法
CN102880726A (zh) * 2012-10-23 2013-01-16 深圳市宜搜科技发展有限公司 一种图像过滤方法及系统
CN107480203A (zh) * 2017-07-23 2017-12-15 北京中科火眼科技有限公司 一种针对相同及相似图片去重的图像数据清洗方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100446569C (zh) * 2002-10-31 2008-12-24 韩国电子通信研究院 用于检索具有图像帧组视频序列的非线性量化和相似性匹配方法
CN102054159B (zh) * 2009-10-28 2014-05-28 腾讯科技(深圳)有限公司 一种人脸跟踪的方法和装置
CN101840422A (zh) * 2010-04-09 2010-09-22 江苏东大金智建筑智能化系统工程有限公司 基于目标特征和报警行为的智能视频检索系统和方法
CN104504734B (zh) * 2014-09-16 2017-09-26 浙江工业大学 一种基于语义的图像颜色传输方法
CN107027047A (zh) * 2017-05-16 2017-08-08 武汉斗鱼网络科技有限公司 视频直播监控方法、装置及电子设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1470131A (zh) * 2000-10-21 2004-01-21 ��������ͨ���о�Ժ 用于检索图象数据的非线性量化方法和相似性匹配方法
CN102880726A (zh) * 2012-10-23 2013-01-16 深圳市宜搜科技发展有限公司 一种图像过滤方法及系统
CN107480203A (zh) * 2017-07-23 2017-12-15 北京中科火眼科技有限公司 一种针对相同及相似图片去重的图像数据清洗方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565909A (zh) * 2020-11-30 2021-03-26 维沃移动通信有限公司 视频播放方法、装置、电子设备及可读存储介质
CN112907972A (zh) * 2021-04-06 2021-06-04 昭通亮风台信息科技有限公司 基于无人机的道路车流量检测方法、系统及计算机可读存储介质
CN112907972B (zh) * 2021-04-06 2022-11-29 昭通亮风台信息科技有限公司 基于无人机的道路车流量检测方法、系统及计算机可读存储介质

Also Published As

Publication number Publication date
CN108256532A (zh) 2018-07-06

Similar Documents

Publication Publication Date Title
WO2019136897A1 (zh) 图像处理方法、装置、电子设备及存储介质
US11132555B2 (en) Video detection method, server and storage medium
CN106547744B (zh) 一种图像检索方法及系统
US9009149B2 (en) Systems and methods for mobile search using Bag of Hash Bits and boundary reranking
US9805264B2 (en) Incremental learning framework for object detection in videos
US8538164B2 (en) Image patch descriptors
WO2022111069A1 (zh) 图像处理方法、装置、电子设备以及存储介质
US10650274B2 (en) Image clustering method, image clustering system, and image clustering server
WO2019080411A1 (zh) 电子装置、人脸图像聚类搜索方法和计算机可读存储介质
EP3364337A2 (en) Persistent feature descriptors for video
WO2019128254A1 (zh) 图像分析方法、装置、电子设备及可读存储介质
US9047534B2 (en) Method and apparatus for detecting near-duplicate images using content adaptive hash lookups
CN111209431A (zh) 一种视频搜索方法、装置、设备及介质
US20130114900A1 (en) Methods and apparatuses for mobile visual search
US8655016B2 (en) Example-based object retrieval for video surveillance
WO2020135756A1 (zh) 视频段的提取方法、装置、设备及计算机可读存储介质
CN109697240B (zh) 一种基于特征的图像检索方法及装置
WO2019100348A1 (zh) 图像检索方法和装置以及图像库的生成方法和装置
Ren et al. How important is location information in saliency detection of natural images
JP6736988B2 (ja) 画像検索システム、画像処理システム及び画像検索プログラム
US20140270541A1 (en) Apparatus and method for processing image based on feature point
JP5959446B2 (ja) コンテンツをバイナリ特徴ベクトルの集合で表現することによって高速に検索する検索装置、プログラム及び方法
KR101758869B1 (ko) 멀티미디어 콘텐츠 분류장치 및 이를 이용한 분류방법
KR20220057691A (ko) 샴 랜덤 포레스트를 이용한 영상 정합 방법 및 영상 정합 장치
CN108009233B (zh) 一种图像还原方法、装置、计算机设备及存储介质

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: 18899454

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: 18899454

Country of ref document: EP

Kind code of ref document: A1