WO2021042909A1 - 一种场景切换的检测方法、装置、电子设备及存储介质 - Google Patents
一种场景切换的检测方法、装置、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2021042909A1 WO2021042909A1 PCT/CN2020/104840 CN2020104840W WO2021042909A1 WO 2021042909 A1 WO2021042909 A1 WO 2021042909A1 CN 2020104840 W CN2020104840 W CN 2020104840W WO 2021042909 A1 WO2021042909 A1 WO 2021042909A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- video
- detected
- target image
- target
- images
- 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
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
Definitions
- This application relates to the field of computer vision technology, and in particular to a detection method, device, electronic device, and storage medium for scene switching.
- Video scene detection refers to finding out the position of the video frame where the scene is switched from a video. According to the position of the video frame where the scene is switched in the video, Edit videos quickly and accurately.
- the commonly used video scene switching detection method is to obtain the block order measurement feature vectors of the first video frame and the second video frame in the target video sequence respectively, and calculate the distance between the obtained block order measurement feature vectors. If the distance meets the preset distance requirement, it is determined that a scene switch has occurred between the two video frames.
- the method of calculating the feature vector by block and then judging whether the scene is switched according to the distance of the feature vector needs to extract more feature vectors, the calculation process is complicated, and the calculation cycle is long.
- the current video scene switching detection method has a complicated calculation process and low efficiency.
- This application relates to the field of computer vision technology, and in particular to a detection method, device, electronic device, and storage medium for scene switching. In order to solve the problem of complex calculation process and low efficiency of the current video scene switching detection method.
- the technical solution of this application is as follows:
- a method for detecting scene switching including:
- the reference value used to indicate the degree of gray value difference between the pixels of the two target images determine the reference value used to indicate the degree of gray value difference between the pixels of the two target images
- a scene switching detection device including:
- the determining module is configured to determine the target image corresponding to the original image in the video to be detected
- the calculation module is configured to determine the reference value used to indicate the degree of gray value difference between the pixels of the two target images according to the gray values of the pixels in the target images corresponding to the two adjacent original images;
- the judging module is configured to execute that if the reference value is greater than a preset threshold, it is determined that the scene to be detected is switched between the two adjacent original images.
- an electronic device including:
- a memory for storing executable instructions of the processor
- the processor is configured to determine the target image corresponding to the original image in the video to be detected; according to the gray value of the pixel in the target image corresponding to each of the two adjacent original images, determine to represent the two target images If the reference value is greater than the preset threshold value, it is determined that the scene switching of the video to be detected occurs between the two adjacent original images of the frame.
- a non-volatile storage medium is provided.
- the scene switching detection device can execute the above scenes. Switching detection method.
- a computer program product which when the computer program product runs on an electronic device, causes the electronic device to execute the detection method for realizing the above-mentioned scene switching.
- the pixel points in the target image corresponding to each of the two adjacent original images are determined.
- the gray value of determines the reference value used to indicate the degree of gray value difference between the pixels of the two target images.
- the reference value is greater than the preset threshold, it is determined that the video to be detected occurs between two adjacent original images Scene switching.
- Fig. 1 is a flow chart showing a method for detecting scene switching according to an exemplary embodiment
- Fig. 2 is a flow chart of down-sampling an original image according to an exemplary embodiment
- Fig. 3 is a schematic diagram showing a first original image according to an exemplary embodiment
- Fig. 4 is a schematic diagram showing a first target image according to an exemplary embodiment
- Fig. 5a is a schematic diagram showing a first target image of a first type according to an exemplary embodiment
- Fig. 5b is a schematic diagram showing a first type of second target image according to an exemplary embodiment
- FIG. 6 is a complete flow chart of scene switching detection in which the format of the original image is an image format without a gray channel, and the original image is directly used as a target image as an example, according to an exemplary embodiment;
- Fig. 7a is a schematic diagram showing the gray value corresponding to each pixel of the first original image of the first type according to an exemplary embodiment
- Fig. 7b is a schematic diagram showing the gray value corresponding to each pixel of the first second original image according to an exemplary embodiment
- FIG. 8 is a complete flow chart of scene switching detection in which a target image is obtained by down-sampling an original image, and the target image is an image format containing a grayscale channel as an example, according to an exemplary embodiment;
- Fig. 9 is a schematic diagram showing the original resolution of a first original image and a second original image of the first type according to an exemplary embodiment
- Fig. 10 is a schematic diagram showing a first target image resolution according to an exemplary embodiment
- Fig. 11a is a schematic diagram showing the gray value corresponding to each pixel of the first target image of the first type according to an exemplary embodiment
- Fig. 11b is a schematic diagram showing the gray value corresponding to each pixel of the second target image of the first type according to an exemplary embodiment
- FIG. 12 is a complete flow chart of scene switching detection in which a target image is obtained by down-sampling an original image, and the target image is an image format without a grayscale channel as an example, according to an exemplary embodiment;
- Fig. 13 is a schematic diagram showing the original resolution of a second type of first original image and a second original image according to an exemplary embodiment
- Fig. 14 is a schematic diagram showing a second target image resolution according to an exemplary embodiment
- Fig. 15a is a schematic diagram showing the gray value corresponding to each pixel of the second first target image according to an exemplary embodiment
- Fig. 15b is a schematic diagram showing the gray value corresponding to each pixel of the second target image of the second type according to an exemplary embodiment
- Fig. 16 is a block diagram showing a device for detecting scene switching according to an exemplary embodiment
- Fig. 17 is a block diagram showing an electronic device for scene switching detection according to an exemplary embodiment.
- frame in the embodiments of this application refers to a single image frame in the smallest unit of an image animation.
- a frame is a still image, and consecutive frames form a video.
- gray value in the embodiments of this application refers to the brightness of a single pixel.
- Grayscale is the value indicating the brightness of the image, that is, the color depth of the point in the black and white image. The range is generally from 0 to 255, with white being 255 and black being 0, so black and white images are also called grayscale images. The larger the gray value of the pixel, the brighter the pixel.
- pixel in the embodiments of this application refers to an indivisible unit or element in the entire image. Indivisible means that it cannot be cut into smaller units or elements. A single color cell exists. Each bitmap image contains a certain number of pixels, which determine the size of the image on the screen.
- the detection of scene switching is mainly used in video editing, and the video can be edited quickly and accurately according to the position of the video frame where the scene switching occurs in the video.
- an embodiment of the present application provides a scene switching detection method.
- the scene switching detection method provided by this application can be implemented by using an image processing application program.
- the image processing application program stores the code for executing the scene detection method provided in the embodiments of this application, and the user inputs the video to be detected into
- the image processing application program automatically extracts two adjacent frames of images for scene switching detection, specifically, calculates the gray value difference between the pixels of the two adjacent frames corresponding to the two images The reference value of the degree. If the reference value is greater than the preset threshold, it is determined that the scene to be detected is switched between two adjacent frames of images.
- the image processing application will detect every two adjacent frames of the video input by the user. , The position of the two frames in the output video where the video scene switch occurs, since the scene detection process is completed by the image processing program, and the calculation process of the scene detection provided by this application is simple and rapid, the waiting time of the user is relatively short.
- the scene switching detection method provided by this application can also be implemented by using an image processing application in cooperation with a server.
- the user inputs the video that needs to be detected into the image processing application, and the image processing application will The two frames of images are sent to the server, and the server calculates the reference value corresponding to the two adjacent frames of the image to indicate the degree of gray value difference between the pixels of the two images. If the reference value is greater than the preset threshold, it is determined that the video to be detected is in Scene switching occurs between two adjacent frames of images, and then the server returns the detection result to the image processing application, and the image processing application displays the position of the video frame in the detected video where the scene switching occurs to the user, because this method uses the image processing application The way the program cooperates with the server can detect scenes faster and save system resources.
- the image processing program can be a video editing application.
- the video editing program shows the user the location of the two images where the scene switch is detected, and the user can decide whether to perform the video at that location. Clip.
- the user can use the video editing application to quickly and accurately determine whether scene switching occurs between two adjacent frames in the video to be detected.
- Fig. 1 is a flow chart showing a method for detecting scene switching according to an exemplary embodiment, including the following steps:
- step S11 the target image corresponding to the original image in the video to be detected is determined.
- step S12 according to the gray values of the pixels in the target images corresponding to the two adjacent original images, a reference value used to indicate the degree of gray value difference between the pixels of the two target images is determined.
- step S13 if the reference value is greater than a preset threshold, it is determined that the scene to be detected is switched between the two adjacent original images.
- the pixel points in the target image corresponding to each of the two adjacent original images are determined.
- the gray value of determines the reference value used to indicate the degree of gray value difference between the pixels of the two target images.
- the reference value is greater than the preset threshold, it is determined that the video to be detected occurs between two adjacent original images Scene switching.
- the data to be collected during scene switching detection is reduced. Therefore, the detection speed and detection efficiency of scene switching can be accelerated.
- the target image corresponding to the original image in the video to be detected is determined; wherein the two original images are two adjacent frames of the image in the video to be detected.
- the target image corresponding to the original image in the video to be detected may be determined according to the following methods:
- An optional implementation manner is to directly use the acquired original image as the target image without any processing after acquiring two adjacent original images from the video to be detected.
- step S201 the magnification used when down-sampling the original image in the video to be detected is determined.
- step S202 filling processing is performed on the target image obtained by down-sampling.
- magnification used when down-sampling the original image in the video to be detected can be determined according to the following formula:
- the preset magnification is a preset value.
- the image is downsampled using the preset magnification, that is, the height and width of the original image are both downsampled using the preset magnification.
- the resolution of the original image I0 is h0*w0
- the preset magnification is S
- the preset target image resolution is a specific value set in advance. Before down-sampling the original image, the magnification is determined according to the preset target image resolution and the resolution of the original image.
- the magnification used when down-sampling the original image in the video to be detected can be determined according to the number of rows of pixels in the original image and the preset number of rows of pixels in the target image; or it can be based on the number of columns and columns of pixels in the original image.
- the preset number of columns of pixels in the target image determines the magnification used when down-sampling the original image in the video to be detected.
- the magnification used when down-sampling the original image in the video to be detected is calculated Or, calculate the magnification used when down-sampling the original image in the video to be detected
- the determined magnification can be used to down-sample the original image.
- the embodiment of the present application uses the determined magnification to sample some pixels from the original image to form the sampled target image.
- S is the magnification used when down-sampling the original image
- (i', j') is the coordinate of the pixel in the original image
- (i, j) is the coordinate of the pixel in the target image
- I0 (i', j') Is the pixel value of the pixel with coordinates (i',j') in the original image
- I(i,j) is the pixel value of the pixel with coordinates (i,j) in the target image.
- the original image shown in Figure 3 is down-sampled, assuming that the resolution of the original image is 16*16, and the preset magnification is 4, then the original image is down-sampled at the preset magnification to obtain the result as shown in Figure 4.
- the target image shown in the figure the resolution of the target image is 4*4; fill in the target image obtained by downsampling, and assign the pixel value of the pixel with the coordinates (0, 0) in the original image to the target image.
- the coordinates are (0,0), assign the pixel value of the pixel with coordinates (0,4) in the original image to the pixel with coordinates (0,1) in the target image, and set the coordinates in the original image to (0,
- the pixel value of the pixel point in 8) is assigned to the pixel point of the target image with coordinates (0, 2)...
- the gray value of the pixel in the target image can be determined according to the following method:
- Method 1 Obtain the gray value of each pixel from the gray channel corresponding to the target image.
- the grayscale value of each pixel is directly obtained according to the grayscale channel corresponding to the target image.
- the gray value of each pixel can be obtained directly by extracting the gray value of the Y channel.
- Manner 2 Determine the gray value of each pixel according to the value of the color channel corresponding to the target image.
- the gray value of each pixel is determined according to the value of the color channel corresponding to the target image.
- the gray value of the pixel is calculated according to the values of the R channel, the G channel, and the B channel.
- the gray value I of a pixel can be calculated according to the following formula:
- I represents the gray value of each pixel
- R represents the brightness value of the red channel
- G represents the brightness value of the green channel
- B represents the brightness value of the blue channel.
- the two target images before determining the reference value used to indicate the degree of gray value difference between the pixels of the two target images, according to the gray values of the pixels of the two target images, determine the two target images at the same position. The difference between the gray values of each pixel.
- the first target image as shown in FIG. 5a and the second target image as shown in FIG. 5b and it is assumed that the resolution of the first target image and the second target image is h*w.
- I(i,j) to represent the gray value corresponding to the pixel in the i-th row and j-th column in the first target image
- I 0 (i,j) to represent the pixel in the i-th row and j-th column in the second target image
- the reference value used to indicate the degree of gray value difference between the pixel points of the two target images may be determined according to the following manner.
- the average value of the gray value difference between the pixels at the same position in the two target images is determined according to the following formula:
- D represents the average value of the gray value difference between the pixels at the same position in the two target images
- w represents the width of the target image
- h represents the height of the target image
- I(i,j) represents the first target image
- I 0 (i, j) represents the gray value corresponding to the pixel in the i-th row and j-th column in the second target image.
- the average value of the gray value difference between the pixels at the same position in the two target images is obtained, and the average value is used as the reference value.
- calculating the average value of the gray value difference between the pixel points at the same position in the first target image shown in FIG. 5a and the second target image shown in FIG. 5b is:
- the reference value used to indicate the degree of gray value difference between the pixels of the first target image and the second target image is 54.13.
- the determined gray value difference can be calculated in the order of the gray value difference from large to small or from small to large.
- the gray value difference at a preset position in the sequence obtained by sorting is used as a reference value.
- the preset position may be a position in the middle region of the sequence obtained after sorting, for example, the reference value is the median of multiple determined gray value differences.
- the reference value corresponding to the first target image shown in FIG. 5a and the second target image shown in FIG. 5b is 44.5.
- the size of the reference value and the preset threshold is compared. If the reference value is greater than the preset threshold, it is determined that the video to be detected occurs between two adjacent original images. Scene switching.
- the preset threshold is a commonly used empirical value for judging scene switching summarized by technicians based on actual scene detection.
- the reference value is compared with the preset threshold value. If the reference value is greater than the preset threshold value, it is considered that the pixel value between the two target images has changed significantly, indicating that scene changes have occurred in the two original images detected at this time.
- the method for detecting scene switching in the embodiment of the present application includes the following steps:
- step S601 two adjacent original images in the video to be detected are acquired.
- step S602 the values of the color channels of the two original images are obtained respectively, and the gray value of each pixel of the original image is calculated.
- the specific calculation method can be:
- I represents the gray value of each pixel
- R represents the brightness value of the red channel
- G represents the brightness value of the green channel
- B represents the brightness value of the blue channel.
- step S603 according to the gray values of the pixels in the two original images, the average value of the gray value differences between the pixels at the same position in the two original images is determined as a reference value.
- step S604 it is determined whether the reference value is greater than the preset threshold; if yes, step S605 is executed, and if not, step S606 is executed.
- step S605 it is determined that the scene to be detected is switched between two adjacent original images of the video.
- step S606 it is determined that the scene to be detected does not switch between two adjacent original images of the video.
- the gray value of the first original image is shown in FIG. 7a
- the gray value of the second original image is shown in FIG. 7b.
- the average value of the difference between the pixels at the same position in the two original images in Figure 7a and Figure 7b is calculated according to the following method:
- D represents the average value of the gray value difference between the pixels at the same position in the two original images
- the resolution of the original image is w*h
- I(i,j) represents the i-th row in the first target image
- I 0 (i,j) represents the gray value corresponding to the pixel in the i-th row and the j-th column in the second target image
- the average value D of the difference between the pixel points at the same position of the two target images is obtained, the average value D is used as the reference value, that is, the reference value is 1.7.
- the target image is an image format containing grayscale channels as an example, as shown in Figure 8, including the following steps:
- step S801 the two frames of original images are down-sampled, and the image obtained after the down-sampling is used as the target image.
- step S802 the values of the gray-scale channels in the two target images are respectively extracted to obtain the gray-scale value of each pixel of the target image.
- step S803 according to the gray values of the pixels in the two target images, the median of the gray value differences between the pixels in the same position of the two target images is determined as a reference value.
- step S804 it is determined whether the reference value is greater than a preset threshold; if yes, step S805 is executed, and if not, step S806 is executed.
- step S805 it is determined that the scene to be detected is switched between two adjacent original images of the video.
- step S806 it is determined that no scene switching occurs between two adjacent original images of the video to be detected.
- the original resolutions of the first original image and the second original image are shown in Figure 9, and the resolution of the original image is 12*15; the original image is down-sampled with a preset value of 3 at a magnification ratio, and the result is shown in Figure 10.
- the resolution of the target image is 4*5; among them, each square in Figure 9 and Figure 10 represents a pixel.
- the gray value in the gray channel of the image is extracted.
- the gray value of the first target image is shown in Fig. 11a
- the gray value of the second target image is shown in Fig. 11b.
- the median of the gray value difference can be obtained according to the following methods:
- the median is 28 after calculation, and the obtained median is used as the reference value, that is, the reference value is 28.
- step S1201 the two frames of original images are down-sampled, and the image obtained after the down-sampling is used as the target image.
- step S1202 the numerical values of the color channels of the target image are respectively obtained, and the gray value of each pixel of the target image is calculated.
- the specific calculation method can be:
- I represents the gray value of each pixel
- R represents the brightness value of the red channel
- G represents the brightness value of the green channel
- B represents the brightness value of the blue channel
- step S1203 according to the gray values of the pixels in the two target images, the average value of the gray value differences between the pixels in the same position of the two target images is determined as a reference value.
- step S1204 it is determined whether the reference value is greater than the preset threshold; if yes, step S1205 is executed, and if not, step S1206 is executed.
- step S1205 it is determined that the scene to be detected is switched between two adjacent original images of the video.
- step S1206 it is determined that no scene switching has occurred between two adjacent original images of the video to be detected.
- the original resolutions of the first original image and the second original image are as shown in Figure 13, and the resolution of the original image is 16*20; the original image is down-sampled with a preset value of 4 magnification, and the result is shown in Figure 14.
- the resolution of the target image is 4*5; among them, each square in Figure 13 and Figure 14 represents a pixel.
- the gray value of the second target image is as shown in Fig. 15b.
- D represents the average value of the gray value difference between the pixels at the same position in the two target images
- w represents the width of the target image
- h represents the height of the target image
- I(i,j) represents the first target image
- I 0 (i, j) represents the gray value corresponding to the pixel in the i-th row and j-th column in the second target image
- the average value D of the difference between the pixel points at the same position of the two target images is obtained, the average value D is used as the reference value, that is, the reference value is 24.5.
- Fig. 16 is a block diagram showing a device for detecting scene switching according to an exemplary embodiment.
- the device includes a determination module 1601, a calculation module 1602, and a judgment module 1603.
- the determining module 1601 is configured to determine the target image corresponding to the original image in the video to be detected
- the calculation module 1602 is configured to determine the reference value used to indicate the degree of gray value difference between the pixels of the two target images according to the gray values of the pixels in the target images corresponding to the two adjacent original images;
- the judging module 1603 is configured to execute if the reference value is greater than a preset threshold value, it is determined that the to-be-detected video has a scene switch between the two adjacent original images.
- the determining module 1601 is configured to execute the original image in the to-be-detected video as a target image; or to down-sample the original image in the to-be-detected video, and to down-sample the original image in the video to be detected.
- the obtained image is used as the target image corresponding to the original image.
- the determining module 1601 is configured to perform a preset magnification as the magnification used when down-sampling the original image in the video to be detected; or according to the preset target image
- the resolution and the resolution of the original image in the to-be-detected video determine the magnification used when down-sampling the original image in the to-be-detected video.
- the calculation module 1602 is configured to perform determination of one of the pixels at the same position in the two target images according to the gray values of the pixels in the target image corresponding to each of the two adjacent original images.
- the average value of the difference between the gray values, the average value is used as the reference value; or, according to the gray value of the pixel points in the target image corresponding to each of the two adjacent original images, it is determined that the two target images are the same
- the gray value difference between the pixel points of the position; the determined gray value difference is sorted, and the gray value difference at the preset position is used as the reference value.
- the calculation module 1602 is configured to obtain the gray value of each pixel from the gray channel corresponding to the target image; or to obtain the gray value of each pixel according to the color channel corresponding to the target image. The value determines the gray value of each pixel.
- Fig. 17 is a block diagram showing an electronic device 1700 for scene switching detection according to an exemplary embodiment, including:
- a memory 1720 for storing executable instructions of the processor 1710
- the processor 1710 is configured to execute the instruction, so as to implement any of the foregoing scene switching detection methods.
- a non-volatile storage medium including instructions, such as a memory 1720 including instructions, which can be executed by the processor 1710 of the electronic device 1700 to complete any of the foregoing detection methods for scene switching.
- the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage Equipment, etc.
- the embodiments of the present application also provide a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the detection method for realizing any of the above-mentioned scene switching.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
本申请关于一种场景切换的检测方法、装置、电子设备及存储介质,涉及计算机视觉技术领域,用以解决目前视频的场景切换检测方法计算过程复杂且效率较低的问题。该方法包括:确定待检测视频中原始图像对应的目标图像;根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;若参考值大于预设阈值,则确定待检测视频在这相邻两帧原始图像之间发生场景切换。这样,通过计算表示两个目标图像的像素点之间的灰度值差异程度的参考值,将该参考值与预设阈值比较大小来进行场景切换检测,降低了场景切换检测时所要采集的数据的复杂度,因此,可提升场景切换的检测速度和检测效率。
Description
本申请要求在2019年09月05日提交中国专利局、申请号为201910836850.8、申请名称为“一种场景切换的检测方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机视觉技术领域,尤其涉及一种场景切换的检测方法、装置、电子设备及存储介质。
一般地,一个视频由多个场景组成,一个场景由多个视频帧组成,视频场景检测是指从一个视频中找出发生场景切换的视频帧位置,根据视频中发生场景切换的视频帧位置能够快速且精确地对视频进行剪辑。
目前,常用的视频场景切换检测方法为分别获得目标视频序列中第一视频帧和第二视频帧的分块顺序测度特征向量,计算所获得的分块顺序测度特征向量之间的距离,若该距离满足预设的距离要求,则判定这两个视频帧之间发生了场景切换。但发明人发现,通过分块计算特征向量,再根据特征向量的距离来判断场景是否切换的方法需要提取较多的特征向量,计算过程复杂,且计算周期长。
综上所述,目前视频的场景切换检测方法计算过程复杂且效率较低。
发明内容
本申请涉及计算机视觉技术领域,尤其涉及一种场景切换的检测方法、装置、电子设备及存储介质。以解决目前视频的场景切换检测方法计算过程复杂且效率较低的问题。本申请的技术方案如下:
根据本申请实施例的第一方面,提供一种场景切换的检测的方法,包括:
确定待检测视频中原始图像对应的目标图像;
根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;
若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
根据本申请实施例的第二方面,提供一种场景切换的检测装置,包括:
确定模块,被配置为执行确定待检测视频中原始图像对应的目标图像;
计算模块,被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;
判断模块,被配置执行为若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
根据本申请实施例的第三方面,提供一种电子设备,包括:
处理器;
用于存储所述处理器可执行指令的存储器;
其中,所述处理器被配置为执行确定待检测视频中原始图像对应的目标图像;根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
根据本申请实施例的第四方面,提供一种非易失性存储介质,当所述存储介质中的指令由场景切换的检测装置的处理器执行时,使得场景切换的检测装置能够执行上述场景切换的检测方法。
根据本申请实施例的第五方面,提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行实现上述场景切换的检测方法。
本申请实施例提供的技术方案至少带来以下有益效果:
相比现有计算测度特征向量间的距离的检测方法,本申请实施例中,在确定待检测视频中原始图像对应的目标图像后,根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值,当参考值大于预设阈值时,确定待检测视频在相邻两帧原始图像之间发生场景切换。这样,通过计算表示两个目标图像的像素点之间的灰度值差异程度的参考值,将该参考值与预设阈值比较大小来进行场景切换检测,降低了场景切换检测时所要采集的数据的复杂度,因此,可提升场景切换的检测速度和检测效率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请实施例,并与说明书一起用于解释本申请的原理,并不构成对本申请的不当限定。
图1是根据一示例性实施例示出的一种场景切换的检测方法的流程图;
图2是根据一示例性实施例示出的对原始图像进行下采样的流程图;
图3是根据一示例性实施例示出的第一种原始图像示意图;
图4是根据一示例性实施例示出的第一种目标图像示意图;
图5a是根据一示例性实施例示出的第一种第一目标图像示意图;
图5b是根据一示例性实施例示出的第一种第二目标图像示意图;
图6是根据一示例性实施例示出的以原始图像的格式为不含灰度通道的图像格式,将原始图像直接作为目标图像为例的场景切换检测的完整流程图;
图7a是根据一示例性实施例示出的第一种第一原始图像各像素点对应的灰度值示意图;
图7b是根据一示例性实施例示出的第一种第二原始图像各像素点对应的灰度值示意图;
图8是根据一示例性实施例示出的以对原始图像进行下采样获得目标图像,且目标图像为含有灰度通道的图像格式为例的场景切换检测的完整流程图;
图9是根据一示例性实施例示出的第一种第一原始图像与第二原始图像的原分辨率示意图;
图10是根据一示例性实施例示出的第一种目标图像分辨率示意图;
图11a是根据一示例性实施例示出的第一种第一目标图像各像素点对应的灰度值示意图;
图11b是根据一示例性实施例示出的第一种第二目标图像各像素点对应的灰度值示意图;
图12是根据一示例性实施例示出的以对原始图像进行下采样获得目标图像,且目标图像为不含灰度通道的图像格式为例的场景切换检测的完整流程图;
图13是根据一示例性实施例示出的第二种第一原始图像与第二原始图像的原分辨率示意图;
图14是根据一示例性实施例示出的第二种目标图像分辨率示意图;
图15a是根据一示例性实施例示出的第二种第一目标图像各像素点对应的灰度值示意图;
图15b是根据一示例性实施例示出的第二种第二目标图像各像素点对应的灰度值示意图;
图16是根据一示例性实施例示出的一种场景切换的检测装置框图;
图17是根据一示例性实施例示出的一种用于场景切换检测的电子设备的框图。
为了使本领域普通人员更好地理解本申请的技术方案,下面将结合附图,对本申请实施例的技术方案进行清楚、完整地描述。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
下面对文中出现的一些词语进行解释:
1、本申请实施例中术语“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
2、本申请实施例中术语“帧”,是指影像动画中最小单位的单幅影像画面,一帧就是一副静止的画面,连续的帧就形成了视频。
3、本申请实施例中术语“灰度值”,是指单个像素点的亮度。灰度是表明图像明暗的数值,即黑白图像中点的颜色深度,范围一般从0到255,白色为255,黑色为0,故黑白图像也称灰度图像。像素点的灰度值越大则像素点越亮。
4、本申请实施例中术语“像素”,是指整个图像中不可分割的单位或者是元素,其中,不可分割的意思是指其不能够再切割成更小单位抑或是元素,它是以一个单一颜色的小格存在。每一个点阵图像包含了一定数量的像素,这些像素决定图像在屏幕上所呈现的大小。
本申请实施例描述的应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
场景切换的检测主要应用在视频剪辑中,根据视频中发生场景切换的视频帧位置能够快速且精确地对视频进行剪辑。
针对现有技术中视频的场景切换检测方法计算过程复杂且效率较低的问题,本申请实施例提供一种场景切换的检测方法。
本申请提供的一种场景切换的检测方法可以使用一种图像处理应用程序实现,该图像处理应用程序中存储有执行本申请实施例提供的场景检测方法的代码,用户将需要检测的视频输入到该图像处理应用程序中,该图像处理应用程序自动提取相邻两帧图像进行场景 切换检测,具体地,计算相邻两帧图像对应的用于表示两个图像的像素点之间灰度值差异程度的参考值,若参考值大于预设阈值,则确定待检测视频在相邻两帧图像之间发生场景切换,图像处理应用程序在对用户输入的视频的每相邻两帧均检测完毕后,输出视频中发生视频场景切换的两帧的位置,由于场景检测的过程均由图像处理程序完成,且本申请提供的场景检测的计算过程简单迅速,因此,用户的等待时间比较短。
本申请提供的一种场景切换的检测方法还可以使用一种图像处理应用程序与服务器配合的方式实现,用户将需要检测的视频输入到图像处理应用程序中,该图像处理应用程序将每相邻两帧图像传给服务器,服务器计算相邻两帧图像对应的用于表示两个图像的像素点之间灰度值差异程度的参考值,若参考值大于预设阈值,则确定待检测视频在相邻两帧图像之间发生场景切换,然后,服务器将检测结果返回给图像处理应用程序,图像处理应用程序将检测视频中发生场景切换的视频帧位置展示给用户,由于该方式使用图像处理应用程序与服务器配合的方式,检测场景的速度更快,且节约系统资源。
可选的,图像处理程序可以为视频剪辑应用程序,用户输入待检测视频后,视频剪辑程序向用户展示检测到发生场景切换的两帧图像的位置,用户可以决定是否要在该位置对视频进行剪辑。用户使用该视频剪辑应用程序可以快速准确地确定待检测视频中相邻两帧是否发生场景切换。
图1为根据一示例性实施例示出的一种场景切换的检测方法的流程图,包括以下步骤:
在步骤S11中,确定待检测视频中原始图像对应的目标图像。
在步骤S12中,根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值。
在步骤S13中,若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
相比现有计算测度特征向量间的距离的检测方法,本申请实施例中,在确定待检测视频中原始图像对应的目标图像后,根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值,当参考值大于预设阈值时,确定待检测视频在相邻两帧原始图像之间发生场景切换。这样,通过计算表示两个目标图像的像素点之间的灰度值差异程度的参考值,将该参考值与预设阈值比较大小来进行场景切换检测,降低了场景切换检测时所要采集的数据的复杂度,因此,可加快场景切换的检测速度和检测效率。
本申请实施例中,确定待检测视频中原始图像对应的目标图像;其中,两帧原始图像为待检测视频中相邻的两帧图像。
需要说明的是,本申请实施例针对待检测视频中任意相邻两帧原始图像,判断该相邻两帧原始图像之间是否发生场景切换。
本申请实施例可以根据以下方式确定待检测视频中原始图像对应的目标图像:
1、将待检测视频中的原始图像作为目标图像。
一种可选的实施方式为,在从待检测视频中获取相邻两帧原始图像后,不做任何处理,直接将获取到的原始图像作为目标图像。
2、对待检测视频中的原始图像进行下采样,将下采样得到的图像作为原始图像对应的目标图像。
一种可能的实施方式,如图2所示,根据下列步骤对原始图像进行下采样:
在步骤S201中,确定对待检测视频中的原始图像进行下采样时使用的倍率。
在步骤S202中,对下采样得到的目标图像进行填充处理。
本申请实施例中,可以根据下列式确定对待检测视频中的原始图像进行下采样时使用的倍率:
1、将预设的倍率作为对待检测视频中的原始图像进行下采样时使用的倍率。
预设的倍率是预先设置的数值,在对原始图像进行下采样时,使用预设的倍率对图像下采样,即对原始图像的高和宽均使用该预设的倍率进行下采样。
例如,原始图像I0的分辨率为h0*w0,预设的倍率为S,则下采样后得到的目标图像I的分辨率为h*w,其中,h=h0/S,w=w0/S。
2、根据预设的目标图像的分辨率以及待检测视频中原始图像的分辨率,确定对待检测视频中的原始图像进行下采样时使用的倍率。
预设的目标图像分辨率是预先设置的具体数值,在对原始图像下采样之前,根据预先设置的目标图像分辨率以及原始图像的分辨率确定倍率。
具体的,可以根据原始图像中像素的行数以及预先设置的目标图像中像素的行数,确定对待检测视频中原始图像进行下采样时使用的倍率;或者可以根据原始图像中像素的列数以及预先设置的目标图像中像素的列数,确定对待检测视频中原始图像进行下采样时使用的倍率。
在确定出对原始图像进行下采样时使用的倍率之后,即可使用确定出的倍率对原始图像进行下采样。
本申请实施例使用确定出的倍率,从原始图像中采样部分像素点组成采样后的目标图像。
一种可能的实施方式,针对目标图像中的任一个像素点,若其位置坐标为(i,j),(i∈[0,h-1],j∈[0,w-1]),则该像素点的像素值可以使用如下公式确定:
i'=ceil(i*S);
j'=ceil(j*S);
I(i,j)=I0(i',j');
其中,S是对原始图像下采样时使用的倍率,(i',j')是原始图像中像素点坐标,(i,j)是目标图像中像素点坐标,I0(i',j')为坐标为(i',j')的像素点在原始图像中的像素值,I(i,j)为坐标为(i,j)的像素点在目标图像中的像素值。
例如,对如图3所示的原始图像进行下采样,假设原始图像的分辨率为16*16,预设的倍率为4,则对原始图像以预设的倍率下采样后得到如图4所示的目标图像,该目标图像的分辨率为4*4;对下采样得到的目标图像进行填充处理,将原始图像中坐标为(0,0)的像素点的像素值赋给目标图像坐标为(0,0)的像素点,将原始图像中坐标为(0,4)的像素点的像素值赋给目标图像坐标为(0,1)的像素点,将原始图像中坐标为(0,8)的像素点的像素值赋给目标图像坐标为(0,2)的像素点……由此,即可得到对原始图像进行下采样后的目标图像。
需要说明的是,对两帧原始图像下采样时需要使用相同的倍率。
本申请实施例中,在确定待检测视频中原始图像对应的目标图像后,目标图像中像素点的灰度值可根据以下方式确定:
方式1、从目标图像对应的灰度通道中获取每个像素点的灰度值。
实施中,在目标图像的格式为包含灰度通道的图像格式时,则根据目标图像对应的灰度通道直接获取每个像素点的灰度值。
例如,目标图像格式为YUV格式,可以直接通过提取Y通道的灰度值来获取每个像素点的灰度值。
方式2、根据目标图像对应的颜色通道的数值确定每个像素点的灰度值。
实施中,在目标图像的格式为不包含灰度通道的图像格式时,则根据目标图像对应的颜色通道的数值确定每个像素点的灰度值。
例如,目标图像的格式为RGB格式,则在确定目标图像中每个像素点的灰度值时, 根据R通道、G通道以及B通道的数值计算像素点的灰度值。
一种可能的实施方式,像素点的灰度值I可根据下列公式计算:
I=R*0.299+G*0.587+B*0.114;
其中,I表示每个像素点的灰度值,R表示红色通道的亮度值,G表示绿色通道的亮度值,B表示蓝色通道的亮度值。
本申请实施例中,在确定出相邻两帧原始图像各自对应的目标图像中像素点的灰度值之后,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值。
实施中,在确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值之前,根据两个目标图像的像素点的灰度值,确定两个目标图像中相同位置的两个像素点的灰度值的差值。
例如,如图5a所示的第一目标图像和如图5b所示的第二目标图像,且假设第一目标图像和第二目标图像的分辨率为h*w。使用I(i,j)表示第一目标图像中第i行第j列的像素点对应的灰度值,I
0(i,j)表示第二目标图像中第i行第j列的像素点对应的灰度值;其中,0≤i≤h-1,0≤j≤w-1。
计算第一目标图像和第二目标图像中相同位置的两个像素点的灰度值的差值ΔI=I(i,j)-I
0(i,j)。
在本申请实施例中,可以根据以下方式确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值。
1、根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值的平均值,将平均值作为参考值。
一种可能的实施方式,根据下列公式确定两个目标图像中相同位置的像素点之间灰度值差值的平均值:
其中,D表示两个目标图像中相同位置的像素点之间灰度值差值的平均值,w表示目标图像的宽,h表示目标图像的高,I(i,j)表示第一目标图像中第i行第j列的像素点对应的灰度值,I
0(i,j)表示第二目标图像中第i行第j列的像素点对应的灰度值。
计算后得到两个目标图像中相同位置的像素点之间灰度值差值的平均值,并将该平均值作为参考值。
例如,计算如图5a所示的第一目标图像和如图5b所示的第二目标图像中相同位置的像素点之间的灰度值差值的平均值为:
则用于表示第一目标图像和第二目标图像的像素点之间灰度值差异程度的参考值为54.13。
2、根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值;对确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为参考值。
实施中,在计算出两个目标图像中相同位置的像素点灰度值差值之后,可以按照灰度值差值从大到小或者从小到大的顺序对确定出的灰度值差值进行排序,将排序得到的序列中位于预设位置的灰度值差值作为参考值。
可选的,该预设位置可以为排序后得到的序列的中间区域中一个位置,例如,参考值为确定出的多个灰度值差值的中位数。
假设,以参考值为确定出的多个灰度值差值的中位数为例,如图5a所示第一目标图像和如图5b所示的第二目标图像对应的参考值为44.5。
本申请实施例在确定两个目标图像对应的参考值后,比较参考值与预设阈值的大小,若参考值大于预设阈值,则确定待检测视频在相邻两帧原始图像之间发生了场景切换。
其中,预设阈值为技术人员根据实际场景检测总结出来的常用的判断场景切换的经验数值。
将参考值与预设阈值比较大小,若参考值大于预设阈值,则认为两个目标图像之间的像素值已发生了明显变化,表示此时检测的两帧原始图像已经发生了场景变化。
下面以几个具体例子说明场景切换的检测方法。
一、以原始图像的格式为不含灰度通道的图像格式,将原始图像直接作为目标图像为例,如图6所示,本申请实施例场景切换的检测方法包含以下步骤:
在步骤S601中,获取待检测视频中相邻两帧原始图像。
在步骤S602中,分别获取两帧原始图像的颜色通道的数值,计算得到原始图像每个像素点的灰度值。
具体计算方式可以为:
I=R*0.299+G*0.587+B*0.114;
其中,I表示每个像素点的灰度值,R表示红色通道的亮度值,G表示绿色通道的亮度值,B表示蓝色通道的亮度值。
在步骤S603中,根据两个原始图像中像素点的灰度值,确定两个原始图像相同位置 的像素点之间灰度值差值的平均值作为参考值。
在步骤S604中,判断参考值是否大于预设阈值;若是,执行步骤S605,若否,执行步骤S606。
在步骤S605中,确定待检测视频在相邻两帧原始图像之间发生了场景切换。
在步骤S606中,确定待检测视频在相邻两帧原始图像之间没有发生场景切换。
例如,第一原始图像的灰度值如图7a所示,第二原始图像的灰度值如图7b所示。在获取到每个像素点的灰度值后,根据以下方式计算图7a和图7b中两个原始图像相同位置的像素点之间的差值的平均值:
其中,D表示两个原始图像中相同位置的像素点之间灰度值差值的平均值,原始图像的分辨率为w*h,I(i,j)表示第一目标图像中第i行第j列的像素点对应的灰度值,I
0(i,j)表示第二目标图像中第i行第j列的像素点对应的灰度值;
得到两个目标图像相同位置的像素点之间的差值的平均值D后,将该平均值D作为参考值,即参考值为1.7。
假设使用的预设阈值为20,参考值1.7小于预设阈值20,则确定待检测视频在这两帧原始图像处没有发生场景切换。
二、以对原始图像进行下采样获得目标图像,且目标图像为含有灰度通道的图像格式为例,如图8所示,包含以下步骤:
在步骤S801中,对两帧原始图像进行下采样,将下采样后得到的图像作为目标图像。
在步骤S802中,分别提取两个目标图像中灰度通道的数值,得到目标图像每个像素点的灰度值。
在步骤S803中,根据两个目标图像中像素点的灰度值,确定两个目标图像相同位置的像素点之间灰度值差值的中位数作为参考值。
在步骤S804中,判断参考值是否大于预设阈值;若是,执行步骤S805,若否,执行步骤S806。
在步骤S805中,确定待检测视频在相邻两帧原始图像之间发生了场景切换。
在步骤S806中,确定待检测视频在相邻两帧原始图像之间没有发生场景切换。
例如,第一原始图像与第二原始图像的原分辨率如图9所示,原始图像的分辨率为12*15;经过预设数值为3的倍率对原始图像进行下采样,获得如图10所示的目标图像,目标图像的分辨率为4*5;其中,图9和图10中的每个方格表示一个像素点。
提取图像灰度通道中的灰度值,第一目标图像的灰度值如图11a所示,第二目标图像的灰度值如图11b所示。
获得两个目标图像中像素点的灰度值后,计算两个目标图像相同位置的像素点之间灰度值的差值,对确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为参考值。
假设使用中位数作为参考值,可根据下列方式获取灰度值差值的中位数:
将计算得到的各灰度值差值以从小到大的顺序排列,假设有N个灰度值差值,当N为奇数时,中位数为排在第(N+1)/2个的灰度值差值;当N为偶数时,中位数为排在第N/2与第N/2+1的两个灰度值差值的平均数。
如图11a所示的第一目标图像和如图11b所示的第二目标图像,计算后可得中位数为28,将获取得到的中位数作为参考值,即参考值为28。
假设使用的预设阈值为20,则参考值28大于预设阈值20,则确定待检测视频在这两帧原始图像处发生了场景切换。
三、以对原始图像进行下采样获得目标图像,且目标图像为不含灰度通道的图像格式为例,如图12所示,包含以下步骤:
在步骤S1201中,对两帧原始图像进行下采样,将下采样后得到的图像作为目标图像。
在步骤S1202中,分别获取目标图像的颜色通道的数值,计算得到目标图像每个像素点的灰度值。
具体计算方式可以为:
I=R*0.299+G*0.587+B*0.114;
其中,I表示每个像素点的灰度值,R表示红色通道的亮度值,G表示绿色通道的亮度值,B表示蓝色通道的亮度值;
在步骤S1203中,根据两个目标图像中像素点的灰度值,确定两个目标图像相同位置的像素点之间灰度值差值的平均值作为参考值。
在步骤S1204中,判断参考值是否大于预设阈值;若是,执行步骤S1205,若否,执行步骤S1206。
在步骤S1205中,确定待检测视频在相邻两帧原始图像之间发生了场景切换。
在步骤S1206中,确定待检测视频在相邻两帧原始图像之间没有发生场景切换。
例如,第一原始图像与第二原始图像的原分辨率如图13所示,原始图像的分辨率为16*20;经过预设数值为4的倍率对原始图像进行下采样,获得如图14所示的目标图像,目标图像的分辨率为4*5;其中,图13和图14中的每个方格表示一个像素点。
在对两帧原始图像下采样获得两帧目标图像后,分别提取两帧目标图像的颜色通道的 数值,计算得到每个像素点对应的灰度值,假设计算后第一目标图像的灰度值如图15a所示,第二目标图像的灰度值如图15b所示。
在获取到每个像素点的灰度值后,根据以下方式计算图15a所示的第一目标图像与图15b所示的第二目标图像中两个目标图像相同位置的像素点之间的差值的平均值:
其中,D表示两个目标图像中相同位置的像素点之间灰度值差值的平均值,w表示目标图像的宽,h表示目标图像的高,I(i,j)表示第一目标图像中第i行第j列的像素点对应的灰度值,I
0(i,j)表示第二目标图像中第i行第j列的像素点对应的灰度值;
得到两个目标图像相同位置的像素点之间的差值的平均值D后,将该平均值D作为参考值,即参考值为24.5。
假设使用的预设阈值为20,参考值24.5大于预设阈值20,则确定待检测视频在这两帧原始图像处发生了场景切换。
图16是根据一示例性实施例示出的一种场景切换的检测装置框图,该装置包括确定模块1601,计算模块1602,判断模块1603。
确定模块1601,被配置为执行确定待检测视频中原始图像对应的目标图像;
计算模块1602,被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;
判断模块1603,被配置执行为若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
在一种可能的实现方式中,所述确定模块1601被配置为执行将所述待检测视频中的原始图像作为目标图像;或对所述待检测视频中的原始图像进行下采样,将下采样得到的图像作为所述原始图像对应的目标图像。
在一种可能的实现方式中,所述确定模块1601被配置为执行将预设的倍率作为对所述待检测视频中的原始图像进行下采样时使用的倍率;或根据预设的目标图像的分辨率以及所述待检测视频中原始图像的分辨率,确定对所述待检测视频中的原始图像进行下采样时使用的倍率。
在一种可能的实现方式中,所述计算模块1602被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值的平均值,将所述平均值作为所述参考值;或,根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值;将 确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为所述参考值。
在一种可能的实现方式中,所述计算模块1602被配置为执行从所述目标图像对应的灰度通道中获取每个像素点的灰度值;或根据所述目标图像对应的颜色通道的数值确定每个像素点的灰度值。
关于上述实施例中的装置,其中各个模块执行请求的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图17是根据一示例性实施例示出的一种用于场景切换检测的电子设备1700的框图,包括:
处理器1710;
用于存储所述处理器1710可执行指令的存储器1720;
其中,所述处理器1710被配置为执行所述指令,以实现上述任一场景切换的检测方法。
在示例性实施例中,还提供了一种包括指令的非易失性存储介质,例如包括指令的存储器1720,上述指令可由电子设备1700的处理器1710执行以完成上述任一场景切换的检测方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行实现上述任一场景切换的检测方法。
本领域技术人员在考虑说明书及实践这里公开的内容后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。
Claims (16)
- 一种场景切换的检测方法,该方法包括:确定待检测视频中原始图像对应的目标图像;根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
- 如权利要求1所述的方法,所述确定待检测视频中原始图像对应的目标图像,包括:将所述待检测视频中的原始图像作为目标图像;或对所述待检测视频中的原始图像进行下采样,将下采样得到的图像作为所述原始图像对应的目标图像。
- 如权利要求2所述的方法,根据下列方式确定对所述待检测视频中的原始图像进行下采样时使用的倍率:将预设的倍率作为对所述待检测视频中的原始图像进行下采样时使用的倍率;或根据预设的目标图像的分辨率以及所述待检测视频中原始图像的分辨率,确定对所述待检测视频中的原始图像进行下采样时使用的倍率。
- 如权利要求1所述的方法,所述根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值,包括:根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值的平均值,将所述平均值作为所述参考值;或根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值;对确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为所述参考值。
- 如权利要求1所述的方法,根据下列方式确定所述目标图像中每个像素点的灰度值:从所述目标图像对应的灰度通道中获取每个像素点的灰度值;或根据所述目标图像对应的颜色通道的数值确定每个像素点的灰度值。
- 一种场景切换的检测装置,包括:确定模块,被配置为执行确定待检测视频中原始图像对应的目标图像;计算模块,被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;判断模块,被配置执行为若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
- 如权利要求6所述的装置,所述确定模块被配置为执行将所述待检测视频中的原始 图像作为目标图像;或对所述待检测视频中的原始图像进行下采样,将下采样得到的图像作为所述原始图像对应的目标图像。
- 如权利要求7所述的装置,所述确定模块被配置为执行将预设的倍率作为对所述待检测视频中的原始图像进行下采样时使用的倍率;或根据预设的目标图像的分辨率以及所述待检测视频中原始图像的分辨率,确定对所述待检测视频中的原始图像进行下采样时使用的倍率。
- 如权利要求6所述的装置,所述计算模块被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值的平均值,将所述平均值作为所述参考值;或根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值;对确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为所述参考值。
- 如权利要求6所述的装置,所述计算模块被配置为执行从所述目标图像对应的灰度通道中获取每个像素点的灰度值;或根据所述目标图像对应的颜色通道的数值确定每个像素点的灰度值。
- 一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行确定待检测视频中原始图像对应的目标图像;根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定用于表示两个目标图像的像素点之间灰度值差异程度的参考值;若所述参考值大于预设阈值,则确定所述待检测视频在所述相邻两帧原始图像之间发生场景切换。
- 如权利要求11所述的电子设备,所述处理器被配置为执行将所述待检测视频中的原始图像作为目标图像;或对所述待检测视频中的原始图像进行下采样,将下采样得到的图像作为所述原始图像对应的目标图像。
- 如权利要求12所述的电子设备,所述处理器被配置为执行将预设的倍率作为对所述待检测视频中的原始图像进行下采样时使用的倍率;或根据预设的目标图像的分辨率以及所述待检测视频中原始图像的分辨率,确定对所述待检测视频中的原始图像进行下采样时使用的倍率。
- 如权利要求11所述的电子设备,所述处理器被配置为执行根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值的平均值,将所述平均值作为所述参考值;或根据相邻两帧原始图像各自对应的目标图像中像素点的灰度值,确定两个目标图像中相同位置的像素点之间灰度值差值;对确定出的灰度值差值进行排序,将位于预设位置的灰度值差值作为所述参考值。
- 如权利要求11所述的电子设备,所述处理器被配置为执行从所述目标图像对应的灰度通道中获取每个像素点的灰度值;或根据所述目标图像对应的颜色通道的数值确定每个像素点的灰度值。
- 一种存储介质,当所述存储介质中的指令由场景切换的检测电子设备的处理器执行时,使得场景切换的检测电子设备能够执行权利要求1至5中任一项所述的场景切换的检测方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910836850.8 | 2019-09-05 | ||
| CN201910836850.8A CN110675371A (zh) | 2019-09-05 | 2019-09-05 | 一种场景切换的检测方法、装置、电子设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021042909A1 true WO2021042909A1 (zh) | 2021-03-11 |
Family
ID=69076013
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/104840 Ceased WO2021042909A1 (zh) | 2019-09-05 | 2020-07-27 | 一种场景切换的检测方法、装置、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110675371A (zh) |
| WO (1) | WO2021042909A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115243045A (zh) * | 2022-05-30 | 2022-10-25 | 广州柯维新数码科技有限公司 | 基于视频场景识别应用帧相似性的视频编码方法 |
| WO2022247066A1 (en) * | 2021-05-22 | 2022-12-01 | Qualcomm Incorporated | High dynamic range scene cut detection |
| WO2024238807A2 (en) | 2023-05-16 | 2024-11-21 | Affinia Therapeutics Inc. | Recombinant aavs with improved tropism and specificity |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110675371A (zh) * | 2019-09-05 | 2020-01-10 | 北京达佳互联信息技术有限公司 | 一种场景切换的检测方法、装置、电子设备及存储介质 |
| CN111401165A (zh) * | 2020-03-06 | 2020-07-10 | Tcl华星光电技术有限公司 | 台标的萃取方法、显示装置以及计算机可读存储介质 |
| CN114650413B (zh) * | 2020-12-21 | 2026-02-10 | 北京小米移动软件有限公司 | 频闪检测方法及装置 |
| CN112995666B (zh) * | 2021-02-22 | 2022-04-22 | 天翼爱音乐文化科技有限公司 | 一种结合场景切换检测的视频横竖屏转换方法及装置 |
| CN113516050A (zh) * | 2021-05-19 | 2021-10-19 | 江苏奥易克斯汽车电子科技股份有限公司 | 基于深度学习的场景变换检测方法及装置 |
| CN114302174B (zh) * | 2021-12-31 | 2025-02-11 | 上海爱奇艺新媒体科技有限公司 | 视频剪辑方法、装置、计算设备及存储介质 |
| CN115278298A (zh) * | 2022-07-20 | 2022-11-01 | 北京卡拉卡尔科技股份有限公司 | 一种视频的自动分段方法 |
| CN116679080B (zh) * | 2023-05-30 | 2024-10-01 | 广州伏羲智能科技有限公司 | 一种河流表面流速确定方法、装置及电子设备 |
| CN116977332A (zh) * | 2023-09-21 | 2023-10-31 | 合肥联宝信息技术有限公司 | 摄像头补光灯性能测试方法、装置、电子设备及存储介质 |
| CN119762385A (zh) * | 2023-09-28 | 2025-04-04 | 荣耀终端股份有限公司 | 一种纹理增强方法及电子设备 |
| CN119766978A (zh) * | 2023-09-28 | 2025-04-04 | 荣耀终端股份有限公司 | 一种色彩增强方法及电子设备 |
| CN118097192B (zh) * | 2024-04-23 | 2024-07-19 | 深圳妙月科技有限公司 | 一种基于云边协同的网关数据处理方法及系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030112874A1 (en) * | 2001-12-19 | 2003-06-19 | Moonlight Cordless Ltd. | Apparatus and method for detection of scene changes in motion video |
| CN101909511A (zh) * | 2008-01-09 | 2010-12-08 | 奥林巴斯株式会社 | 场景变化检测装置以及场景变化检测程序 |
| CN102685509A (zh) * | 2012-04-26 | 2012-09-19 | 中山大学 | 一种基于场景转换的视频差错控制方法 |
| CN108804980A (zh) * | 2017-04-28 | 2018-11-13 | 合信息技术(北京)有限公司 | 视频场景切换检测方法及装置 |
| CN110675371A (zh) * | 2019-09-05 | 2020-01-10 | 北京达佳互联信息技术有限公司 | 一种场景切换的检测方法、装置、电子设备及存储介质 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8379911B2 (en) * | 2010-12-10 | 2013-02-19 | Infosys Technologies Limited | Method and system for efficient watermarking of video content |
| CN106210767B (zh) * | 2016-08-11 | 2020-01-07 | 上海交通大学 | 一种智能提升运动流畅性的视频帧率上变换方法及系统 |
| CN106851049B (zh) * | 2017-03-06 | 2019-07-02 | 济南中维世纪科技有限公司 | 一种基于视频分析的场景变更检测方法及装置 |
-
2019
- 2019-09-05 CN CN201910836850.8A patent/CN110675371A/zh active Pending
-
2020
- 2020-07-27 WO PCT/CN2020/104840 patent/WO2021042909A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030112874A1 (en) * | 2001-12-19 | 2003-06-19 | Moonlight Cordless Ltd. | Apparatus and method for detection of scene changes in motion video |
| CN101909511A (zh) * | 2008-01-09 | 2010-12-08 | 奥林巴斯株式会社 | 场景变化检测装置以及场景变化检测程序 |
| CN102685509A (zh) * | 2012-04-26 | 2012-09-19 | 中山大学 | 一种基于场景转换的视频差错控制方法 |
| CN108804980A (zh) * | 2017-04-28 | 2018-11-13 | 合信息技术(北京)有限公司 | 视频场景切换检测方法及装置 |
| CN110675371A (zh) * | 2019-09-05 | 2020-01-10 | 北京达佳互联信息技术有限公司 | 一种场景切换的检测方法、装置、电子设备及存储介质 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2022247066A1 (en) * | 2021-05-22 | 2022-12-01 | Qualcomm Incorporated | High dynamic range scene cut detection |
| CN115243045A (zh) * | 2022-05-30 | 2022-10-25 | 广州柯维新数码科技有限公司 | 基于视频场景识别应用帧相似性的视频编码方法 |
| WO2024238807A2 (en) | 2023-05-16 | 2024-11-21 | Affinia Therapeutics Inc. | Recombinant aavs with improved tropism and specificity |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110675371A (zh) | 2020-01-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021042909A1 (zh) | 一种场景切换的检测方法、装置、电子设备及存储介质 | |
| CN112669344B (zh) | 一种运动物体的定位方法、装置、电子设备及存储介质 | |
| US9704017B2 (en) | Image processing device, program, image processing method, computer-readable medium, and image processing system | |
| US12249137B2 (en) | Image analysis and processing pipeline with real-time feedback and autocapture capabilities, and visualization and configuration system | |
| CN108596128B (zh) | 对象识别方法、装置及存储介质 | |
| CN108764352B (zh) | 重复页面内容检测方法和装置 | |
| JP2011188496A (ja) | 逆光検知装置及び逆光検知方法 | |
| JP4373840B2 (ja) | 動物体追跡方法、動物体追跡プログラムおよびその記録媒体、ならびに、動物体追跡装置 | |
| CN103761527A (zh) | 检测画面中是否存在标志的设备及方法 | |
| CN110909568A (zh) | 用于面部识别的图像检测方法、装置、电子设备及介质 | |
| US9082019B2 (en) | Method of establishing adjustable-block background model for detecting real-time image object | |
| US20110221927A1 (en) | Image processing apparatus, image processing method and program | |
| CN104573675A (zh) | 作业图像的展示方法和装置 | |
| CN106502533A (zh) | 一种截屏方法及装置 | |
| CN105869148A (zh) | 目标检测方法及装置 | |
| JPWO2017081839A1 (ja) | 移動体追跡方法、移動体追跡装置、およびプログラム | |
| CN113516609A (zh) | 分屏视频检测方法、装置、计算机设备和存储介质 | |
| JP5027201B2 (ja) | テロップ文字領域検出方法,テロップ文字領域検出装置およびテロップ文字領域検出プログラム | |
| CN111583341A (zh) | 云台像机移位检测方法 | |
| US11132778B2 (en) | Image analysis apparatus, image analysis method, and recording medium | |
| CN106469432A (zh) | 对象提取方法和对象提取设备 | |
| KR102438076B1 (ko) | 주차 구역 감지 방법 및 장치 | |
| CN106951831A (zh) | 一种基于深度摄像机的行人检测跟踪方法 | |
| EP4258654A1 (en) | Method and device for acquiring an image, software and image signal processing device | |
| US8538142B2 (en) | Face-detection processing methods, image processing devices, and articles of manufacture |
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: 20860327 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: 20860327 Country of ref document: EP Kind code of ref document: A1 |



