WO2019010704A1 - Panoramic image and video recognition method, classifier establishment method and electronic apparatus - Google Patents
Panoramic image and video recognition method, classifier establishment method and electronic apparatus Download PDFInfo
- Publication number
- WO2019010704A1 WO2019010704A1 PCT/CN2017/093011 CN2017093011W WO2019010704A1 WO 2019010704 A1 WO2019010704 A1 WO 2019010704A1 CN 2017093011 W CN2017093011 W CN 2017093011W WO 2019010704 A1 WO2019010704 A1 WO 2019010704A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- feature value
- degree panoramic
- dimensional
- column
- panoramic image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44008—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
Definitions
- step S121 Acquire gray values of pixel points of the first row C1, the last row Cm, the first column L1, and the last column Ln of the image file M1.
- the grayscale values of all the pixel points of the first row C1, the last row Cm, the first column L1, and the last column Ln of the image file M1 are acquired in step S122.
- the first row C1 may be the first row of the image file M1
- the last row Cm may be the last row of the image file M1
- the first column L1 may be the first column of the image file M1
- the last column Ln may be the image file M1. last row.
- S123 Extract the gray values of the plurality of row sampling points from the first row C1 and the last row Cm, and extract the gray values of the plurality of column sampling points from the first column L1 and the last column Ln, respectively.
- the gray values of the first preset line sampling points are respectively extracted from the first row C1 and the last row Cm at even intervals; and the first column L1 and the last column Ln are separately extracted at even intervals.
- if the pixel point of the image file M1 is too small, a portion of the pixel of the corresponding row or column of the copyable image file M1 is supplemented into a number of row or column sample points.
- the number of the plurality of row sampling points and the column sampling points may be equal or unequal, for example, a plurality of row sampling points are 300, and a plurality of column sampling points are 150.
- the variance of the gray value of the plurality of row sampling points of the first row C1 and the variance of the gray values of the plurality of row sampling points of the last row C1 are respectively calculated, and then the average of the two variances is averaged to obtain the first eigenvalue.
- the variance of the gray value of several row sampling points of the first row C1 be F1
- the variance of the gray value of several row sampling points of the last row Cm be F2
- the first characteristic value (F1+F2)/ 2
- the variance of the gray values of the plurality of row sampling points of the first row C1 represents the difference between the gray values of the plurality of row sampling points of the first row C1, and the variance of the gray values of the plurality of row sampling points of the last row Cm.
- S66 determining a boundary value J1 of the feature value of the 360-degree panoramic image and the feature value of the non-360-degree panoramic image according to the feature value of the 360-degree panoramic image on the two-dimensional scattergram and the distribution of the feature values of the non-360-degree panoramic image, to Get a linear classifier.
- the area where the feature value of the 360-degree panoramic image on one side of the boundary line is located is the first area, that is, the area A1 of the white point distribution as shown in FIG. 7, and the characteristic value of the non-360 degree panoramic image on the other side of the boundary line.
- the area in which it is located is the second area, that is, the area A2 in which black dots are distributed as shown in FIG.
- the two-dimensional feature value may be vector-multiplied with the point located in the first region or the second region of the linear classifier, and the cross-product is used to determine whether the two points are in the same by the principle of "same direction method" The same side of the boundary line J1, thereby judging whether the two-dimensional feature value is located in the first region or in the second region.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
Abstract
本申请公开一种360度全景图像的识别方法,包括:获取待识别的图像文件;将所述图像文件进行特征提取,得到三维特征值;将所述三维特征值变换成二维特征值;将所述二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定所述二维特征值所分布的区域,并根据二维特征值所分布的区域确定所述图像文件是否为360度全景图像。本申请还公开一种360度全景视频的识别方法、线性分类器的建立方法及电子装置。本申请的电子装置及360度全景视频、图像的识别方法,能够以更快速的方式更准确地识别出360度全景视频或360度全景图像。The present disclosure discloses a method for recognizing a 360-degree panoramic image, comprising: acquiring an image file to be identified; performing feature extraction on the image file to obtain a three-dimensional feature value; and transforming the three-dimensional feature value into a two-dimensional feature value; Comparing the two-dimensional feature value with a first region and a second region defined by a linear classifier, determining an area where the two-dimensional feature value is distributed, and determining the image file according to the region where the two-dimensional feature value is distributed Whether it is a 360 degree panoramic image. The present application also discloses a method for identifying a 360-degree panoramic video, a method for establishing a linear classifier, and an electronic device. The electronic device and the 360-degree panoramic video and image recognition method of the present application can more accurately recognize a 360-degree panoramic video or a 360-degree panoramic image in a faster manner.
Description
本发明涉及一种视频图像识别方法,尤其涉及一种360度全景图像的识别方法及360度全景视频的识别方法,已经在所述360度全景图像以及360度全景视频的识别过程中用到的线性分类器的建立方法,以及应用所述识别方法以及建立方法的电子装置。The invention relates to a video image recognition method, in particular to a 360-degree panoramic image recognition method and a 360-degree panoramic video recognition method, which have been used in the recognition process of the 360-degree panoramic image and the 360-degree panoramic video. A method of establishing a linear classifier, and an electronic device applying the identification method and the method of establishing the method.
目前,360度全景拍照技术已经较为广泛应用,通过360度全景拍照技术可以得到360度全景图像或360度全景视频。在一些情境下,当播放某一图像或视频文件时,通常需要识别是否为360度全景视频,以进行相应的播放设置,体现360度全景的效果。现有的识别方式通常为根据图像文件或视频文件中的图像帧的长宽比和/或RGB(红绿蓝三原色)值来进行判断识别,往往不够准确。At present, 360-degree panoramic camera technology has been widely used, and 360-degree panoramic image or 360-degree panoramic video can be obtained through 360-degree panoramic photography technology. In some situations, when playing an image or video file, it is usually necessary to identify whether it is a 360-degree panoramic video to perform corresponding playback settings, reflecting the effect of 360-degree panoramic. The existing recognition method is usually based on the aspect ratio of the image frame in the image file or the video file and/or the RGB (red, green and blue primary colors) values for judgment and recognition, which is often not accurate enough.
发明内容Summary of the invention
本发明实施例公开一种360度全景图像及360度全景视频的识别方法、用于识别360度全景图像及360度全景视频的线性分类器的建立方法及电子装置,能够准确地识别出360度全景图像或360度全景视频。The embodiment of the invention discloses a 360-degree panoramic image and a 360-degree panoramic video recognition method, a method for establishing a linear classifier for identifying a 360-degree panoramic image and a 360-degree panoramic video, and an electronic device, which can accurately recognize 360 degrees. Panoramic image or 360 degree panoramic video.
本发明实施例公开的360度全景图像的识别方法,识别方法包括:获取待识别的图像文件;将图像文件进行特征提取,得到包括第一特征值、第二特征值及第三特征值的三维特征值;将三维特征值变换成二维特征值;将二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域;当二维特征值分布的区域为第一区域时,确认待识别的图像文件为360度全景图像;以及当二维特征值分布的区域为第二区域时,确定待识别的图像文件不为360度全景图像。The method for recognizing a 360-degree panoramic image disclosed by the embodiment of the present invention includes: acquiring an image file to be identified; performing feature extraction on the image file to obtain a three-dimensional image including the first feature value, the second feature value, and the third feature value The eigenvalue is transformed into a two-dimensional eigenvalue; the two-dimensional eigenvalue is compared with the first region and the second region defined by a linear classifier to determine a region in which the two-dimensional eigenvalue is distributed; When the area of the value distribution is the first area, it is confirmed that the image file to be recognized is a 360-degree panoramic image; and when the area of the two-dimensional feature value distribution is the second area, it is determined that the image file to be recognized is not a 360-degree panoramic image.
本发明实施例公开的360度全景视频的识别方法,识别方法包括:获取待 识别的视频文件;从待识别的视频文件中提取至少一帧代表图像帧;对每一代表图像帧进行特征提取,得到每一代表图像帧的第一特征值、第二特征值及第三特征值的三维特征值;将每一代表图像帧的三维特征值变换成二维特征值;将每一代表图像帧的二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域;当某一代表图像帧的二维特征值分布的区域为第一区域时,确认代表图像帧为360度全景图像;当某一代表图像帧的二维特征值分布的区域为第二区域时,确定代表图像帧不为360度全景图像;以及在至少一帧代表图像帧都识别完以后,根据至少一帧代表图像帧中的360度全景图像的比例确定待识别的视频文件是否为360度全景视频。The method for identifying a 360-degree panoramic video disclosed by the embodiment of the present invention includes: obtaining Identifying the video file; extracting at least one frame representative image frame from the video file to be identified; performing feature extraction on each representative image frame to obtain a first feature value, a second feature value, and a third feature of each representative image frame a three-dimensional feature value of the value; transforming the three-dimensional feature value of each representative image frame into a two-dimensional feature value; comparing the two-dimensional feature value of each representative image frame with the first region and the second region defined by a linear classifier Determining a region in which the two-dimensional feature value is distributed; when a region representing a two-dimensional feature value distribution of the image frame is the first region, confirming that the representative image frame is a 360-degree panoramic image; when a certain representative image frame is two-dimensional When the region of the feature value distribution is the second region, it is determined that the representative image frame is not a 360-degree panoramic image; and after the at least one frame representative image frame is recognized, the proportion of the 360-degree panoramic image in the image frame is represented according to at least one frame. Determine if the video file to be identified is a 360-degree panoramic video.
本发明实施例公开的线性分类器的建立方法,包括步骤:预先将第一预设数量的360度全景图像存储至第一文件夹以及第二预设数量的非360度全景图像存储至第二文件夹;将每一360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一360度全景图像的三维特征值并存储至第一文件夹;将每一非360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一非360度全景图像的三维特征值并存储至第二文件夹;根据第一预设数量的360度全景图像的三维特征值以及第二预设数量的非360度全景图像的三维特征值生成三维散点图,其中每一360度全景图像或一非360度全景图像的三维特征值对应为三维散点图中的一个特征点;将三维散点图转换成二维散点图;以及根据二维散点图上360度全景图像的特征值以及非360度全景图像的特征值的分布确定360度全景图像的特征值以及非360度全景图像的特征值的分界线,以得到线性分类器,其中,分界线一侧的360度全景图像的特征值所在区域为第一区域,分界线另一侧的非360度全景图像的特征值所在区域为第二区域。The method for establishing a linear classifier disclosed in the embodiment of the present invention includes the steps of: storing a first preset number of 360-degree panoramic images to a first folder and a second preset number of non-360-degree panoramic images to a second a folder; extracting features of the first feature value, the second feature value, and the third feature value for each 360-degree panoramic image to form a three-dimensional feature value of each 360-degree panoramic image and storing the same to the first folder; a non-360 degree panoramic image is subjected to feature extraction of the first feature value, the second feature value, and the third feature value to form a three-dimensional feature value of each non-360 degree panoramic image and stored in the second folder; according to the first preset The three-dimensional feature value of the 360-degree panoramic image and the three-dimensional feature value of the second preset number of non-360-degree panoramic images generate a three-dimensional scattergram, wherein the three-dimensional feature value of each 360-degree panoramic image or a non-360-degree panoramic image Corresponding to a feature point in a three-dimensional scatterplot; converting a three-dimensional scatterplot into a two-dimensional scatterplot; and eigenvalues of a 360-degree panoramic image on a two-dimensional scatterplot and non-360-degree panoramic images The distribution of the eigenvalue determines a boundary value of the eigenvalue of the 360-degree panoramic image and the eigenvalue of the non-360-degree panoramic image to obtain a linear classifier, wherein the eigenvalue of the 360-degree panoramic image on the side of the boundary line is the first region The area where the feature value of the non-360 degree panoramic image on the other side of the boundary line is located is the second area.
本发明实施例公开的电子装置,包括处理器以及存储器,存储器中存储有待识别的图像文件、待识别的视频文件、若干已经识别出的360度全景图像和非360度全景图像,处理器用于执行前述的360度全景图像的识别方法来识别待识别的图像文件是否为360度全景图像,和/或用于执行前述的360度全景视频的识别方法来识别待识别的视频文件是否为360度全景图像,和/或用于 执行前述线性分类器的建立方法来建立线性分类器。The electronic device disclosed in the embodiment of the present invention includes a processor and a memory. The memory stores an image file to be identified, a video file to be identified, a plurality of recognized 360-degree panoramic images, and a non-360-degree panoramic image, and the processor is configured to execute The foregoing method for recognizing a 360-degree panoramic image to identify whether the image file to be recognized is a 360-degree panoramic image, and/or a recognition method for performing the aforementioned 360-degree panoramic video to identify whether the video file to be recognized is a 360-degree panoramic view Image, and/or for The method of establishing the aforementioned linear classifier is performed to establish a linear classifier.
本发明的360度全景图像及360度全景视频的识别方法、线性分类器的建立方法及电子装置,通过得到待识别图像和/或待识别视频中的图像帧的二维特征值,然后与线性分类器定义的第一区域及第二区域进行比较,确定二维特征值位于的区域则可确定待识别图像是否为360度全景图像,或进一步确定待识别视频是否为360度视频,提高了识别的速度,并可有效提高识别准确度。The 360-degree panoramic image and the 360-degree panoramic video recognition method, the linear classifier establishing method and the electronic device of the present invention obtain the two-dimensional feature value of the image frame in the image to be recognized and/or the image to be recognized, and then linearly The first region and the second region defined by the classifier are compared, and the region where the two-dimensional feature value is located is determined whether the image to be identified is a 360-degree panoramic image, or whether the video to be identified is a 360-degree video, and the recognition is improved. Speed and can effectively improve recognition accuracy.
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图1为本发明一实施例中的360度全景图像的识别方法的流程图。FIG. 1 is a flowchart of a method for recognizing a 360-degree panoramic image according to an embodiment of the present invention.
图2为图1中步骤S12在本发明一实施例中的子流程图。2 is a sub-flow diagram of step S12 of FIG. 1 in an embodiment of the present invention.
图3为本发明一实施例中的图像文件的示意图。3 is a schematic diagram of an image file in an embodiment of the present invention.
图4为本发明一实施例中的360度全景视频的识别方法的流程图。FIG. 4 is a flowchart of a method for recognizing a 360-degree panoramic video according to an embodiment of the present invention.
图5为本发明一实施例中线性分类器的建立方法的流程图。FIG. 5 is a flowchart of a method for establishing a linear classifier according to an embodiment of the present invention.
图6为本发明一实施例中的三维散点图的示意图。FIG. 6 is a schematic diagram of a three-dimensional scattergram in an embodiment of the present invention.
图7为本发明一实施例中的二维散点图的示意图。FIG. 7 is a schematic diagram of a two-dimensional scattergram according to an embodiment of the present invention.
图8为本发明另一实施例中的二维散点图的示意图。FIG. 8 is a schematic diagram of a two-dimensional scattergram in another embodiment of the present invention.
图9为本发明一实施例中的电子装置的结构框图。FIG. 9 is a structural block diagram of an electronic device according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性 劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Those of ordinary skill in the art are not creative based on the embodiments of the present invention. All other embodiments obtained under the premise of labor are within the scope of the invention.
请参阅图1,为本发明一实施例中的360度全景图像的识别方法的流程图。其中,360度全景图像的识别方法并不限于如下的执行顺序。360度全景图像的识别方法包括步骤:Please refer to FIG. 1 , which is a flowchart of a method for recognizing a 360-degree panoramic image according to an embodiment of the present invention. The method of recognizing the 360-degree panoramic image is not limited to the following execution order. The method for recognizing a 360-degree panoramic image includes the steps of:
S11:获取待识别的图像文件。S11: Acquire an image file to be identified.
S12:将图像文件进行特征提取,得到包括第一特征值、第二特征值及第三特征值的三维特征值。S12: Perform feature extraction on the image file to obtain a three-dimensional feature value including the first feature value, the second feature value, and the third feature value.
S13:将三维特征值变换成二维特征值。在一些实施例中,步骤S13具体包括:通过一预设的三维坐标变换矩阵将三维特征值变换成二维特征值。进一步的,通过将三维特征值与三维坐标变换矩阵相乘而得到对应的包括两个维度特征的二维特征值。S13: Transform the three-dimensional feature value into a two-dimensional feature value. In some embodiments, step S13 specifically includes: transforming the three-dimensional feature values into two-dimensional feature values through a preset three-dimensional coordinate transformation matrix. Further, by multiplying the three-dimensional feature value and the three-dimensional coordinate transformation matrix, a corresponding two-dimensional feature value including two dimensional features is obtained.
S14:将二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域。在一些实施例中,二维特征值与线性分类器定义的第一区域及第二区域位于同一坐标体系中,线性分类器定义的第一区域对应一第一坐标集合,第二区域对应一第二坐标集合,二维特征值对应一坐标,通过将二维特征值的坐标与第一坐标集合以及第二坐标集合进行比较,判断二维特征值的坐标位于第一坐标集合还是第二坐标集合,当二维特征值对应的坐标位于第一坐标集合中时,确定二维特征值所处的区域为第一区域,以及当二维特征值对应的坐标位于第二坐标集合中时,确定二维特征值所处的区域为第二区域。S14: Comparing the two-dimensional feature value with the first region and the second region defined by a linear classifier to determine a region in which the two-dimensional feature value is distributed. In some embodiments, the two-dimensional feature value is located in the same coordinate system as the first region and the second region defined by the linear classifier, the first region defined by the linear classifier corresponds to a first coordinate set, and the second region corresponds to a first a set of two coordinates, the two-dimensional feature value corresponding to a coordinate, by comparing the coordinates of the two-dimensional feature value with the first coordinate set and the second coordinate set, determining whether the coordinate of the two-dimensional feature value is located in the first coordinate set or the second coordinate set When the coordinates corresponding to the two-dimensional feature value are located in the first coordinate set, determining that the region where the two-dimensional feature value is located is the first region, and when the coordinate corresponding to the two-dimensional feature value is located in the second coordinate set, determining two The area in which the dimension feature value is located is the second area.
S15:当二维特征值分布的区域为第一区域时,确认待识别的图像文件为360度全景图像。S15: When the area of the two-dimensional feature value distribution is the first area, confirm that the image file to be recognized is a 360-degree panoramic image.
S16:当二维特征值分布的区域为第二区域时,确定待识别的图像文件不为360度全景图像。S16: When the area of the two-dimensional feature value distribution is the second area, it is determined that the image file to be identified is not a 360-degree panoramic image.
其中,第一区域为线性分类器中定义的360度全景图像的二维特征值分布的区域,第二区域为线性分类器中定义的非360度全景图像的二维特征值分布的区域。The first region is a region of a two-dimensional feature value distribution of a 360-degree panoramic image defined in the linear classifier, and the second region is a region of a two-dimensional feature value distribution of the non-360-degree panoramic image defined in the linear classifier.
从而,本申请中,通过获取图像文件的二维特征值与一预先设定的线性分类器进行比较即可快速确定出图像文件是否为360度全景图像,识别过程更简 单且更准确。Therefore, in the present application, by comparing the two-dimensional feature value of the image file with a preset linear classifier, it is possible to quickly determine whether the image file is a 360-degree panoramic image, and the recognition process is simpler. Single and more accurate.
请一并参阅图2及图3,图2为步骤S12在一实施例中的子流程图,图3为图像文件M1的示意图,如图3所示,图像文件M1包括m*n个像素点P1,即m行n列的像素点P1,其中m、n为大于1的正整数,m和n可相等或不相等。步骤S12包括:Referring to FIG. 2 and FIG. 3 together, FIG. 2 is a sub-flow chart of step S12 in an embodiment, and FIG. 3 is a schematic diagram of an image file M1. As shown in FIG. 3, the image file M1 includes m*n pixels. P1, that is, pixel point P1 of m rows and n columns, where m and n are positive integers greater than 1, and m and n may be equal or unequal. Step S12 includes:
S121:获取图像文件M1的第一行C1、最后一行Cm、第一列L1以及最后一列Ln的像素点的灰度值。在一些实施例中,步骤S122获取的为图像文件M1的第一行C1、最后一行Cm、第一列L1以及最后一列Ln的所有像素点的灰度值。其中,第一行C1可为图像文件M1第一行,最后一行Cm可为图像文件M1的最后一行,第一列L1可为图像文件M1的第一列,最后一列Ln可为图像文件M1的最后一列。S121: Acquire gray values of pixel points of the first row C1, the last row Cm, the first column L1, and the last column Ln of the image file M1. In some embodiments, the grayscale values of all the pixel points of the first row C1, the last row Cm, the first column L1, and the last column Ln of the image file M1 are acquired in step S122. The first row C1 may be the first row of the image file M1, the last row Cm may be the last row of the image file M1, the first column L1 may be the first column of the image file M1, and the last column Ln may be the image file M1. last row.
S123:从第一行C1、最后一行Cm分别提取若干个行采样点的灰度值,以及从第一列L1以及最后一列Ln分别提取若干个列采样点的灰度值。在一些实施例中,为从第一行C1、最后一行Cm以均匀间隔分别提取第一预设个行采样点的灰度值;以及从第一列L1以及最后一列Ln以均匀间隔分别提取第二预设个列采样点的灰度值。在一些实施例中,如果图像文件M1的像素点太少,则可复制图像文件M1的对应行或列的部分像素点补充至若干个行采样点或列采样点中。其中,在一些实施例中,若干个行采样点与列采样点的数量可相等或不相等,例如若干个行采样点为300个,若干个列采样点为150个。S123: Extract the gray values of the plurality of row sampling points from the first row C1 and the last row Cm, and extract the gray values of the plurality of column sampling points from the first column L1 and the last column Ln, respectively. In some embodiments, the gray values of the first preset line sampling points are respectively extracted from the first row C1 and the last row Cm at even intervals; and the first column L1 and the last column Ln are separately extracted at even intervals. The gray value of the two preset column sampling points. In some embodiments, if the pixel point of the image file M1 is too small, a portion of the pixel of the corresponding row or column of the copyable image file M1 is supplemented into a number of row or column sample points. In some embodiments, the number of the plurality of row sampling points and the column sampling points may be equal or unequal, for example, a plurality of row sampling points are 300, and a plurality of column sampling points are 150.
S125:计算第一行C1及最后一行Cm的若干个行采样点的灰度值的方差的均值得到第一特征值。S125: Calculate a mean value of variances of gray values of a plurality of row sampling points of the first row C1 and the last row Cm to obtain a first feature value.
具体的,为分别计算第一行C1的若干个行采样点的灰度值的方差以及最后一行Cm的若干个行采样点的灰度值的方差后对两个方差求均值得到第一特征值。设第一行C1的若干个行采样点的灰度值的方差为F1,最后一行Cm的若干个行采样点的灰度值的方差为F2,则第一特征值=(F1+F2)/2。第一行C1的若干个行采样点的灰度值的方差代表了第一行C1的若干个行采样点的灰度值之差,最后一行Cm的若干个行采样点的灰度值的方差代表了最后一行Cm的若干个行采样点的灰度值之差。第一行C1灰度值的方差与最后一行Cm的若干个行采样点的灰度值的方差的均值,即第一特征值代表了第一行C1与 最后一行Cm的所有行采样点的灰度值之差。其中,若图像文件M1为360度全景图像,一般第一行C1的若干行采样点的灰度值的方差与最后一行Cm的若干个行采样点的灰度值的方差均会很小,接近于零。Specifically, the variance of the gray value of the plurality of row sampling points of the first row C1 and the variance of the gray values of the plurality of row sampling points of the last row C1 are respectively calculated, and then the average of the two variances is averaged to obtain the first eigenvalue. . Let the variance of the gray value of several row sampling points of the first row C1 be F1, and the variance of the gray value of several row sampling points of the last row Cm be F2, then the first characteristic value=(F1+F2)/ 2. The variance of the gray values of the plurality of row sampling points of the first row C1 represents the difference between the gray values of the plurality of row sampling points of the first row C1, and the variance of the gray values of the plurality of row sampling points of the last row Cm. It represents the difference between the gray values of several line sampling points of the last line Cm. The mean of the variance of the gray value of the first row C1 gray value and the gray value of several row sample points of the last row Cm, that is, the first feature value represents the first row C1 and The difference between the gray values of all the sample points of the last line Cm. Wherein, if the image file M1 is a 360-degree panoramic image, generally, the variance of the gray value of the sampling points of the plurality of rows of the first row C1 and the variance of the gray values of the plurality of row sampling points of the last row of Cm are small, close to each other. At zero.
S127:计算第一列L1及最后一列Ln的若干个列采样点的灰度值的方差的均值得到第二特征值。具体的,为分别计算得到第一列L1的若干个列采样点的灰度值的方差以及最后一列Ln的若干个列采样点的灰度值的方差后,对两个方差求均值得到第二特征值。设第一列L1的若干个列采样点的灰度值的方差为F3,最后一列Ln的若干个列采样点的灰度值的方差为F4,第二特征值=(F3+F4)/2。S127: Calculate a mean value of variances of gray values of the plurality of column sampling points of the first column L1 and the last column Ln to obtain a second feature value. Specifically, after calculating the variance of the gray value of the plurality of column sampling points of the first column L1 and the variance of the gray values of the plurality of column sampling points of the last column L1, the average of the two variances is obtained. Eigenvalues. Let the variance of the gray values of several column sampling points of the first column L1 be F3, and the variance of the gray values of several column sampling points of the last column Ln is F4, and the second characteristic value=(F3+F4)/2 .
S129:分别计算第一列L1的若干个列采样点的灰度值与最后一列Ln对应位置的列采样点的灰度值的差值的平方得到若干差值的平方,然后计算得到的若干差值的平方的平均值得到第三特征值。S129: respectively calculating the square of the difference between the gray value of the plurality of column sampling points of the first column L1 and the gray value of the column sampling point of the position corresponding to the last column Ln to obtain a square of the difference, and then calculating the difference The average of the squares of the values yields a third eigenvalue.
具体的,第一列L1中的若干个列采样点的位置与最后一列Ln的若干个列采样点的位置一一对应,通过分别计算第一列L1的列采样点与最后一列Ln对应位置处的列采样点之间的差值,然后对差值进行平方,分别得到第一列L1的各个列采样点与最后一列Ln对应位置处的列采样点的灰度值的差值的平方,从而得到若干个差值的平方。例如,计算第一列L1的第一个列采样点与最后一列Ln对应位置处的第一个列采样点之间的灰度值的差值然后进行平方,得到第一个差值的平方,计算第一列的L1的第二个列采样点与最后一列Ln对应位置处的第二个列采样点之间的灰度值的差值然后进行平方,得到第二个差值的平方等等,从而得到若干个差值的平方。其中,若图像文件M1为360度全景图像,若干个差值的平方都很小,接近于零。Specifically, the positions of the plurality of column sampling points in the first column L1 are in one-to-one correspondence with the positions of the plurality of column sampling points of the last column L1, and the positions of the column sampling points of the first column L1 and the last column Ln are respectively calculated. The difference between the sampling points of the column, and then squaring the difference, respectively obtaining the square of the difference between the gray values of the column sampling points at the positions corresponding to the respective column sampling points of the first column L1 and the last column Ln, thereby Get the square of several differences. For example, calculating the difference between the gray value between the first column sample point of the first column L1 and the first column sample point at the position corresponding to the last column Ln, and then squaring, to obtain the square of the first difference, Calculating the difference between the gray value between the second column sample point of L1 of the first column and the second column sample point at the position corresponding to the last column Ln, and then squared to obtain the square of the second difference value, etc. , thus obtaining the square of several differences. Wherein, if the image file M1 is a 360-degree panoramic image, the squares of the plurality of differences are both small and close to zero.
请参阅图4,为本发明一实施例中的360度全景视频的识别方法的流程图。如图4所示,360度全景视频的识别方法包括步骤:Please refer to FIG. 4 , which is a flowchart of a method for recognizing a 360-degree panoramic video according to an embodiment of the present invention. As shown in FIG. 4, the method for recognizing a 360-degree panoramic video includes the following steps:
S31:获取待识别的视频文件。S31: Acquire a video file to be identified.
S32:从待识别的视频文件中提取至少一帧代表图像帧。S32: Extract at least one frame representative image frame from the video file to be identified.
在一些实施例中,代表图像帧至少基于以下选取原则中的至少一种进行选取:1、选取视频文件中的关键帧作为代表图像帧,一般关键帧包含一个完整的帧画面,比其他类型帧具有更高的图像质量,关键帧往往包括一个摄像镜头 的开始时段,相邻的关键帧之间有较大的差异,有利于提高识别样本的多样性;2、选取画面变化丰富的帧图像作为代表图像帧;3、选取多个位于视频文件中的时间轴的位置覆盖的时间段超过预设值的多个图像帧作为多个代表图像帧,例如,设视频文件时长为2小时,则尽可能从开始到最后的时间段内间隔性地选择多个图像帧作为代表图像帧,多个图像帧的时间跨度可以为1小时50分钟等。In some embodiments, the representative image frame is selected based on at least one of the following selection principles: 1. The key frame in the video file is selected as the representative image frame, and the general key frame includes a complete frame picture, compared to other types of frames. With higher image quality, keyframes often include a camera lens In the beginning period, there is a big difference between adjacent key frames, which is beneficial to improve the diversity of the recognition samples; 2. Select a frame image with rich picture changes as a representative image frame; 3. Select multiple video files in the video file. The time frame covers a plurality of image frames whose time period exceeds a preset value as a plurality of representative image frames. For example, if the duration of the video file is 2 hours, the interval is selected as much as possible from the beginning to the last time. The image frames are represented as representative image frames, and the time span of the plurality of image frames may be 1 hour and 50 minutes, and the like.
S33:对每一代表图像帧进行特征提取,得到每一代表图像帧的第一特征值、第二特征值及第三特征值的三维特征值。S33: Perform feature extraction on each representative image frame to obtain a first feature value, a second feature value, and a third feature value of the third feature value of each representative image frame.
S34:将每一代表图像帧的三维特征值变换成二维特征值。S34: Convert the three-dimensional feature value of each representative image frame into a two-dimensional feature value.
S35:将每一代表图像帧的二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域。在一些实施例中,二维特征值与线性分类器定义的第一区域及第二区域位于同一坐标体系中,线性分类器定义的第一区域对应一第一坐标集合,第二区域对应一第二坐标集合。每一代表图像帧的二维特征值对应一坐标,通过将每一代表图像帧的二维特征值的坐标与第一坐标集合以及第二坐标集合进行比较,判断二维特征值的坐标位于第一坐标集合还是第二坐标集合,当二维特征值对应的坐标位于第一坐标集合中时,确定对应的代表图像帧的二维特征值所处的区域为第一区域,当二维特征值对应的坐标位于第二坐标集合中时,确定对应的代表图像帧的二维特征值所处的区域为第二区域。S35: Compare the two-dimensional feature value of each representative image frame with the first region and the second region defined by a linear classifier, and determine an area where the two-dimensional feature value is distributed. In some embodiments, the two-dimensional feature value is located in the same coordinate system as the first region and the second region defined by the linear classifier, the first region defined by the linear classifier corresponds to a first coordinate set, and the second region corresponds to a first A set of two coordinates. The two-dimensional feature value of each representative image frame corresponds to a coordinate, and the coordinates of the two-dimensional feature value of each representative image frame are compared with the first coordinate set and the second coordinate set to determine that the coordinates of the two-dimensional feature value are located at the A coordinate set is also a second coordinate set. When the coordinate corresponding to the two-dimensional feature value is located in the first coordinate set, determining that the corresponding two-dimensional feature value of the representative image frame is in the first region, when the two-dimensional feature value When the corresponding coordinate is located in the second coordinate set, it is determined that the region where the corresponding two-dimensional feature value of the representative image frame is located is the second region.
S36:当某一代表图像帧的二维特征值分布的区域为第一区域时,确认代表图像帧为360度全景图像。S36: When the area of the two-dimensional feature value distribution of the representative image frame is the first area, it is confirmed that the representative image frame is a 360-degree panoramic image.
S37:当某一代表图像帧的二维特征值分布的区域为第二区域时,确定代表图像帧不为360度全景图像。S37: When the area of the two-dimensional feature value distribution of the representative image frame is the second area, it is determined that the representative image frame is not a 360-degree panoramic image.
S38:在至少一帧代表图像帧都识别完以后,根据至少一帧代表图像帧中的360度全景图像的比例确定待识别的视频文件是否为360度全景视频。具体的,判断至少一帧代表图像帧中的360度全景图像的比例是否大于或等于一预设比例;如果是,则确定视频文件为360度全景视频,如果否,则确定视频文件不为360度全景视频。其中,预设比例可为80%、100%等。S38: After the at least one frame representative image frame is identified, determining whether the video file to be identified is a 360-degree panoramic video according to a proportion of the 360-degree panoramic image in the at least one frame representative image frame. Specifically, determining whether at least one frame represents a proportion of a 360-degree panoramic image in the image frame is greater than or equal to a preset ratio; if yes, determining that the video file is a 360-degree panoramic video, and if not, determining that the video file is not 360 Degree panoramic video. Among them, the preset ratio can be 80%, 100%, and the like.
其中,步骤S33-S37分别对应图1中的步骤S12-S16。步骤S33-S37的更 具体的步骤请参见前述对步骤S12-S16的具体描述。即,任一个代表图像帧相当于一个图像文件,图4中识别任一个代表图像帧是否为360度全景图像的方法与图1中识别图像文件是否为360度全景图像的方法相同,同时也进一步包括图1中针对每个步骤的具体描述,例如包括图2中描述的针对步骤S12的子步骤。Wherein, steps S33-S37 correspond to steps S12-S16 in FIG. 1, respectively. Steps S33-S37 For specific steps, please refer to the foregoing detailed description of steps S12-S16. That is, any one of the representative image frames corresponds to one image file, and the method of recognizing whether any one of the representative image frames is a 360-degree panoramic image in FIG. 4 is the same as the method of identifying whether the image file is a 360-degree panoramic image in FIG. A detailed description of each step in FIG. 1 is included, including, for example, the sub-steps described in FIG. 2 for step S12.
例如,步骤S33可具体包括:提取每一代表图像帧的第一行、最后一行、第一列以及最后一列的像素点的像素值;从每一代表图像帧的第一行、最后一行分别提取若干个数行采样点,以及从每一代表图像帧的第一列以及最后一列分别提取若干个数列采样点;计算每一代表图像帧的第一行及最后一行的若干个数行采样点的方差的均值得到每一代表图像帧的第一特征值;计算每一代表图像帧的第一列及最后一列的若干个数列采样点的方差的均值得到每一代表图像帧的第二特征值;以及分别计算每一代表图像帧的第一列的若干个数列采样点与最有一列对应位置的采样点的差值的平方得到每一代表图像帧的若干差值的平方,然后计算得到的若干差值的平方的平均值得到每一代表图像帧的第三特征值。For example, step S33 may specifically include: extracting pixel values of pixel points of each of the first row, the last row, the first column, and the last column of each representative image frame; respectively extracting from the first row and the last row of each representative image frame a plurality of rows of sampling points, and extracting a plurality of series of sampling points from the first column and the last column of each representative image frame; calculating a plurality of rows of sampling points of each of the first row and the last row of each representative image frame The mean value of the variance obtains a first feature value of each representative image frame; calculating a mean value of variances of the plurality of series of sample points of the first column and the last column of each representative image frame to obtain a second feature value of each representative image frame; And separately calculating a square of a difference between a plurality of series of sampling points of the first column of each representative image frame and a sampling point of the most one of the corresponding positions to obtain a square of a plurality of differences of each representative image frame, and then calculating the obtained squares The average of the squares of the differences yields a third eigenvalue for each representative image frame.
同样的,本申请中,通过获取视频文件中各个代表图像帧的二维特征值,并与一预先设定的线性分类器进行比较即可快速确定出各个代表图像帧是否为360度全景图像,然后根据各个代表图像帧的识别结果可快速确定视频文件是否为360度视频文件,识别过程更简单且更准确。Similarly, in the present application, by obtaining two-dimensional feature values of each representative image frame in the video file and comparing with a preset linear classifier, it is possible to quickly determine whether each representative image frame is a 360-degree panoramic image. Then, according to the recognition result of each representative image frame, it can be quickly determined whether the video file is a 360-degree video file, and the recognition process is simpler and more accurate.
请一并参阅图5-图7,图5为本发明一实施例中的线性分类器的建立方法的流程示意图。其中,图5中所示步骤可执行于前述的360度视频识别方法或360度图像识别方法之前,用于预先建立用于360度视频识别以及360度图像识别的线性分类器。线性分类器的建立方法包括:Please refer to FIG. 5 to FIG. 7. FIG. 5 is a schematic flowchart diagram of a method for establishing a linear classifier according to an embodiment of the present invention. Wherein, the steps shown in FIG. 5 can be performed before the aforementioned 360-degree video recognition method or 360-degree image recognition method for pre-establishing a linear classifier for 360-degree video recognition and 360-degree image recognition. The method for establishing a linear classifier includes:
S61:预先将第一预设数量的360度全景图像存储至第一文件夹以及第二预设数量的非360度全景图像存储至第二文件夹。S61: Store the first preset number of 360-degree panoramic images to the first folder and the second preset number of non-360-degree panoramic images to the second folder in advance.
S62:将每一360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一360度全景图像的三维特征值并存储至第一文件夹。S62: Extracting the feature of the first feature value, the second feature value, and the third feature value for each 360-degree panoramic image to form a three-dimensional feature value of each 360-degree panoramic image and storing the same to the first folder.
S63:将每一非360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一非360度全景图像的三维特征值并存储至第二文件 夹。S63: extracting features of the first feature value, the second feature value, and the third feature value for each non-360 degree panoramic image to form a three-dimensional feature value of each non-360 degree panoramic image and storing the same to the second file. folder.
S64:根据第一预设数量的360度全景图像的三维特征值以及第二预设数量的非360度全景图像的三维特征值生成三维散点图,其中每一360度全景图像或一非360度全景图像的三维特征值对应为三维散点图中的一个特征点。S64: Generate a three-dimensional scatterplot according to the three-dimensional feature value of the first preset number of 360-degree panoramic images and the three-dimensional feature values of the second preset number of non-360-degree panoramic images, wherein each 360-degree panoramic image or one non-360 The three-dimensional feature value of the panoramic image corresponds to one feature point in the three-dimensional scattergram.
如图6所示,三维散点图T1的三维坐标分别为以第一特征值、第二特征值以及第三特征值作为维度的坐标,第一预设数量的360度全景图像的三维特征值以及第二预设数量的非360度全景图像的三维特征值的每一个构成了三维散点图T1中的点。例如,如图6所示,其中的黑色点为非360度全景图像的三维特征值对应的点,白色点为360度全景图像的三维特征值对应的点。As shown in FIG. 6, the three-dimensional coordinates of the three-dimensional scattergram T1 are the coordinates of the first feature value, the second feature value, and the third feature value, respectively, and the three-dimensional feature values of the first preset number of 360-degree panoramic images. And each of the three-dimensional feature values of the second predetermined number of non-360 degree panoramic images constitutes a point in the three-dimensional scattergram T1. For example, as shown in FIG. 6, the black dots are points corresponding to the three-dimensional feature values of the non-360 degree panoramic image, and the white dots are points corresponding to the three-dimensional feature values of the 360-degree panoramic image.
S65:将三维散点图转换成二维散点图。S65: Converting a three-dimensional scattergram into a two-dimensional scatterplot.
在一些实施例中,为通过预设的三维坐标变换矩阵将三维散点图中的所有的三维特征值转换为二维特征值,而得到所有二维特征值形成的二维散点图。其中,三维坐标变换矩阵与前面识别过程中的三维坐标变换矩阵是一样的,从而,保证在识别过程中的转换标准完全一样。如图7所示,二维散点图T2可以视为三维散点图以预设角度旋转,并投影到一使得其中的特征点尽量不重叠的二维平面上得到的。如图所示,代表非360度全景图像的三维特征值的黑色点与代表360度全景图像的三维特征值的白色点在二维散点图上呈现二维分布,更加直观。In some embodiments, a two-dimensional scattergram formed by all the two-dimensional feature values is obtained by converting all three-dimensional feature values in the three-dimensional scattergram into two-dimensional feature values through a preset three-dimensional coordinate transformation matrix. Among them, the three-dimensional coordinate transformation matrix is the same as the three-dimensional coordinate transformation matrix in the previous recognition process, thereby ensuring that the conversion criteria in the recognition process are exactly the same. As shown in FIG. 7, the two-dimensional scattergram T2 can be regarded as a three-dimensional scattergram rotated at a preset angle and projected onto a two-dimensional plane in which the feature points are not overlapped as much as possible. As shown in the figure, a black point representing a three-dimensional feature value of a non-360 degree panoramic image and a white point representing a three-dimensional feature value of a 360-degree panoramic image are two-dimensionally distributed on the two-dimensional scattergram, which is more intuitive.
S66:根据二维散点图上360度全景图像的特征值以及非360度全景图像的特征值的分布确定360度全景图像的特征值以及非360度全景图像的特征值的分界线J1,以得到线性分类器。其中,分界线一侧的360度全景图像的特征值所在区域为第一区域,即为如图7所示的白色点分布的区域A1,分界线另一侧的非360度全景图像的特征值所在区域为第二区域,即为如图7所示的黑色点分布的区域A2。在一些实施例中,线性分类器即为通过分界线J1分成了第一区域和第二区域的二维图。在另一些实施例中,线性分类器可以视为一二维坐标系中,通过分界线J1定义的坐标集合所分成的两个坐标集合。S66: determining a boundary value J1 of the feature value of the 360-degree panoramic image and the feature value of the non-360-degree panoramic image according to the feature value of the 360-degree panoramic image on the two-dimensional scattergram and the distribution of the feature values of the non-360-degree panoramic image, to Get a linear classifier. The area where the feature value of the 360-degree panoramic image on one side of the boundary line is located is the first area, that is, the area A1 of the white point distribution as shown in FIG. 7, and the characteristic value of the non-360 degree panoramic image on the other side of the boundary line. The area in which it is located is the second area, that is, the area A2 in which black dots are distributed as shown in FIG. In some embodiments, the linear classifier is a two-dimensional map that is divided into a first region and a second region by a boundary line J1. In other embodiments, the linear classifier can be viewed as a set of two coordinates divided by a set of coordinates defined by the boundary line J1 in a two-dimensional coordinate system.
如图7所示,分界线J1为黑色点与白色点之间的曲线,即第一区域和第二区域之间通过曲线分隔。如图8所示,在另一实施例中,分界线J1还可为黑色点与白色点之间的多段直线构成,即第一区域和第二区域之间通过多段直 线进行分隔。As shown in FIG. 7, the boundary line J1 is a curve between the black point and the white point, that is, the first area and the second area are separated by a curve. As shown in FIG. 8, in another embodiment, the boundary line J1 may also be a multi-segment line between a black point and a white point, that is, a plurality of straight lines between the first area and the second area Lines are separated.
其中,步骤S62中的将每一360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一360度全景图像的三维特征值以及步骤S63中的将每一非360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一非360度全景图像的三维特征值与图1中步骤S12相同。例如,步骤S62或S63包括:提取360度全景图像或非360度全景图像的第一行、最后一行、第一列以及最后一列的像素点的灰度值;从第一行、最后一行分别提取若干个行采样点的灰度值,以及从第一列以及最后一列分别提取若干个列采样点的灰度值;计算第一行及最后一行的若干个行采样点的灰度值的方差的均值得到第一特征值;计算第一列及最后一列的若干个列采样点的灰度值的方差的均值得到第二特征值;以及分别计算第一列的若干个列采样点的灰度值与最后一列对应位置的采样点的灰度值的差值的平方得到若干差值的平方,然后计算得到的若干差值的平方的平均值得到第三特征值。更具体的步骤可参考图2所示的流程图及其相关描述。The feature of the first feature value, the second feature value, and the third feature value is extracted for each 360-degree panoramic image in step S62 to form a three-dimensional feature value of each 360-degree panoramic image and each of the steps S63 The non-360 degree panoramic image performs feature extraction of the first feature value, the second feature value, and the third feature value to form a three-dimensional feature value of each non-360 degree panoramic image, which is the same as step S12 in FIG. For example, step S62 or S63 includes: extracting gray values of pixels of the first row, the last row, the first column, and the last column of the 360-degree panoramic image or the non-360-degree panoramic image; respectively, extracting from the first row and the last row respectively The gray value of a plurality of row sampling points, and the gray values of the plurality of column sampling points are respectively extracted from the first column and the last column; and the variance of the gray value of the plurality of row sampling points of the first row and the last row is calculated. Mean value obtains a first eigenvalue; calculating a mean value of variances of gradation values of a plurality of column sampling points of the first column and the last column to obtain a second eigenvalue; and calculating gray values of the plurality of column sampling points of the first column respectively The square of the difference between the gray values of the sampling points corresponding to the last column obtains the square of the difference, and then the average of the squares of the calculated differences yields the third characteristic value. For more specific steps, reference may be made to the flowchart shown in FIG. 2 and its related description.
其中,前述的360度全景图像的识别方法中的步骤S14还可为:通过预设的向量叉乘算法计算二维特征值在第一区域及第二区域的分界线的哪一侧,从而确定二维特征值所处的区域为第一区域还是第二区域。The step S14 in the foregoing method for recognizing the 360-degree panoramic image may further be: determining, by a preset vector cross-multiplication algorithm, which side of the boundary between the first region and the second region the two-dimensional feature value is, thereby determining Whether the area where the two-dimensional feature value is located is the first area or the second area.
前述的360度全景视频的识别方法中的步骤S35还可为:通过预设的向量叉乘算法计算每一代表图像帧的二维特征值在第一区域及第二区域的分界线的哪一侧,从而确定每一代表图像帧的二维特征值所处的区域为第一区域还是第二区域。The step S35 in the foregoing method for recognizing the 360-degree panoramic video may further be: calculating, by a preset vector cross-multiplication algorithm, which of the boundary points of the first region and the second region of the two-dimensional feature value of each representative image frame Side, thereby determining whether the area in which the two-dimensional feature value of each representative image frame is located is the first area or the second area.
具体的,可以将二维特征值与位于线性分类器的第一区域或第二区域中的点进行向量叉乘,通过“同向法”的原理,利用叉积来判断这两个点是否在分界线J1的同一侧,从而判断二维特征值为位于第一区域中还是第二区域中。Specifically, the two-dimensional feature value may be vector-multiplied with the point located in the first region or the second region of the linear classifier, and the cross-product is used to determine whether the two points are in the same by the principle of "same direction method" The same side of the boundary line J1, thereby judging whether the two-dimensional feature value is located in the first region or in the second region.
请参阅图9,为本发明一实施例中的电子装置100的结构框图。如图1所示,电子装置100包括处理器10及存储器20。Please refer to FIG. 9 , which is a structural block diagram of an
存储器20存储有待识别的图像文件和/或视频文件。其中,存储器20中存储的图像文件和/或视频文件为预先存储于存储器20中的,也可为临时从服务器下载或者从其他电子装置100接收的。其中,前述的线性分类器也存储于
存储器20中,且前述的第一文件夹和第二文件夹均为存储器20中的文件夹。The
在一些实施例中,电子装置100还包括通信单元30,处理器10可预先通过通信单元30与服务器或其他电子装置建立通信连接,而从服务器或其他电子装置接收待识别的图像文件和/或视频文件,并存储于存储器20中。通信单元30可为有线或无线通信模块,例如可为有线网络接口单元、WIFI模组、蓝牙模组等。In some embodiments, the
处理器10用于对存储器20存储的待识别的图像文件和/或视频文件进行分析,识别是否为360度全景图像和/或360度全景视频。The
其中,处理器10用于至少执行如图1-2及图5所示的任一方法来识别待识别的图像文件是否为360度全景图像。The
处理器10并用于至少执行如图4-5所示方法步骤及图2所示的相关方法步骤来识别待识别的视频文件是否为360度全景视频。The
在一些实施例中,存储器20中存储有若干程序指令,处理器10调用执行若干程序指令后,执行如图1-2及图5所示的任一方法来识别待识别的图像文件是否为360度全景图像,和/或执行如图4-5所示的方法步骤及图2所示的相关方法步骤来识别待识别的视频文件是否为360度全景视频。In some embodiments, a plurality of program instructions are stored in the
在一些实施例中,存储器20还存储有若干已经识别出的360度全景图像和非360度全景图像。处理器10还用于执行或者调用执行若干程序指令后执行如图5所示线性分类器的建立方法。In some embodiments, the
例如,处理器10执行如下方法识别待识别的图像文件是否为360度全景图像:获取待识别的图像文件;将图像文件进行特征提取,得到第一特征值、第二特征值及第三特征值的三维特征值;将三维特征值变换成二维特征值;将二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域;当二维特征值分布的区域为第一区域时,确认待识别的图像文件为360度全景图像;以及当二维特征值分布的区域为第二区域时,确定待识别的图像文件不为360度全景图像。For example, the
又例如,处理器10执行如下方法识别待识别的视频文件是否为360度全景视频:获取待识别的视频文件;从待识别的视频文件中提取至少一帧代表图像帧;对每一代表图像帧进行特征提取,得到每一代表图像帧的第一特征值、 第二特征值及第三特征值的三维特征值;将每一代表图像帧的三维特征值变换成二维特征值;将每一代表图像帧的二维特征值与一线性分类器定义的第一区域及第二区域进行比较,确定二维特征值所分布的区域;当某一代表图像帧的二维特征值分布的区域为第一区域时,确认代表图像帧为360度全景图像;当某一代表图像帧的二维特征值分布的区域为第二区域时,确定代表图像帧不为360度全景图像;以及根据至少一帧代表图像帧中的360度全景图像的比例确定待识别的视频文件是否为360度全景视频。For another example, the processor 10 performs the following method: determining whether the video file to be identified is a 360-degree panoramic video: acquiring a video file to be identified; extracting at least one frame representative image frame from the video file to be identified; for each representative image frame Performing feature extraction to obtain a first feature value of each representative image frame, a three-dimensional feature value of the second feature value and the third feature value; transforming the three-dimensional feature value of each representative image frame into a two-dimensional feature value; and defining a two-dimensional feature value of each representative image frame with a linear classifier A region and a second region are compared to determine a region in which the two-dimensional feature value is distributed; when a region of the two-dimensional feature value distribution of the representative image frame is the first region, the representative image frame is confirmed to be a 360-degree panoramic image; When a region representing a two-dimensional feature value distribution of the image frame is the second region, determining that the representative image frame is not a 360-degree panoramic image; and determining a to-be-recognized according to a proportion of the 360-degree panoramic image in the at least one frame representative image frame Whether the video file is a 360-degree panoramic video.
又例如,处理器10执行如下方法建立线性分类器:预先将第一预设数量的360度全景图像存储至第一文件夹以及第二预设数量的非360度全景图像存储至第二文件夹;将每一360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一360度全景图像的三维特征值并存储至第一文件夹;将每一非360度全景图像进行第一特征值、第二特征值及第三特征值的特征提取而形成每一非360度全景图像的三维特征值并存储至第二文件夹;根据第一预设数量的360度全景图像的三维特征值以及第二预设数量的非360度全景图像的三维特征值生成三维散点图,其中每一360度全景图像或一非360度全景图像的三维特征值对应为三维散点图中的一个特征点;将三维散点图转换成二维散点图;根据二维散点图上360度全景图像的特征值以及非360度全景图像的特征值的分布确定360度全景图像的特征值以及非360度全景图像的特征值的分界线,以得到线性分类器,其中,分界线一侧的360度全景图像的特征值所在区域为第一区域,分界线另一侧的非360度全景图像的特征值所在区域为第二区域。For another example, the
其中,处理器40可为微控制器、微处理器、单片机、数字信号处理器等。The processor 40 can be a microcontroller, a microprocessor, a single chip, a digital signal processor, or the like.
存储器20可为存储卡、固态存储器、微硬盘、光盘等任意可存储信息的存储设备。The
在一些实施例中,本发明还提供一种计算机可读存储介质,计算机可读存储介质中存储有若干程序指令,若干程序指令供处理器10调用执行后,执行图1、图3-7的任一方法步骤,从而识别图像文件是否为360度全景图像和/或识别视频文件是否为360度全景视频。在一些实施例中,计算机存储介质即为存储器20,可为存储卡、固态存储器、微硬盘、光盘等任意可存储信息的
存储设备。In some embodiments, the present invention further provides a computer readable storage medium having a plurality of program instructions stored therein for execution by the
电子装置100可为手机、平板电脑、笔记本电脑、桌面型电脑等,也可为智能头盔,智能眼镜等头戴式设备。The
从而,通过本发明的360度全景图像及360度全景视频的识别方法及电子装置,通过确定目标图像帧,然后分析目标图像帧的第一列的像素点与最后一列的像素点之间的灰度差值以及分析目标图像帧的第一行的像素点之间的灰度差值以及最后一行的像素点之间的灰度差值来判断目标图像帧是否为360度全景图像帧,继而判断对应的图像或视频是否为360度全景图像或360度全景视频,可有效提高识别准确度。Thus, by the 360 degree panoramic image and the 360 degree panoramic video recognition method and the electronic device of the present invention, by determining the target image frame, and then analyzing the gray between the pixel of the first column of the target image frame and the pixel of the last column Determining whether the target image frame is a 360-degree panoramic image frame, and then determining whether the target image frame is a 360-degree panoramic image frame by analyzing the grayscale difference between the pixel points of the first row of the target image frame and the grayscale difference between the pixels of the last row. Whether the corresponding image or video is a 360-degree panoramic image or a 360-degree panoramic video can effectively improve the recognition accuracy.
以上是本发明的优选实施例,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。 The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. These improvements and retouchings are also considered as The scope of protection of the invention.
Claims (19)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2017/093011 WO2019010704A1 (en) | 2017-07-14 | 2017-07-14 | Panoramic image and video recognition method, classifier establishment method and electronic apparatus |
| CN201780004656.2A CN108475338B (en) | 2017-07-14 | 2017-07-14 | Panoramic image, video recognition method, classifier establishment method and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2017/093011 WO2019010704A1 (en) | 2017-07-14 | 2017-07-14 | Panoramic image and video recognition method, classifier establishment method and electronic apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019010704A1 true WO2019010704A1 (en) | 2019-01-17 |
Family
ID=63266491
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/093011 Ceased WO2019010704A1 (en) | 2017-07-14 | 2017-07-14 | Panoramic image and video recognition method, classifier establishment method and electronic apparatus |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108475338B (en) |
| WO (1) | WO2019010704A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113711274A (en) * | 2019-04-15 | 2021-11-26 | 皮卡特有限责任公司 | Method for realizing augmented reality |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101394573A (en) * | 2008-10-30 | 2009-03-25 | 清华大学 | A method and system for generating panoramas based on feature matching |
| CN101894262A (en) * | 2009-05-20 | 2010-11-24 | 索尼株式会社 | Method and device for classifying images |
| US20120045095A1 (en) * | 2010-08-18 | 2012-02-23 | Canon Kabushiki Kaisha | Image processing apparatus, method thereof, program, and image capturing apparatus |
| CN102609713A (en) * | 2011-01-20 | 2012-07-25 | 索尼公司 | Method and equipment for classifying images |
| CN106778762A (en) * | 2016-12-31 | 2017-05-31 | 歌尔科技有限公司 | 360 degree of the characteristic vector pickup methods of panoramic pictures, recognition methods and related devices |
| CN106815598A (en) * | 2016-12-15 | 2017-06-09 | 歌尔科技有限公司 | A kind of recognition methods of 360 degree of panoramic pictures and device |
-
2017
- 2017-07-14 WO PCT/CN2017/093011 patent/WO2019010704A1/en not_active Ceased
- 2017-07-14 CN CN201780004656.2A patent/CN108475338B/en not_active Expired - Fee Related
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101394573A (en) * | 2008-10-30 | 2009-03-25 | 清华大学 | A method and system for generating panoramas based on feature matching |
| CN101894262A (en) * | 2009-05-20 | 2010-11-24 | 索尼株式会社 | Method and device for classifying images |
| US20120045095A1 (en) * | 2010-08-18 | 2012-02-23 | Canon Kabushiki Kaisha | Image processing apparatus, method thereof, program, and image capturing apparatus |
| CN102609713A (en) * | 2011-01-20 | 2012-07-25 | 索尼公司 | Method and equipment for classifying images |
| CN106815598A (en) * | 2016-12-15 | 2017-06-09 | 歌尔科技有限公司 | A kind of recognition methods of 360 degree of panoramic pictures and device |
| CN106778762A (en) * | 2016-12-31 | 2017-05-31 | 歌尔科技有限公司 | 360 degree of the characteristic vector pickup methods of panoramic pictures, recognition methods and related devices |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113711274A (en) * | 2019-04-15 | 2021-11-26 | 皮卡特有限责任公司 | Method for realizing augmented reality |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108475338A (en) | 2018-08-31 |
| CN108475338B (en) | 2020-04-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11263439B1 (en) | Systems and methods for passive-subject liveness verification in digital media | |
| CN109359575B (en) | Face detection method, service processing method, device, terminal and medium | |
| CN105635719B (en) | Method and apparatus for calibrating images | |
| US10573018B2 (en) | Three dimensional scene reconstruction based on contextual analysis | |
| US12125458B2 (en) | Display terminal adjustment method and display terminal | |
| US11373449B1 (en) | Systems and methods for passive-subject liveness verification in digital media | |
| CN106462956A (en) | Local Adaptive Histogram Equalization | |
| US10429271B2 (en) | Camera testing using reverse projection | |
| WO2018082185A1 (en) | Image processing method and device | |
| WO2017054442A1 (en) | Image information recognition processing method and device, and computer storage medium | |
| WO2017215527A1 (en) | Hdr scenario detection method, device, and computer storage medium | |
| JPWO2018147059A1 (en) | Image processing apparatus, image processing method, and program | |
| US10296806B2 (en) | Recognition-based color corrections | |
| US11315360B2 (en) | Live facial recognition system and method | |
| US12051226B2 (en) | Feature detection methods and systems using deconstructed color image data | |
| CN111210506A (en) | Three-dimensional reduction method, system, terminal equipment and storage medium | |
| EP2423850B1 (en) | Object recognition system and method | |
| US12035033B2 (en) | DNN assisted object detection and image optimization | |
| WO2019010704A1 (en) | Panoramic image and video recognition method, classifier establishment method and electronic apparatus | |
| CN115965848B (en) | Image processing method and related device | |
| CN111177449A (en) | Image-based multi-dimensional information integration method and related equipment | |
| CN104981841B (en) | The method and apparatus of 3D rendering data segmentation | |
| CN117522792B (en) | Color difference detection method and device, electronic device, and storage medium | |
| WO2013034878A2 (en) | Image processing | |
| CN104484641B (en) | A kind of system for recognizing color three dimension code |
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: 17917490 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: 17917490 Country of ref document: EP Kind code of ref document: A1 |