WO2018223318A1 - 360-degree panoramic image and video identification method and electronic device - Google Patents
360-degree panoramic image and video identification method and electronic device Download PDFInfo
- Publication number
- WO2018223318A1 WO2018223318A1 PCT/CN2017/087475 CN2017087475W WO2018223318A1 WO 2018223318 A1 WO2018223318 A1 WO 2018223318A1 CN 2017087475 W CN2017087475 W CN 2017087475W WO 2018223318 A1 WO2018223318 A1 WO 2018223318A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pixel
- pixels
- gray value
- column
- difference
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/30—Determination of transform parameters for the alignment of images, i.e. image registration
Definitions
- 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, and an electronic device applying the same.
- 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.
- 360-degree panoramic image or 360-degree panoramic video can be obtained through 360-degree panoramic photography technology.
- 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.
- the embodiment of the invention discloses a 360-degree panoramic image and a 360-degree panoramic video recognition method and an electronic device, which can accurately recognize a 360-degree panoramic image or a 360-degree panoramic video.
- the method for identifying a 360-degree panoramic image disclosed by the embodiment of the present invention includes: acquiring an image file to be identified; determining a target image frame according to the image file to be identified; and determining pixels of the first column of the target image frame Whether the degree of matching between the gray value of the point and the gray value of the pixel of the last column is greater than or equal to the first threshold, and determining the difference between the gray values of all the pixels of the first line of the target image frame and Whether the difference between the gray values of all the pixels of the last row is less than or equal to the second threshold; if yes, determining that the image file to be identified is a 360-degree panoramic image; otherwise, determining that the image file to be identified is not 360 degree panoramic image.
- the method for identifying a 360-degree panoramic video disclosed in the embodiment of the present invention includes: acquiring a video file to be identified; extracting a plurality of representative image frames from the video file to be identified; determining whether each representative image frame is a 360-degree panoramic image; whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than 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.
- the electronic device disclosed in the embodiment of the present invention includes a processor and a memory, wherein the memory stores a video file to be identified, the processor is configured to: acquire a video file to be identified; and extract a number of the video files to be identified Representing an image frame; determining whether each representative image frame is a 360-degree panoramic image; determining whether a proportion of the representative image frame of the 360-degree panoramic image is greater than a preset ratio; if yes, determining that the video file is a 360-degree panoramic video If not, it is determined that the video file is not a 360-degree panoramic video.
- the electronic device disclosed in the embodiment of the present invention includes a processor and a memory, wherein the memory stores an image file to be identified, the processor is configured to: acquire an image file to be identified; and determine a target image frame according to the image file to be identified; Determining whether a matching degree between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of the target image frame Whether the difference between the gray value of all the pixels of the row and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold; if yes, determining that the image file to be recognized is a 360-degree panoramic image, Otherwise, it is determined that the image file to be identified is not a 360-degree panoramic image.
- the 360-degree panoramic image and the 360-degree panoramic video identification method and the electronic device of the present invention determine the target image frame, and then analyze the gray-scale difference between the pixel of the first column of the target image frame and the pixel of the last column. And determining a grayscale difference between pixels of the first row of the target image frame and a grayscale difference between the pixels of the last row to determine whether the target image frame is a 360-degree panoramic image frame, and then determining the corresponding image Whether the video is a 360-degree panoramic image or a 360-degree panoramic video can effectively improve the recognition accuracy.
- FIG. 1 is a flowchart of a method for recognizing a 360-degree panoramic image according to an embodiment of the present invention.
- FIG. 2 is a schematic diagram of a target image frame in an embodiment of the present invention.
- FIG. 3 is a flowchart of a method for recognizing a 360-degree panoramic image according to another embodiment of the present invention.
- step S12 of FIG. 1 or step S102 of FIG. 3 in an embodiment of the present invention.
- FIG. 5 is a sub-flow diagram of step S104 of FIG. 3 in an embodiment of the present invention.
- FIG. 6 is a flowchart of a method for recognizing a 360-degree panoramic video according to an embodiment of the present invention.
- Figure 7 is a sub-flow diagram of an embodiment in step S503 of Figure 6.
- FIG. 8 is a structural block diagram of an electronic device according to an embodiment of the present invention.
- FIG. 1 is a flowchart of a method for recognizing a 360-degree panoramic image according to an embodiment of the present invention.
- 2 is a schematic diagram of a target image frame M1. The identification method includes the steps of:
- S12 Determine the target image frame M1 according to the image file to be identified.
- S13 determining whether the matching degree between the gray value of the pixel P1 of the first column L1 of the target image frame M1 and the gray value of the pixel of the last column Ln is greater than or equal to a first threshold, and determining the location Whether the difference between the gray value of all the pixel points P1 of the first line C1 of the target image frame M1 and the difference of the gray values of all the pixel points P1 of the last line C1 is less than or equal to the second threshold.
- step S14 is performed, and if not, the pixel of the first column L1
- the degree of matching between the gray value of the point P1 and the gray value of the pixel of the last column Ln is smaller than the first threshold, or The difference between the gray value of all the pixel points P1 of the first row C1 and the gray value of all the pixel points P1 of the last row C1 are greater than the second threshold, and then step S15 is performed.
- the present application it is determined by determining that the matching degree between the gradation value of the pixel point P1 of the first column L1 and the gradation value of the pixel point P1 of the last column L1 in the target image frame M1 is greater than the first threshold. Whether the gradation value of the pixel point P1 of the first column L1 of the target image frame is similar to the gradation value of the pixel point P1 of the last column Ln.
- FIG. 3 is a flowchart of a method for recognizing a 360-degree panoramic image according to another embodiment of the present invention.
- the method for identifying the 360-degree panoramic image is not limited to the following execution sequence.
- the identifying method comprises:
- S101 Acquire an image file to be identified.
- the target image frame M1 includes pixel points P1 arranged in a matrix.
- the target image frame M1 includes m*n pixel points P1, that is, m rows and n columns of pixel points P1, where m and n are positive integers greater than 1, and m and n may be equal or not equal.
- S104 Calculate a matching degree between the gradation value of the pixel point P1 of the first column L1 and the gradation value of the pixel point of the last column Ln.
- step S105 Determine whether the matching degree is greater than or equal to a first threshold. If yes, step S106 is performed, and if no, step S110 is performed.
- S106 Acquire gray values of all the pixel points P1 of the first row C1 of the target image frame M1 and gray values of all the pixel points P1 of the last row of Cm.
- the step S107 Calculate a difference between the gradation values of all the pixel points P1 of the first row C1 and the gradation values of all the pixel points P1 of the last row Cm.
- the step S107 Specifically, the method includes: calculating a variance of the gray values of all the pixel points P1 of the first row C1 to obtain a difference between the gray values of all the pixel points P1, and calculating a gray value of all the pixel points P1 of the last row Cm. The variance obtains the difference between the gray values of all the pixel points P1 of the last line Cm.
- step S108 Determine whether the difference between the gray value of all the pixel points P1 of the first row C1 and the difference of the gray values of all the pixel points P1 of the last row C1 are less than or equal to the second threshold. If yes, step S109 is performed, and if no, step S110 is performed.
- the second threshold may be a variance threshold of 20.
- S109 Determine that the image file to be identified is a 360-degree panoramic image.
- steps S103-S108 correspond to the step S13 in FIG. 1, and the more specific steps of step S13 are illustrated. It should be noted that when steps S103-S108 are taken as a more specific step flow of step S13, step S106 will be executed regardless of whether the determination result of S105 is YES or not.
- step S12 of FIG. 1 or step S102 of FIG. 3 in an embodiment of the present invention.
- the step S12 or the step S102 includes:
- step S1021 It is judged whether the image to be recognized is a three-dimensional image or a two-dimensional image (step S1021). If it is a three-dimensional image, step S1023 is performed, and if it is a two-dimensional image, step S1025 is performed.
- the left-eye image or the right-eye image in the image to be recognized is extracted, and it is determined that the extracted left-eye image or right-eye image is the target image frame M1 (S1023).
- the image to be recognized is the target image frame M1 (S1025).
- the present application determines whether the three-dimensional image is a three-dimensional image, and extracts a left-eye image or a right image when determining the three-dimensional image.
- the eye image is analyzed as a target image frame to improve the accuracy of the analysis result.
- step S104 includes:
- Step S1041 sequentially, each pixel point P1 of the first column L1 and/or the last column Ln is taken as a center point, and the pixel point P1 of the first column L1 and/or the last column Ln which is the current center point is obtained.
- Step S1043 Calculate an average value of the obtained grayscale values of the plurality of pixel points P1 including the pixel point P1 that is currently the center point, and use the average value as the pixel point P1 of the current center point.
- the gradation value is corrected, and the corrected gradation value of each pixel point P1 of the first column L1 and the last column Ln is obtained one by one.
- the gray value of the preset pixel point P1 adjacent to the pixel point P1 of the first column L1 that is currently the center point and the pixel point P1 of the current center point may be acquired first.
- the pixel value is then calculated as the corrected gray value of the pixel point P1 which is currently the center point, and the corrected gray value of all the pixel points P1 of the first column L1 is obtained, and then the pixel point of the last column Ln which is the current center point is obtained.
- the gray value of the preset pixel point P1 adjacent to the pixel point P1 of the first column L1 and the last column of the current column and the pixel point of the current center point may be simultaneously acquired. Pixel value of P1, and then simultaneously calculate the corrected gradation value of the pixel point P1 of the first column L1 and the last column of the current center point, and obtain each pixel point P1 of the first column L1 and the last column Ln Correct the gray value.
- Step S1045 respectively calculating a difference between the corrected gradation value of each pixel point P1 of the first column L1 and the corrected gradation value of the pixel point P1 of the row corresponding to the last column Ln to obtain a plurality of gradation value difference values.
- Step S1047 Calculate a proportion of the calculated gray value difference values that are less than or equal to the preset difference value among the calculated gray value difference values, and determine the ratio as the matching degree. For example, if the m is 1000, that is, the first column L1 and the last column Lm each include 1000 pixel points P1, 1000 gray value difference values will be calculated, assuming a gray value less than or equal to the preset difference value. The number of differences is 800, and the proportion is 0.8, which is 80%.
- step S105 in FIG. 1 determines whether the matching degree is greater than or equal to a first threshold value in a first threshold value, for example, 0.75, that is, 75. %.
- FIG. 6 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. 6, the method for identifying the 360-degree panoramic video includes the following steps:
- S501 Acquire a video file to be identified.
- S502 Extract a plurality of representative image frames from the video file to be identified.
- the representative image frame is selected based on at least one of the following selection principles: 1. Selecting a key frame in the video file as a representative image frame, and generally the key frame includes a complete frame image, other than Type frames have higher image quality. Key frames often include the start time of a camera lens. There is a big difference between adjacent key frames, which is beneficial to improve the diversity of recognition samples. 2. Select frames with rich picture changes. The image is used as a representative image frame; 3.
- a plurality of image frames whose time periods covered by the position of the time axis in the video file exceed a preset value are selected as a plurality of representative image frames, for example, the duration of the video file is 2 hours. Then, as many as possible, a plurality of image frames are intermittently selected as representative image frames from the beginning to the last time period, and the time span of the plurality of image frames may be 1 hour and 50 minutes or the like.
- step S504 Determine whether a proportion of the representative image frame of the 360-degree panoramic image is greater than a preset ratio. If yes, step S505 is performed, and if no, step S506 is performed.
- S505 Determine that the video file is a 360-degree panoramic video.
- S506 Determine that the video file is not a 360-degree panoramic video.
- step S503 includes:
- S531 Determine a target image frame corresponding to each representative image frame
- S532 Determine whether the matching degree between the gray value of the pixel of the first column of each target image frame and the gray value of the pixel of the last column is greater than or equal to a first threshold, and determine each target image frame. Whether the difference between the gray values of all the pixels of the first row and the gray value of all the pixels of the last row are less than or equal to the second threshold. If yes, go to step S533, if no, go to step S534.
- S533 Determine that the corresponding representative image frame is a 360-degree panoramic image.
- S534 Determine that the corresponding representative image frame is not a 360-degree panoramic image.
- each representative image frame is a 360-degree panoramic image.
- steps S531-S534 correspond to steps S12-S15 in FIG. 1, respectively.
- the more specific steps of steps S531-S534 are the same as steps S12-S15 in FIG. 1, that is, any one of the representative image frames is equivalent to one image file, and any method for identifying whether the image frame is a 360-degree panoramic image in FIG. versus The method for identifying whether the image file is a 360-degree panoramic image is the same in FIG. 1, and further includes the corresponding method steps in FIGS.
- step S531 includes determining whether the representative image frame is a three-dimensional image or a two-dimensional image.
- the step S532 may specifically include the steps S103-S108 shown in FIG. 3 or further include the steps S1041-S1047 shown in FIG. 5.
- FIG. 8 is a structural block diagram of an electronic device 100 according to an embodiment of the invention.
- the electronic device 100 includes a processor 10 and a memory 20 .
- the memory 20 stores image files and/or video files to be identified.
- the image files and/or video files stored in the memory 20 are pre-stored in the memory 20, and may also be temporarily downloaded from the server or received from other electronic devices 100.
- the electronic device 100 further includes a communication unit 30, which can establish a communication connection with a server or other electronic device through the communication unit 30 in advance, and receive an image to be recognized from a server or other electronic device.
- File and/or video files are stored in the memory 20.
- the communication unit 30 can be a wired or wireless communication module, and can be, for example, a wired network interface unit, a WIFI module, a Bluetooth module, or the like.
- the processor 10 is configured to analyze an image file and/or a video file to be identified stored in the memory 20 to identify whether it is a 360-degree panoramic image and/or a 360-degree panoramic video.
- the processor 10 is configured to perform any of the methods shown in FIG. 1 and FIG. 3-5 to identify whether the image file to be identified is a 360-degree panoramic image.
- the processor 10 is further configured to perform any of the method steps shown in FIG. 6-7 and the related method steps shown in FIG. 3-5 to identify whether the video file to be identified is a 360-degree panoramic video.
- the memory 20 stores a plurality of program instructions, and after the processor 10 calls the execution of the plurality of program instructions, performing any of the methods shown in FIG. 1 and FIG. 3-5 to identify the to-be-identified Whether the image file is a 360-degree panoramic image, and/or performing any of the method steps shown in FIG. 6-7 and the related method steps shown in FIG. 3-5 to identify whether the video file to be recognized is a 360-degree panoramic video. .
- the processor 10 performs the following method to identify whether the image file to be recognized is 360 degrees.
- Panoramic image acquiring an image file to be identified; determining a target image frame according to the image file to be identified; determining a match between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column Whether the degree is greater than or equal to a first threshold, and whether the difference between the gray values of all the pixels of the first line of the target image frame and the difference of the gray values of all the pixels of the last line are less than or equal to the second threshold If yes, it is determined that the image file to be identified is a 360-degree panoramic image; if not, it is determined that the image file to be recognized is not a 360-degree panoramic image.
- 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 a plurality of representative image frames from the video file to be identified; determining each representative Whether the image frame is a 360-degree panoramic image; whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than a preset ratio; if yes, determining that the video file is a 360-degree panoramic video, and if not, determining the video The file is not a 360 degree panoramic video.
- the processor 40 can be a microcontroller, a microprocessor, a single chip, a digital signal processor, or the like.
- the memory 20 can be any storage device that can store information such as a memory card, a solid state memory, a micro hard disk, an optical disk, or the like.
- the present invention further provides a computer readable storage medium having stored therein a plurality of program instructions, which are executed by the processor 10 for execution, and are executed in FIG. Any of the method steps 3-7, thereby identifying whether the image file is a 360-degree panoramic image and/or identifying whether the video file is a 360-degree panoramic video.
- the computer storage medium is the memory 20, and may be any storage device that can store information such as a memory card, a solid state memory, a micro hard disk, an optical disk, or the like.
- the electronic device 100 can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc., and can also be a head-mounted device such as a smart helmet or smart glasses.
- 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.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The present application discloses a 360-degree panoramic video identification method, comprising: acquiring a video file to be identified; extracting a plurality of representative image frames from the video file to be identified; determining whether each of the representative image frames is a 360-degree panoramic image; determining whether the proportion of representative image frames that are 360-degree panoramic images is greater than a preset proportion; and if so, determining that the video file is a 360-degree panoramic video, and if not, determining that the video file is not a 360-degree panoramic video. The present application further discloses a 360-degree panoramic image identification method and an electronic device. The electronic device and the 360-degree panoramic video and image identification method of the present application can more accurately and simply identify 360-degree panoramic videos or 360-degree panoramic images.
Description
本发明涉及一种视频图像识别方法,尤其涉及一种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, and an electronic device applying the same.
目前,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度全景视频。The embodiment of the invention discloses a 360-degree panoramic image and a 360-degree panoramic video recognition method and an electronic device, which can accurately recognize a 360-degree panoramic image or a 360-degree panoramic video.
本发明实施例公开的360度全景图像的识别方法,所述识别方法包括:获取待识别的图像文件;根据待识别的图像文件确定目标图像帧;判断所述目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断所述目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;如果是,确定所述待识别的图像文件为360度全景图像,否则,确定所述待识别的图像文件不为360度全景图像。The method for identifying a 360-degree panoramic image disclosed by the embodiment of the present invention includes: acquiring an image file to be identified; determining a target image frame according to the image file to be identified; and determining pixels of the first column of the target image frame Whether the degree of matching between the gray value of the point and the gray value of the pixel of the last column is greater than or equal to the first threshold, and determining the difference between the gray values of all the pixels of the first line of the target image frame and Whether the difference between the gray values of all the pixels of the last row is less than or equal to the second threshold; if yes, determining that the image file to be identified is a 360-degree panoramic image; otherwise, determining that the image file to be identified is not 360 degree panoramic image.
本发明实施例公开的360度全景视频的识别方法,所述识别方法包括:获取待识别的视频文件;从所述待识别的视频文件中提取若干代表图像帧;确定每一代表图像帧是否为360度全景图像;确定为360度全景图像的代表图像帧所占的比例是否大于预设比例;如果是,确定所述视频文件为360度全景视频,如果否,确定所述视频文件不为360度全景视频。
The method for identifying a 360-degree panoramic video disclosed in the embodiment of the present invention includes: acquiring a video file to be identified; extracting a plurality of representative image frames from the video file to be identified; determining whether each representative image frame is a 360-degree panoramic image; whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than 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.
本发明实施例公开的电子装置,包括处理器以及存储器,所述存储器中存储有待识别的视频文件,所述处理器用于:获取待识别的视频文件;从所述待识别的视频文件中提取若干代表图像帧;确定每一代表图像帧是否为360度全景图像;确定为360度全景图像的代表图像帧所占的比例是否大于预设比例;如果是,确定所述视频文件为360度全景视频,如果否,确定所述视频文件不为360度全景视频。The electronic device disclosed in the embodiment of the present invention includes a processor and a memory, wherein the memory stores a video file to be identified, the processor is configured to: acquire a video file to be identified; and extract a number of the video files to be identified Representing an image frame; determining whether each representative image frame is a 360-degree panoramic image; determining whether a proportion of the representative image frame of the 360-degree panoramic image is greater than a preset ratio; if yes, determining that the video file is a 360-degree panoramic video If not, it is determined that the video file is not a 360-degree panoramic video.
本发明实施例公开的电子装置,包括处理器以及存储器,所述存储器中存储有待识别的图像文件,所述处理器用于:获取待识别的图像文件;根据待识别的图像文件确定目标图像帧;判断所述目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断所述目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;如果是,确定所述待识别的图像文件为360度全景图像,否则,确定所述待识别的图像文件不为360度全景图像。The electronic device disclosed in the embodiment of the present invention includes a processor and a memory, wherein the memory stores an image file to be identified, the processor is configured to: acquire an image file to be identified; and determine a target image frame according to the image file to be identified; Determining whether a matching degree between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of the target image frame Whether the difference between the gray value of all the pixels of the row and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold; if yes, determining that the image file to be recognized is a 360-degree panoramic image, Otherwise, it is determined that the image file to be identified is not a 360-degree panoramic image.
本发明的360度全景图像及360度全景视频的识别方法及电子装置,通过确定目标图像帧,然后分析目标图像帧的第一列的像素点与最后一列的像素点之间的灰度差值以及分析目标图像帧的第一行的像素点之间的灰度差值以及最后一行的像素点之间的灰度差值来判断目标图像帧是否为360度全景图像帧,继而判断对应的图像或视频是否为360度全景图像或360度全景视频,可有效提高识别准确度。The 360-degree panoramic image and the 360-degree panoramic video identification method and the electronic device of the present invention determine the target image frame, and then analyze the gray-scale difference between the pixel of the first column of the target image frame and the pixel of the last column. And determining a grayscale difference between pixels of the first row of the target image frame and a grayscale difference between the pixels of the last row to determine whether the target image frame is a 360-degree panoramic image frame, and then determining the corresponding image Whether the video is a 360-degree panoramic image or a 360-degree panoramic video can effectively improve the 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为本发明一实施例中目标图像帧的示意图。2 is a schematic diagram of a target image frame in an embodiment of the present invention.
图3为本发明另一实施例中的360度全景图像的识别方法的流程图。FIG. 3 is a flowchart of a method for recognizing a 360-degree panoramic image according to another embodiment of the present invention.
图4为图1中步骤S12或图3中步骤S102在本发明一实施例中的子流程图。4 is a sub-flow diagram of step S12 of FIG. 1 or step S102 of FIG. 3 in an embodiment of the present invention.
图5为图3中步骤S104在本发明一实施例中的子流程图。FIG. 5 is a sub-flow diagram of step S104 of FIG. 3 in an embodiment of the present invention.
图6为本发明一实施例中的360度全景视频的识别方法的流程图。FIG. 6 is a flowchart of a method for recognizing a 360-degree panoramic video according to an embodiment of the present invention.
图7为图6中步骤S503在一实施例中的子流程图。Figure 7 is a sub-flow diagram of an embodiment in step S503 of Figure 6.
图8为本发明一实施例中的电子装置的结构框图。FIG. 8 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. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
请参阅图1及图2,图1为本发明一实施例中的360度全景图像的识别方法的流程图。图2为目标图像帧M1的示意图。所述识别方法包括步骤:Please refer to FIG. 1 and FIG. 2. FIG. 1 is a flowchart of a method for recognizing a 360-degree panoramic image according to an embodiment of the present invention. 2 is a schematic diagram of a target image frame M1. The identification method includes the steps of:
S11:获取待识别的图像文件。S11: Acquire an image file to be identified.
S12:根据待识别的图像文件确定目标图像帧M1。S12: Determine the target image frame M1 according to the image file to be identified.
S13:判断所述目标图像帧M1的第一列L1的像素点P1的灰度值与最后一列Ln的像素点的灰度值之间的匹配度是否大于或等于一第一阈值,以及判断所述目标图像帧M1的第一行C1的所有像素点P1的灰度值之差以及最后一行Cm的所有像素点P1的灰度值之差是否均小于或等于第二阈值。S13: determining whether the matching degree between the gray value of the pixel P1 of the first column L1 of the target image frame M1 and the gray value of the pixel of the last column Ln is greater than or equal to a first threshold, and determining the location Whether the difference between the gray value of all the pixel points P1 of the first line C1 of the target image frame M1 and the difference of the gray values of all the pixel points P1 of the last line C1 is less than or equal to the second threshold.
如果是,即第一列L1的像素点P1的灰度值与最后一列Ln的像素点的灰度值之间的匹配度大于或等于所述第一阈值且所述第一行C1的所有像素点P1的灰度值之差以及所述最后一行Cm的所有像素点P1的灰度值之差均小于或等于所述第二阈值,则执行步骤S14,如果否,即第一列L1的像素点P1的灰度值与最后一列Ln的像素点的灰度值之间的匹配度小于所述第一阈值,或者
所述第一行C1的所有像素点P1的灰度值之差以及所述最后一行Cm的所有像素点P1的灰度值之差均大于第二阈值,则执行步骤S15。If yes, that is, the matching degree between the gray value of the pixel point P1 of the first column L1 and the gray value of the pixel point of the last column Ln is greater than or equal to the first threshold and all pixels of the first row C1 The difference between the gray value of the point P1 and the difference between the gray values of all the pixel points P1 of the last line Cm are less than or equal to the second threshold, then step S14 is performed, and if not, the pixel of the first column L1 The degree of matching between the gray value of the point P1 and the gray value of the pixel of the last column Ln is smaller than the first threshold, or
The difference between the gray value of all the pixel points P1 of the first row C1 and the gray value of all the pixel points P1 of the last row C1 are greater than the second threshold, and then step S15 is performed.
S14:确定所述待识别的图像文件为360度全景图像。S14: Determine that the image file to be identified is a 360-degree panoramic image.
S15:确定所述待识别的图像文件不为360度全景图像。S15: It is determined that the image file to be identified is not a 360-degree panoramic image.
从而,本申请中,通过判断目标图像帧M1中的第一列L1的像素点P1的灰度值以及最后一列Ln的像素点P1的灰度值之间的匹配度大于第一阈值,来确定目标图像帧第一列L1的像素点P1的灰度值是否与最后一列Ln的像素点P1的灰度值相近似。以及判断目标图像帧M1中第一行C1的像素点P1的灰度值之差以及最后一行Cm的像素点P1的灰度值之差是否在第二阈值内,来确定目标图像帧M1第一行C1的像素点P1的灰度值是否相近似,以及最后一行Cm的像素点P1的灰度值是否相近似,可准确地确定目标图像帧M1是否为360度全景图像继而确定待识别的图像文件是否为360度全景图像。Therefore, in the present application, it is determined by determining that the matching degree between the gradation value of the pixel point P1 of the first column L1 and the gradation value of the pixel point P1 of the last column L1 in the target image frame M1 is greater than the first threshold. Whether the gradation value of the pixel point P1 of the first column L1 of the target image frame is similar to the gradation value of the pixel point P1 of the last column Ln. And determining whether the difference between the gray value of the pixel point P1 of the first line C1 in the target image frame M1 and the difference between the gray values of the pixel point P1 of the last line C1 is within the second threshold to determine the target image frame M1 first Whether the gray value of the pixel point P1 of the line C1 is similar, and whether the gray value of the pixel point P1 of the last line Cm is similar, it is possible to accurately determine whether the target image frame M1 is a 360-degree panoramic image and then determine the image to be recognized. Whether the file is a 360-degree panoramic image.
请参阅图3,图3为本发明另一实施例中的360度全景图像的识别方法的流程图。其中,所述360度全景图像的识别方法并不限于如下的执行顺序。在另一实施例中,所述识别方法包括:Please refer to FIG. 3. FIG. 3 is a flowchart of a method for recognizing a 360-degree panoramic image according to another embodiment of the present invention. The method for identifying the 360-degree panoramic image is not limited to the following execution sequence. In another embodiment, the identifying method comprises:
S101:获取待识别的图像文件。S101: Acquire an image file to be identified.
S102:根据待识别的图像文件确定目标图像帧M1。S102: Determine a target image frame M1 according to the image file to be identified.
S103:获取所述目标图像帧M1的第一列L1的像素点P1的灰度值以及最后一列的像素点的灰度值。其中,所述目标图像帧M1包括矩阵式排列的像素点P1。例如,如图2所示,所述目标图像帧M1包括m*n个像素点P1,即m行n列的像素点P1,其中m、n为大于1的正整数,m和n可相等或不相等。S103: Acquire a gray value of the pixel point P1 of the first column L1 of the target image frame M1 and a gray value of the pixel point of the last column. The target image frame M1 includes pixel points P1 arranged in a matrix. For example, as shown in FIG. 2, the target image frame M1 includes m*n pixel points P1, that is, m rows and n columns of pixel points P1, where m and n are positive integers greater than 1, and m and n may be equal or not equal.
S104:计算第一列L1的像素点P1的灰度值与最后一列Ln的像素点的灰度值之间的匹配度。S104: Calculate a matching degree between the gradation value of the pixel point P1 of the first column L1 and the gradation value of the pixel point of the last column Ln.
S105:判断所述匹配度是否大于或等于一第一阈值。如果是,则执行步骤S106,如果否,则执行步骤S110。S105: Determine whether the matching degree is greater than or equal to a first threshold. If yes, step S106 is performed, and if no, step S110 is performed.
S106:获取所述目标图像帧M1的第一行C1的所有像素点P1的灰度值以及最后一行Cm的所有像素点P1的灰度值。S106: Acquire gray values of all the pixel points P1 of the first row C1 of the target image frame M1 and gray values of all the pixel points P1 of the last row of Cm.
S107:计算所述第一行C1的所有像素点P1的灰度值之差以及所述最后一行Cm的所有像素点P1的灰度值之差。在一些实施例中,所述步骤S107
具体包括:计算所述第一行C1的所有像素点P1的灰度值的方差得到所有像素点P1的灰度值之差,以及计算所述最后一行Cm的所有像素点P1的灰度值的方差得到所述最后一行Cm的所有像素点P1的灰度值之差。S107: Calculate a difference between the gradation values of all the pixel points P1 of the first row C1 and the gradation values of all the pixel points P1 of the last row Cm. In some embodiments, the step S107
Specifically, the method includes: calculating a variance of the gray values of all the pixel points P1 of the first row C1 to obtain a difference between the gray values of all the pixel points P1, and calculating a gray value of all the pixel points P1 of the last row Cm. The variance obtains the difference between the gray values of all the pixel points P1 of the last line Cm.
S108:判断所述第一行C1的所有像素点P1的灰度值之差以及所述最后一行Cm的所有像素点P1的灰度值之差是否均小于或等于第二阈值。如果是,则执行步骤S109,如果否,则执行步骤S110。其中,所述第二阈值可为方差阈值20。S108: Determine whether the difference between the gray value of all the pixel points P1 of the first row C1 and the difference of the gray values of all the pixel points P1 of the last row C1 are less than or equal to the second threshold. If yes, step S109 is performed, and if no, step S110 is performed. The second threshold may be a variance threshold of 20.
S109:确定所述待识别的图像文件为360度全景图像。S109: Determine that the image file to be identified is a 360-degree panoramic image.
S110:确定所述待识别的图像文件不为360度全景图像。S110: Determine that the image file to be identified is not a 360-degree panoramic image.
其中,所述步骤S103-S108对应为图1中的步骤S13,示意出了步骤S13更具体的步骤。需要注意的是,当步骤S103-S108作为步骤S13更具体的步骤流程时,不论S105的判断结果为是还是否,都将执行步骤S106。The steps S103-S108 correspond to the step S13 in FIG. 1, and the more specific steps of step S13 are illustrated. It should be noted that when steps S103-S108 are taken as a more specific step flow of step S13, step S106 will be executed regardless of whether the determination result of S105 is YES or not.
请一并参阅图4,为图1中步骤S12或图3中步骤S102在本发明一实施例中的子流程图。在一实施例中,所述步骤S12或步骤S102包括:Referring to FIG. 4, it is a sub-flowchart of step S12 of FIG. 1 or step S102 of FIG. 3 in an embodiment of the present invention. In an embodiment, the step S12 or the step S102 includes:
判断所述待识别的图像为三维图像还是二维图像(步骤S1021)。如果为三维图像,则执行步骤S1023,如果为二维图像,则执行步骤S1025。It is judged whether the image to be recognized is a three-dimensional image or a two-dimensional image (step S1021). If it is a three-dimensional image, step S1023 is performed, and if it is a two-dimensional image, step S1025 is performed.
如果为三维图像,提取所述待识别的图像中的左眼图像或右眼图像,确定所述提取出来的左眼图像或右眼图像为目标图像帧M1(S1023)。If it is a three-dimensional image, the left-eye image or the right-eye image in the image to be recognized is extracted, and it is determined that the extracted left-eye image or right-eye image is the target image frame M1 (S1023).
如果为二维图像,确定所述待识别的图像为所述目标图像帧M1(S1025)。If it is a two-dimensional image, it is determined that the image to be recognized is the target image frame M1 (S1025).
由于三维图像包括左眼图像和右眼图像,直接对三维图像进行分析会造成结果的不准确,本申请通过预先判断是否为三维图像,在判断为三维图像时,从中提取出左眼图像或右眼图像作为目标图像帧进行分析,可提高分析结果的准确性。Since the three-dimensional image includes the left-eye image and the right-eye image, directly analyzing the three-dimensional image may result in inaccurate results. The present application determines whether the three-dimensional image is a three-dimensional image, and extracts a left-eye image or a right image when determining the three-dimensional image. The eye image is analyzed as a target image frame to improve the accuracy of the analysis result.
请一并参阅图5,为步骤S104在本发明一实施例中的子流程图。在一实施例中,所述步骤S104包括:Referring to FIG. 5 together, it is a sub-flowchart of step S104 in an embodiment of the present invention. In an embodiment, the step S104 includes:
步骤S1041:依次以第一列L1和/或最后一列Ln的每一个像素点P1为中心点,获取所述第一列L1和/或最后一列Ln的当前为中心点的像素点P1上下相邻的预设个像素点P1的灰度值以及所述当前为中心点的像素点P1的像素值。
Step S1041: sequentially, each pixel point P1 of the first column L1 and/or the last column Ln is taken as a center point, and the pixel point P1 of the first column L1 and/or the last column Ln which is the current center point is obtained. The gray value of the preset pixel point P1 and the pixel value of the pixel point P1 that is currently the center point.
步骤S1043:计算所述获取到的包括当前为中心点的像素点P1在内的若干像素点P1的灰度值的平均值,将所述平均值作为所述当前为中心点的像素点P1的校正灰度值,以此一一得出所述第一列L1和最后一列Ln的每一个像素点P1的校正灰度值。Step S1043: Calculate an average value of the obtained grayscale values of the plurality of pixel points P1 including the pixel point P1 that is currently the center point, and use the average value as the pixel point P1 of the current center point. The gradation value is corrected, and the corrected gradation value of each pixel point P1 of the first column L1 and the last column Ln is obtained one by one.
其中,在一些实施例中,可以先获取第一列L1的当前为中心点的像素点P1上下相邻的预设个像素点P1的灰度值以及所述当前为中心点的像素点P1的像素值,然后计算当前为中心点的像素点P1的校正灰度值,得出第一列L1的所有像素点P1的校正灰度值,然后再获取最后一列Ln的当前为中心点的像素点P1上下相邻的预设个像素点P1的灰度值以及所述当前为中心点的像素点P1的像素值,然后计算当前为中心点的像素点P1的校正灰度值,得出最后一列Ln的所有像素点P1的校正灰度值,而得出所述第一列L1和最后一列Ln的每一个像素点P1的校正灰度值。In some embodiments, the gray value of the preset pixel point P1 adjacent to the pixel point P1 of the first column L1 that is currently the center point and the pixel point P1 of the current center point may be acquired first. The pixel value is then calculated as the corrected gray value of the pixel point P1 which is currently the center point, and the corrected gray value of all the pixel points P1 of the first column L1 is obtained, and then the pixel point of the last column Ln which is the current center point is obtained. P1 the gray value of the preset pixel point P1 adjacent to the upper and lower sides and the pixel value of the pixel point P1 currently being the center point, and then calculating the corrected gray value of the pixel point P1 currently being the center point, and obtaining the last column The corrected gradation value of all the pixel points P1 of Ln is obtained, and the corrected gradation value of each pixel point P1 of the first column L1 and the last column Ln is obtained.
在另一些实施例中,可以同时获取第一列L1及最后一列的当前为中心点的像素点P1上下相邻的预设个像素点P1的灰度值以及所述当前为中心点的像素点P1的像素值,然后同时计算第一列L1及最后一列的当前为中心点的像素点P1的校正灰度值,而得出所述第一列L1和最后一列Ln的每一个像素点P1的校正灰度值。In other embodiments, the gray value of the preset pixel point P1 adjacent to the pixel point P1 of the first column L1 and the last column of the current column and the pixel point of the current center point may be simultaneously acquired. Pixel value of P1, and then simultaneously calculate the corrected gradation value of the pixel point P1 of the first column L1 and the last column of the current center point, and obtain each pixel point P1 of the first column L1 and the last column Ln Correct the gray value.
步骤S1045:分别计算第一列L1的每一个像素点P1的校正灰度值与最后一列Ln对应行的像素点P1的校正灰度值的差值而得出若干个灰度值差值。Step S1045: respectively calculating a difference between the corrected gradation value of each pixel point P1 of the first column L1 and the corrected gradation value of the pixel point P1 of the row corresponding to the last column Ln to obtain a plurality of gradation value difference values.
步骤S1047:计算所述计算出的若干个灰度值差值中小于或等于预设差值的灰度值差值所占的比例,将所述比例确定为所述匹配度。例如,设所述m为1000,即第一列L1及最后一列Lm均包括1000个像素点P1,则将计算出1000个灰度值差值,假设小于或等于预设差值的灰度值差值的个数为800,则所占的比例为0.8,即80%。Step S1047: Calculate a proportion of the calculated gray value difference values that are less than or equal to the preset difference value among the calculated gray value difference values, and determine the ratio as the matching degree. For example, if the m is 1000, that is, the first column L1 and the last column Lm each include 1000 pixel points P1, 1000 gray value difference values will be calculated, assuming a gray value less than or equal to the preset difference value. The number of differences is 800, and the proportion is 0.8, which is 80%.
与所述图5相对应,在一些实施例中,图1中所述步骤S105确定所述匹配度是否大于或等于一第一阈值中的第一阈值为一比例值,例如为0.75,即75%。Corresponding to FIG. 5, in some embodiments, step S105 in FIG. 1 determines whether the matching degree is greater than or equal to a first threshold value in a first threshold value, for example, 0.75, that is, 75. %.
请参阅图6,为本发明一实施例中的360度全景视频的识别方法的流程图。如图6所示,所述360度全景视频的识别方法包括步骤:
Please refer to FIG. 6 , 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. 6, the method for identifying the 360-degree panoramic video includes the following steps:
S501:获取待识别的视频文件。S501: Acquire a video file to be identified.
S502:从所述待识别的视频文件中提取若干代表图像帧。在一些实施例中,所述代表图像帧至少基于以下选取原则中的至少一种进行选取:1、选取视频文件中的关键帧作为代表图像帧,一般关键帧包含一个完整的帧画面,比其他类型帧具有更高的图像质量,关键帧往往包括一个摄像镜头的开始时段,相邻的关键帧之间有较大的差异,有利于提高识别样本的多样性;2、选取画面变化丰富的帧图像作为代表图像帧;3、选取多个位于视频文件中的时间轴的位置覆盖的时间段超过预设值的多个图像帧作为多个代表图像帧,例如,设视频文件时长为2小时,则尽可能从开始到最后的时间段内间隔性地选择多个图像帧作为代表图像帧,所述多个图像帧的时间跨度可以为1小时50分钟等。S502: Extract a plurality of representative image frames from the video file to be identified. In some embodiments, the representative image frame is selected based on at least one of the following selection principles: 1. Selecting a key frame in the video file as a representative image frame, and generally the key frame includes a complete frame image, other than Type frames have higher image quality. Key frames often include the start time of a camera lens. There is a big difference between adjacent key frames, which is beneficial to improve the diversity of recognition samples. 2. Select frames with rich picture changes. The image is used as a representative image frame; 3. a plurality of image frames whose time periods covered by the position of the time axis in the video file exceed a preset value are selected as a plurality of representative image frames, for example, the duration of the video file is 2 hours. Then, as many as possible, a plurality of image frames are intermittently selected as representative image frames from the beginning to the last time period, and the time span of the plurality of image frames may be 1 hour and 50 minutes or the like.
S503:确定每一代表图像帧是否为360度全景图像。S503: Determine whether each representative image frame is a 360-degree panoramic image.
S504:确定为360度全景图像的代表图像帧所占的比例是否大于预设比例。如果是,则执行步骤S505,如果否,则执行步骤S506。S504: Determine whether a proportion of the representative image frame of the 360-degree panoramic image is greater than a preset ratio. If yes, step S505 is performed, and if no, step S506 is performed.
S505:确定所述视频文件为360度全景视频。S505: Determine that the video file is a 360-degree panoramic video.
S506:确定所述视频文件不为360度全景视频。S506: Determine that the video file is not a 360-degree panoramic video.
请参阅图7,为步骤S503在一实施例中的子流程图。在一些实施例中,所述步骤S503包括:Please refer to FIG. 7, which is a sub-flowchart in step S503 in an embodiment. In some embodiments, the step S503 includes:
S531:确定每一代表图像帧对应的目标图像帧;S531: Determine a target image frame corresponding to each representative image frame;
S532:判断每一目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于一第一阈值,以及判断每一目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值。如果是,执行步骤S533,如果否,执行步骤S534。S532: Determine whether the matching degree between the gray value of the pixel of the first column of each target image frame and the gray value of the pixel of the last column is greater than or equal to a first threshold, and determine each target image frame. Whether the difference between the gray values of all the pixels of the first row and the gray value of all the pixels of the last row are less than or equal to the second threshold. If yes, go to step S533, if no, go to step S534.
S533:确定对应的代表图像帧为360度全景图像。S533: Determine that the corresponding representative image frame is a 360-degree panoramic image.
S534:确定所述对应的代表图像帧不为360度全景图像。S534: Determine that the corresponding representative image frame is not a 360-degree panoramic image.
从而,一一确定每一代表图像帧是否为360度全景图像。Thereby, it is determined one by one whether each representative image frame is a 360-degree panoramic image.
其中,所述步骤S531-S534分别对应图1中的步骤S12-S15。步骤S531-S534的更具体的步骤与图1中的步骤S12-S15相同,即,任一个代表图像帧相当于一个图像文件,图7中识别任一个代表图像帧是否为360度全景图像的方法与
图1中识别所述图像文件是否为360度全景图像的方法相同,同时也进一步包括图3-图5中的相应方法步骤。例如,步骤S531包括:判断所述代表图像帧为三维图像还是二维图像。如果为三维图像,提取所述代表图像帧中的左眼图像或右眼图像,确定所述提取出来的左眼图像或右眼图像为目标图像帧;如果所述代表图像帧为二维图像,确定所述代表图像帧为所述目标图像帧。The steps S531-S534 correspond to steps S12-S15 in FIG. 1, respectively. The more specific steps of steps S531-S534 are the same as steps S12-S15 in FIG. 1, that is, any one of the representative image frames is equivalent to one image file, and any method for identifying whether the image frame is a 360-degree panoramic image in FIG. versus
The method for identifying whether the image file is a 360-degree panoramic image is the same in FIG. 1, and further includes the corresponding method steps in FIGS. For example, step S531 includes determining whether the representative image frame is a three-dimensional image or a two-dimensional image. If it is a three-dimensional image, extracting a left eye image or a right eye image in the representative image frame, determining that the extracted left eye image or right eye image is a target image frame; if the representative image frame is a two-dimensional image, Determining that the representative image frame is the target image frame.
相应的,所述步骤S532可具体包括图3所示的步骤S103-S108,或者进一步包括图5中所示的步骤S1041-S1047。Correspondingly, the step S532 may specifically include the steps S103-S108 shown in FIG. 3 or further include the steps S1041-S1047 shown in FIG. 5.
请参阅图8,为本发明一实施例中的电子装置100的结构框图。如图1所示,所述电子装置100包括处理器10及存储器20。Please refer to FIG. 8 , which is a structural block diagram of an electronic device 100 according to an embodiment of the invention. As shown in FIG. 1 , the electronic device 100 includes a processor 10 and a memory 20 .
所述存储器20存储有待识别的图像文件和/或视频文件。其中,所述存储器20中存储的图像文件和/或视频文件为预先存储于存储器20中的,也可为临时从服务器下载或者从其他电子装置100接收的。The memory 20 stores image files and/or video files to be identified. The image files and/or video files stored in the memory 20 are pre-stored in the memory 20, and may also be temporarily downloaded from the server or received from other electronic devices 100.
在一些实施例中,所述电子装置100还包括通信单元30,所述处理器10可预先通过通信单元30与服务器或其他电子装置建立通信连接,而从服务器或其他电子装置接收待识别的图像文件和/或视频文件,并存储于所述存储器20中。所述通信单元30可为有线或无线通信模块,例如可为有线网络接口单元、WIFI模组、蓝牙模组等。In some embodiments, the electronic device 100 further includes a communication unit 30, which can establish a communication connection with a server or other electronic device through the communication unit 30 in advance, and receive an image to be recognized from a server or other electronic device. File and/or video files are stored in the memory 20. The communication unit 30 can be a wired or wireless communication module, and can be, for example, a wired network interface unit, a WIFI module, a Bluetooth module, or the like.
所述处理器10用于对所述存储器20存储的待识别的图像文件和/或视频文件进行分析,识别是否为360度全景图像和/或360度全景视频。The processor 10 is configured to analyze an image file and/or a video file to be identified stored in the memory 20 to identify whether it is a 360-degree panoramic image and/or a 360-degree panoramic video.
其中,所述处理器10用于执行如图1及图3-5所示的任一方法来识别待识别的图像文件是否为360度全景图像。The processor 10 is configured to perform any of the methods shown in FIG. 1 and FIG. 3-5 to identify whether the image file to be identified is a 360-degree panoramic image.
所述处理器10并用于执行如图6-7所示的任一方法步骤及图3-5所示的相关方法步骤来识别待识别的视频文件是否为360度全景视频。The processor 10 is further configured to perform any of the method steps shown in FIG. 6-7 and the related method steps shown in FIG. 3-5 to identify whether the video file to be identified is a 360-degree panoramic video.
在一些实施例中,所述存储器20中存储有若干程序指令,所述处理器10调用执行所述若干程序指令后,执行如图1及图3-5所示的任一方法来识别待识别的图像文件是否为360度全景图像,和/或执行如图6-7所示的任一方法步骤及图3-5所示的相关方法步骤来识别待识别的视频文件是否为360度全景视频。In some embodiments, the memory 20 stores a plurality of program instructions, and after the processor 10 calls the execution of the plurality of program instructions, performing any of the methods shown in FIG. 1 and FIG. 3-5 to identify the to-be-identified Whether the image file is a 360-degree panoramic image, and/or performing any of the method steps shown in FIG. 6-7 and the related method steps shown in FIG. 3-5 to identify whether the video file to be recognized is a 360-degree panoramic video. .
例如,所述处理器10执行如下方法识别待识别的图像文件是否为360度
全景图像:获取待识别的图像文件;根据待识别的图像文件确定目标图像帧;判断目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于一第一阈值,以及判断目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;如果是,确定所述待识别的图像文件为360度全景图像;如果否,确定所述待识别的图像文件不为360度全景图像。For example, the processor 10 performs the following method to identify whether the image file to be recognized is 360 degrees.
Panoramic image: acquiring an image file to be identified; determining a target image frame according to the image file to be identified; determining a match between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column Whether the degree is greater than or equal to a first threshold, and whether the difference between the gray values of all the pixels of the first line of the target image frame and the difference of the gray values of all the pixels of the last line are less than or equal to the second threshold If yes, it is determined that the image file to be identified is a 360-degree panoramic image; if not, it is determined that the image file to be recognized is not a 360-degree panoramic image.
又例如,所述处理器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 a plurality of representative image frames from the video file to be identified; determining each representative Whether the image frame is a 360-degree panoramic image; whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than a preset ratio; if yes, determining that the video file is a 360-degree panoramic video, and if not, determining the video The file is not a 360 degree panoramic video.
其中,所述处理器40可为微控制器、微处理器、单片机、数字信号处理器等。The processor 40 can be a microcontroller, a microprocessor, a single chip, a digital signal processor, or the like.
所述存储器20可为存储卡、固态存储器、微硬盘、光盘等任意可存储信息的存储设备。The memory 20 can be any storage device that can store information such as a memory card, a solid state memory, a micro hard disk, an optical disk, or the like.
在一些实施例中,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有若干程序指令,所述若干程序指令供处理器10调用执行后,执行图1、图3-7的任一方法步骤,从而识别图像文件是否为360度全景图像和/或识别视频文件是否为360度全景视频。在一些实施例中,所述计算机存储介质即为所述存储器20,可为存储卡、固态存储器、微硬盘、光盘等任意可存储信息的存储设备。In some embodiments, the present invention further provides a computer readable storage medium having stored therein a plurality of program instructions, which are executed by the processor 10 for execution, and are executed in FIG. Any of the method steps 3-7, thereby identifying whether the image file is a 360-degree panoramic image and/or identifying whether the video file is a 360-degree panoramic video. In some embodiments, the computer storage medium is the memory 20, and may be any storage device that can store information such as a memory card, a solid state memory, a micro hard disk, an optical disk, or the like.
所述电子装置100可为手机、平板电脑、笔记本电脑、桌面型电脑等,也可为智能头盔,智能眼镜等头戴式设备。The electronic device 100 can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc., and can also be a head-mounted device such as a smart helmet or smart glasses.
从而,通过本发明的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. It is the scope of protection of the present invention.
Claims (20)
- 一种360度全景图像的识别方法,其特征在于,所述识别方法包括:A method for recognizing a 360-degree panoramic image, characterized in that the identification method comprises:获取待识别的图像文件;Obtaining an image file to be identified;根据待识别的图像文件确定目标图像帧;Determining a target image frame according to the image file to be identified;判断所述目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断所述目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;Determining whether a matching degree between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of the target image frame Whether the difference between the gray values of all the pixels of the row and the gray value of all the pixels of the last row are less than or equal to the second threshold;如果是,确定所述待识别的图像文件为360度全景图像,否则,确定所述待识别的图像文件不为360度全景图像。If yes, it is determined that the image file to be identified is a 360-degree panoramic image; otherwise, it is determined that the image file to be recognized is not a 360-degree panoramic image.
- 如权利要求1所述的识别方法,其特征在于,所述步骤“判断所述目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断所述目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值”包括:The identification method according to claim 1, wherein said step "determining a matching degree between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column Whether it is greater than or equal to the first threshold, and determining whether the difference between the gray values of all the pixels of the first row of the target image frame and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold "include:获取所述目标图像帧的第一列的像素点的灰度值以及最后一列的像素点的灰度值;Obtaining a gray value of a pixel of the first column of the target image frame and a gray value of the pixel of the last column;计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度;Calculating a matching degree between a gray value of a pixel of the first column and a gray value of a pixel of the last column;判断所述匹配度是否大于或等于第一阈值;Determining whether the matching degree is greater than or equal to a first threshold;获取所述目标图像帧的第一行的所有像素点的灰度值以及最后一行的所有像素点的灰度值;Obtaining a gray value of all pixels of the first row of the target image frame and a gray value of all pixels of the last row;计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差;Calculating a difference between gray values of all pixels of the first row and a difference between gray values of all pixels of the last row;判断所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值。Determining whether the difference between the gray values of all the pixels of the first row and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold.
- 如权利要求1所述的识别方法,其特征在于,所述步骤“根据待识别的图像文件确定目标图像帧”包括: The identification method according to claim 1, wherein the step of "determining a target image frame according to the image file to be recognized" comprises:判断所述待识别的图像为三维图像还是二维图像;Determining whether the image to be identified is a three-dimensional image or a two-dimensional image;如果为三维图像,提取所述待识别的图像中的左眼图像或右眼图像,确定所述提取出来的左眼图像或右眼图像为目标图像帧;If it is a three-dimensional image, extracting a left-eye image or a right-eye image in the image to be identified, and determining that the extracted left-eye image or right-eye image is a target image frame;如果为二维图像,确定所述待识别的图像为所述目标图像帧。If it is a two-dimensional image, it is determined that the image to be recognized is the target image frame.
- 如权利要求2所述的识别方法,其特征在于,所述步骤“计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度”包括:The identification method according to claim 2, wherein the step of "calculating the matching degree between the gray value of the pixel of the first column and the gray value of the pixel of the last column" includes:依次以第一列和/或最后一列的每一个像素点为中心点,获取所述第一列和/或最后一列的当前为中心点的像素点上下相邻的预设个像素点的灰度值以及所述当前为中心点的像素点的像素值;Obtaining, according to each pixel point of the first column and/or the last column, the gray level of the preset pixel points adjacent to the pixel point of the current column of the first column and/or the last column a value and a pixel value of the pixel point currently being the center point;计算所述获取到的包括当前为中心点的像素点在内的若干像素点的灰度值的平均值,将所述平均值作为所述当前为中心点的像素点的校正灰度值,以此一一得出所述第一列和最后一列的每一个像素点的校正灰度值;Calculating an average value of the obtained grayscale values of the plurality of pixel points including the pixel point currently being the center point, and using the average value as the corrected gray value of the pixel point currently being the center point, This one obtains the corrected gray value of each pixel of the first column and the last column;分别计算第一列的每一个像素点的校正灰度值与最后一列对应行的像素点的校正灰度值的差值而得出若干个灰度值差值;以及Calculating a difference between the corrected gray value of each pixel of the first column and the corrected gray value of the pixel of the corresponding row of the last column to obtain a plurality of gray value difference values;计算所述若干个灰度值差值中小于或等于预设差值的灰度值差值所占的比例,将所述比例确定为所述匹配度。Calculating a proportion of the gray value difference values of the plurality of gray value difference values that are less than or equal to the preset difference value, and determining the ratio as the matching degree.
- 如权利要求2所述的识别方法,其特征在于,所述步骤“计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差”包括:The identification method according to claim 2, wherein said step "calculating a difference between gray values of all the pixels of said first line and a difference of gray values of all pixels of said last line" include:计算所述第一行的所有像素点的灰度值的方差得到所有像素点的灰度值之差,以及计算所述最后一行的所有像素点的灰度值的方差得到所述最后一行的所有像素点的灰度值之差。Calculating a variance of gray values of all the pixels of the first row to obtain a difference of gray values of all the pixels, and calculating a variance of gray values of all the pixels of the last row to obtain all of the last row The difference between the gray values of the pixels.
- 一种360度全景视频的识别方法,其特征在于,所述识别方法包括:A method for recognizing a 360-degree panoramic video, characterized in that the identification method comprises:获取待识别的视频文件;Obtain a video file to be identified;从所述待识别的视频文件中提取若干代表图像帧;Extracting a plurality of representative image frames from the video file to be identified;确定每一代表图像帧是否为360度全景图像;Determining whether each representative image frame is a 360-degree panoramic image;确定为360度全景图像的代表图像帧所占的比例是否大于预设比例;Whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than a preset ratio;如果是,确定所述视频文件为360度全景视频,如果否,确定所述视频文件不为360度全景视频。 If so, it is determined that the video file is a 360-degree panoramic video, and if not, it is determined that the video file is not a 360-degree panoramic video.
- 如权利要求6所述的识别方法,其特征在于,所述步骤“确定每一代表图像帧是否为360度全景图像”包括:The identification method according to claim 6, wherein said step of "determining whether each representative image frame is a 360-degree panoramic image" comprises:确定每一代表图像帧对应的目标图像帧;Determining a target image frame corresponding to each representative image frame;判断每一目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断每一目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;Determining whether a matching degree between a gray value of a pixel of the first column of each target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of each target image frame Whether the difference between the gray values of all the pixels of the row and the gray value of all the pixels of the last row are less than or equal to the second threshold;如果是,确定对应的代表图像帧为360度全景图像,否则,确定对应的代表图像帧不为360度全景图像。If yes, it is determined that the corresponding representative image frame is a 360-degree panoramic image; otherwise, it is determined that the corresponding representative image frame is not a 360-degree panoramic image.
- 如权利要求7所述的识别方法,其特征在于,所述步骤“判断每一目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断每一目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值”包括:The identification method according to claim 7, wherein said step "determining the degree of matching between the gray value of the pixel of the first column of each target image frame and the gray value of the pixel of the last column Whether it is greater than or equal to the first threshold, and whether the difference between the gray value of all the pixels of the first row of each target image frame and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold "include:获取所述目标图像帧的第一列的像素点的灰度值以及最后一列的像素点的灰度值;Obtaining a gray value of a pixel of the first column of the target image frame and a gray value of the pixel of the last column;计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度;Calculating a matching degree between a gray value of a pixel of the first column and a gray value of a pixel of the last column;判断所述匹配度是否大于或等于第一阈值;Determining whether the matching degree is greater than or equal to a first threshold;获取所述目标图像帧的第一行的所有像素点的灰度值以及最后一行的所有像素点的灰度值;Obtaining a gray value of all pixels of the first row of the target image frame and a gray value of all pixels of the last row;计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差;Calculating a difference between gray values of all pixels of the first row and a difference between gray values of all pixels of the last row;判断所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值。Determining whether the difference between the gray values of all the pixels of the first row and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold.
- 如权利要求7所述的识别方法,其特征在于,所述步骤“确定每一代表图像帧对应的目标图像帧”包括:The identification method according to claim 7, wherein the step of "determining a target image frame corresponding to each representative image frame" comprises:判断所述代表图像帧为三维图像还是二维图像;Determining whether the representative image frame is a three-dimensional image or a two-dimensional image;如果为三维图像,提取所述代表图像帧中的左眼图像或右眼图像,确定所 述提取出来的左眼图像或右眼图像为目标图像帧;If it is a three-dimensional image, extracting a left-eye image or a right-eye image in the representative image frame, determining The extracted left eye image or right eye image is a target image frame;如果为二维图像,确定所述代表图像帧为所述目标图像帧。If it is a two-dimensional image, it is determined that the representative image frame is the target image frame.
- 如权利要求8所述的识别方法,其特征在于,所述步骤“计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度”包括:The identification method according to claim 8, wherein the step of "calculating the matching degree between the gray value of the pixel of the first column and the gray value of the pixel of the last column" includes:依次以第一列和/或最后一列的每一个像素点为中心点,获取所述第一列和/或最后一列的当前为中心点的像素点上下相邻的预设个像素点的灰度值以及所述当前为中心点的像素点的像素值;Obtaining, according to each pixel point of the first column and/or the last column, the gray level of the preset pixel points adjacent to the pixel point of the current column of the first column and/or the last column a value and a pixel value of the pixel point currently being the center point;计算所述获取到的包括当前为中心点的像素点在内的若干像素点的灰度值的平均值,将所述平均值作为所述当前为中心点的像素点的校正灰度值,以此一一得出所述第一列和最后一列的每一个像素点的校正灰度值;Calculating an average value of the obtained grayscale values of the plurality of pixel points including the pixel point currently being the center point, and using the average value as the corrected gray value of the pixel point currently being the center point, This one obtains the corrected gray value of each pixel of the first column and the last column;分别计算第一列的每一个像素点的校正灰度值与最后一列对应行的像素点的校正灰度值的差值而得出若干个灰度值差值;以及Calculating a difference between the corrected gray value of each pixel of the first column and the corrected gray value of the pixel of the corresponding row of the last column to obtain a plurality of gray value difference values;计算所述若干个灰度值差值中小于或等于预设差值的灰度值差值所占的比例,将所述比例确定为所述匹配度。Calculating a proportion of the gray value difference values of the plurality of gray value difference values that are less than or equal to the preset difference value, and determining the ratio as the matching degree.
- 如权利要求8所述的识别方法,其特征在于,所述步骤“计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差”包括:The identification method according to claim 8, wherein said step "calculating a difference between gray values of all the pixels of said first line and a difference of gray values of all pixels of said last line" include:计算所述第一行的所有像素点的灰度值的方差得到所有像素点的灰度值之差,以及计算所述最后一行的所有像素点的灰度值的方差得到所述最后一行的所有像素点的灰度值之差。Calculating a variance of gray values of all the pixels of the first row to obtain a difference of gray values of all the pixels, and calculating a variance of gray values of all the pixels of the last row to obtain all of the last row The difference between the gray values of the pixels.
- 如权利要求6所述的识别方法,其特征在于,所述步骤“从所述待识别的视频文件中提取若干代表图像帧”包括:The identification method according to claim 6, wherein the step of "extracting a plurality of representative image frames from the video file to be identified" comprises:选取视频文件中的关键帧、或选取画面变化丰富的帧图像,或根据多个代表图像帧覆盖视频文件的时间段超过预设值来选取多个代表图像帧。Selecting a plurality of representative image frames by selecting a key frame in the video file, or selecting a frame image rich in picture variation, or a time period in which the video file is overlaid according to a plurality of representative image frames exceeds a preset value.
- 一种电子装置,包括处理器以及存储器,所述存储器中存储有待识别的视频文件,其特征在于,所述处理器用于:An electronic device includes a processor and a memory, wherein the memory stores a video file to be identified, wherein the processor is configured to:获取待识别的视频文件;Obtain a video file to be identified;从所述待识别的视频文件中提取若干代表图像帧;Extracting a plurality of representative image frames from the video file to be identified;确定每一代表图像帧是否为360度全景图像; Determining whether each representative image frame is a 360-degree panoramic image;确定为360度全景图像的代表图像帧所占的比例是否大于预设比例;Whether the proportion of the representative image frame determined as the 360-degree panoramic image is greater than a preset ratio;如果是,确定所述视频文件为360度全景视频,如果否,确定所述视频文件不为360度全景视频。If so, it is determined that the video file is a 360-degree panoramic video, and if not, it is determined that the video file is not a 360-degree panoramic video.
- 如权利要求13所述的电子装置,其特征在于,所述处理器确定每一代表图像帧是否为360度全景图像,包括:The electronic device according to claim 13, wherein the processor determines whether each representative image frame is a 360-degree panoramic image, comprising:确定每一代表图像帧对应的目标图像帧;Determining a target image frame corresponding to each representative image frame;判断每一目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断每一目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;Determining whether a matching degree between a gray value of a pixel of the first column of each target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of each target image frame Whether the difference between the gray values of all the pixels of the row and the gray value of all the pixels of the last row are less than or equal to the second threshold;如果是,确定对应的代表图像帧为360度全景图像,否则,确定对应的代表图像帧不为360度全景图像。If yes, it is determined that the corresponding representative image frame is a 360-degree panoramic image; otherwise, it is determined that the corresponding representative image frame is not a 360-degree panoramic image.
- 如权利要求14所述的电子装置,其特征在于,所述处理器判断每一目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断每一目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值,包括:The electronic device according to claim 14, wherein said processor determines a matching degree between a gray value of a pixel of the first column of each target image frame and a gray value of a pixel of the last column Whether it is greater than or equal to the first threshold, and whether the difference between the gray value of all the pixels of the first row of each target image frame and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold ,include:获取所述目标图像帧的第一列的像素点的灰度值以及最后一列的像素点的灰度值;Obtaining a gray value of a pixel of the first column of the target image frame and a gray value of the pixel of the last column;计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度;Calculating a matching degree between a gray value of a pixel of the first column and a gray value of a pixel of the last column;判断所述匹配度是否大于或等于第一阈值;Determining whether the matching degree is greater than or equal to a first threshold;获取所述目标图像帧的第一行的所有像素点的灰度值以及最后一行的所有像素点的灰度值;Obtaining a gray value of all pixels of the first row of the target image frame and a gray value of all pixels of the last row;计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差;Calculating a difference between gray values of all pixels of the first row and a difference between gray values of all pixels of the last row;判断所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值。Determining whether the difference between the gray values of all the pixels of the first row and the difference of the gray values of all the pixels of the last row are less than or equal to the second threshold.
- 如权利要求14所述的电子装置,其特征在于,所述处理器确定每一 代表图像帧对应的目标图像帧,包括:The electronic device of claim 14 wherein said processor determines each Representing the target image frame corresponding to the image frame, including:判断所述代表图像帧为三维图像还是二维图像;Determining whether the representative image frame is a three-dimensional image or a two-dimensional image;如果为三维图像,提取所述代表图像帧中的左眼图像或右眼图像,确定所述提取出来的左眼图像或右眼图像为目标图像帧;If it is a three-dimensional image, extracting a left eye image or a right eye image in the representative image frame, determining that the extracted left eye image or right eye image is a target image frame;如果为二维图像,确定所述代表图像帧为所述目标图像帧。If it is a two-dimensional image, it is determined that the representative image frame is the target image frame.
- 如权利要求15所述的电子装置,其特征在于,所述处理器计算第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度,包括:The electronic device according to claim 15, wherein the processor calculates a matching degree between the gray value of the pixel of the first column and the gray value of the pixel of the last column, including:依次以第一列和/或最后一列的每一个像素点为中心点,获取所述第一列和/或最后一列的当前为中心点的像素点上下相邻的预设个像素点的灰度值以及所述当前为中心点的像素点的像素值;Obtaining, according to each pixel point of the first column and/or the last column, the gray level of the preset pixel points adjacent to the pixel point of the current column of the first column and/or the last column a value and a pixel value of the pixel point currently being the center point;计算所述获取到的包括当前为中心点的像素点在内的若干像素点的灰度值的平均值,将所述平均值作为所述当前为中心点的像素点的校正灰度值,以此一一得出所述第一列和最后一列的每一个像素点的校正灰度值;Calculating an average value of the obtained grayscale values of the plurality of pixel points including the pixel point currently being the center point, and using the average value as the corrected gray value of the pixel point currently being the center point, This one obtains the corrected gray value of each pixel of the first column and the last column;分别计算第一列的每一个像素点的校正灰度值与最后一列对应行的像素点的校正灰度值的差值而得出若干个灰度值差值;以及Calculating a difference between the corrected gray value of each pixel of the first column and the corrected gray value of the pixel of the corresponding row of the last column to obtain a plurality of gray value difference values;计算所述若干个灰度值差值中小于或等于预设差值的灰度值差值所占的比例,将所述比例确定为所述匹配度。Calculating a proportion of the gray value difference values of the plurality of gray value difference values that are less than or equal to the preset difference value, and determining the ratio as the matching degree.
- 如权利要求15所述的电子装置,其特征在于,所述处理器计算所述第一行的所有像素点的灰度值之差以及所述最后一行的所有像素点的灰度值之差,包括:The electronic device according to claim 15, wherein said processor calculates a difference between gray values of all pixels of said first line and a difference of gray values of all pixels of said last line, include:计算所述第一行的所有像素点的灰度值的方差得到所有像素点的灰度值之差,以及计算所述最后一行的所有像素点的灰度值的方差得到所述最后一行的所有像素点的灰度值之差。Calculating a variance of gray values of all the pixels of the first row to obtain a difference of gray values of all the pixels, and calculating a variance of gray values of all the pixels of the last row to obtain all of the last row The difference between the gray values of the pixels.
- 如权利要求15所述的电子装置,其特征在于,所述处理器通过选取视频文件中的关键帧作为代表图像帧、或选取画面变化丰富的帧图像作为代表图像帧,或选取覆盖视频文件的时间段超过预设范围的多个图像帧作为所述多个代表图像帧。The electronic device according to claim 15, wherein the processor selects a key frame in the video file as a representative image frame, or selects a frame image rich in picture variation as a representative image frame, or selects a cover video file. A plurality of image frames whose time period exceeds a preset range are used as the plurality of representative image frames.
- 一种电子装置,包括处理器以及存储器,所述存储器中存储有待识别的图像文件,其特征在于,所述处理器用于: An electronic device includes a processor and a memory, wherein the memory stores an image file to be identified, wherein the processor is configured to:获取待识别的图像文件;Obtaining an image file to be identified;根据待识别的图像文件确定目标图像帧;Determining a target image frame according to the image file to be identified;判断所述目标图像帧的第一列的像素点的灰度值与最后一列的像素点的灰度值之间的匹配度是否大于或等于第一阈值,以及判断所述目标图像帧的第一行的所有像素点的灰度值之差以及最后一行的所有像素点的灰度值之差是否均小于或等于第二阈值;Determining whether a matching degree between a gray value of a pixel of the first column of the target image frame and a gray value of a pixel of the last column is greater than or equal to a first threshold, and determining a first of the target image frame Whether the difference between the gray values of all the pixels of the row and the gray value of all the pixels of the last row are less than or equal to the second threshold;如果是,确定所述待识别的图像文件为360度全景图像,否则,确定所述待识别的图像文件不为360度全景图像。 If yes, it is determined that the image file to be identified is a 360-degree panoramic image; otherwise, it is determined that the image file to be recognized is not a 360-degree panoramic image.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/087475 WO2018223318A1 (en) | 2017-06-07 | 2017-06-07 | 360-degree panoramic image and video identification method and electronic device |
CN201780004657.7A CN108475432B (en) | 2017-06-07 | 2017-06-07 | 360-degree panoramic image and 360-degree panoramic video identification method and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/087475 WO2018223318A1 (en) | 2017-06-07 | 2017-06-07 | 360-degree panoramic image and video identification method and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018223318A1 true WO2018223318A1 (en) | 2018-12-13 |
Family
ID=63266498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/087475 WO2018223318A1 (en) | 2017-06-07 | 2017-06-07 | 360-degree panoramic image and video identification method and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108475432B (en) |
WO (1) | WO2018223318A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581644A (en) * | 2012-07-31 | 2014-02-12 | 索尼公司 | Image processing apparatus, image processing method, and program |
CN103950410A (en) * | 2014-04-29 | 2014-07-30 | 深圳前向启创数码技术有限公司 | Panoramic auxiliary driving method and system |
CN106162146A (en) * | 2016-07-29 | 2016-11-23 | 暴风集团股份有限公司 | Automatically identify and the method and system of playing panoramic video |
CN106327531A (en) * | 2016-08-18 | 2017-01-11 | 成都虚拟世界科技有限公司 | Panorama video identification method and device, and video playing method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106331848B (en) * | 2016-08-18 | 2019-04-19 | 成都虚拟世界科技有限公司 | The recognition methods of panoramic video and equipment play video method and equipment |
CN106534974B (en) * | 2016-12-16 | 2019-04-26 | 暴风集团股份有限公司 | The method and system of automatic identification cube panoramic video |
CN106803994B (en) * | 2017-03-29 | 2019-07-26 | 暴风集团股份有限公司 | Identify the method and system of rectangular pyramid panoramic video |
-
2017
- 2017-06-07 WO PCT/CN2017/087475 patent/WO2018223318A1/en active Application Filing
- 2017-06-07 CN CN201780004657.7A patent/CN108475432B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581644A (en) * | 2012-07-31 | 2014-02-12 | 索尼公司 | Image processing apparatus, image processing method, and program |
CN103950410A (en) * | 2014-04-29 | 2014-07-30 | 深圳前向启创数码技术有限公司 | Panoramic auxiliary driving method and system |
CN106162146A (en) * | 2016-07-29 | 2016-11-23 | 暴风集团股份有限公司 | Automatically identify and the method and system of playing panoramic video |
CN106327531A (en) * | 2016-08-18 | 2017-01-11 | 成都虚拟世界科技有限公司 | Panorama video identification method and device, and video playing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108475432B (en) | 2021-12-28 |
CN108475432A (en) | 2018-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108024107B (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
JP4505362B2 (en) | Red-eye detection apparatus and method, and program | |
US9177194B2 (en) | System and method for visually distinguishing faces in a digital image | |
US8599270B2 (en) | Computing device, storage medium and method for identifying differences between two images | |
WO2021057474A1 (en) | Method and apparatus for focusing on subject, and electronic device, and storage medium | |
KR100658998B1 (en) | Image processing apparatus, image processing method and computer readable medium which records program thereof | |
CN108182421B (en) | Video segmentation method and device | |
US10027878B2 (en) | Detection of object in digital image | |
KR20200023651A (en) | Preview photo blurring method and apparatus and storage medium | |
WO2017215527A1 (en) | Hdr scenario detection method, device, and computer storage medium | |
CN107622497B (en) | Image cropping method and device, computer readable storage medium and computer equipment | |
WO2019223068A1 (en) | Iris image local enhancement method, device, equipment and storage medium | |
US11315360B2 (en) | Live facial recognition system and method | |
US8582813B2 (en) | Object detection device which detects object based on similarities in different frame images, and object detection method and computer-readable medium recording program | |
US10296806B2 (en) | Recognition-based color corrections | |
JP6374849B2 (en) | User terminal, color correction system, and color correction method | |
US9832395B2 (en) | Information processing method applied to an electronic device and electronic device having at least two image capturing units that have the same image capturing direction | |
WO2022111269A1 (en) | Method and device for enhancing video details, mobile terminal, and storage medium | |
CN108737797B (en) | White balance processing method and device and electronic equipment | |
CN108932703B (en) | Picture processing method, picture processing device and terminal equipment | |
CN103685854A (en) | Image processing apparatus, image processing method, and program | |
WO2018223318A1 (en) | 360-degree panoramic image and video identification method and electronic device | |
US12035033B2 (en) | DNN assisted object detection and image optimization | |
CN108470327B (en) | Image enhancement method and device, electronic equipment and storage medium | |
JP6217225B2 (en) | Image collation device, image collation method and program |
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: 17912697 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: 17912697 Country of ref document: EP Kind code of ref document: A1 |