Scene change detection method and apparatus, storage medium, and electronic device

By analyzing the spectral data and illumination changes of the target frame image, the problem of low accuracy in scene change detection is solved, and more efficient scene change detection is achieved.

CN115311600BActive Publication Date: 2025-12-05GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210939274.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-05
Publication Date
2025-12-05
Estimated Expiration
2042-08-05

AI Technical Summary

Technical Problem

Existing technologies for scene change detection have low accuracy and low efficiency, making it difficult to capture scene changes that are small or insignificant.

Method used

By acquiring spectral data from multiple first sub-regions of the target frame image, analyzing the illumination data, and combining this with the change in illumination data of the corresponding sub-regions of the reference frame image, the scene change detection result is determined.

Benefits of technology

It improves the accuracy of illumination data and scene change detection, enhances detection efficiency, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115311600B_ABST
    Figure CN115311600B_ABST
Patent Text Reader

Abstract

The present disclosure provides a scene change detection method and device, a storage medium and an electronic device, and relates to the technical field of computer vision. The scene change detection method comprises the following steps: obtaining a target frame image and spectral data of a plurality of first sub-regions in the target frame image; obtaining illumination data of the first sub-regions by analyzing the spectral data of the first sub-regions; obtaining illumination data of a plurality of second sub-regions in a reference frame image; the second sub-regions have a corresponding relationship with the first sub-regions; and determining a scene change detection result of the target frame image compared with the reference frame image according to an illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions. The present disclosure improves the scene change detection accuracy and improves the scene change detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer vision technology, and in particular to a scene change detection method, a scene change detection device, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Scene change detection refers to detecting whether the scene in an image or video has changed. It is often used in scenarios such as autofocus and video segmentation.

[0003] Among related technologies, scene change detection has low accuracy and low efficiency. Summary of the Invention

[0004] This disclosure provides a scene change detection method, a scene change detection device, a computer-readable storage medium, and an electronic device, thereby improving the problem of low accuracy in scene change detection to at least a certain extent.

[0005] According to a first aspect of this disclosure, a scene change detection method is provided, comprising: acquiring a target frame image and spectral data of a plurality of first sub-regions in the target frame image; obtaining illumination data of the first sub-regions by parsing the spectral data of the first sub-regions; acquiring illumination data of a plurality of second sub-regions in a reference frame image; wherein the second sub-regions correspond to the first sub-regions; and determining a scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-regions and the illumination data of the second sub-regions.

[0006] According to a second aspect of this disclosure, a scene change detection device is provided, comprising: a spectral data acquisition module configured to acquire spectral data of a target frame image and a plurality of first sub-regions in the target frame image; a spectral data parsing module configured to obtain illumination data of the first sub-regions by parsing the spectral data of the first sub-regions; an illumination data acquisition module configured to acquire illumination data of a plurality of second sub-regions in a reference frame image; wherein the second sub-regions correspond to the first sub-regions; and a scene detection module configured to determine a scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-regions and the illumination data of the second sub-regions.

[0007] According to a third aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the scene change detection method of the first aspect described above and its possible implementations.

[0008] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor. The processor is configured to execute the scene change detection method of the first aspect and its possible implementations by executing the executable instructions.

[0009] The technical solution disclosed herein has the following beneficial effects:

[0010] On the one hand, by analyzing the spectral data of multiple first sub-regions in the target frame image to obtain the illumination data of the first sub-regions, the target frame image is divided into multiple first sub-regions to obtain illumination data, which improves the accuracy of the obtained illumination data and is beneficial to improving the accuracy of scene change detection. On the other hand, the scene change detection result of the target frame image compared with the reference frame image is determined based on the amount of change in illumination data between the first sub-region of the target frame image and the second sub-region of the reference frame image. The scene change detection result of the target frame image is determined based on the amount of change in illumination data of the sub-regions of the target frame image, which improves the accuracy of scene change detection, increases the efficiency of scene change detection, and improves the user experience. Attached Figure Description

[0011] Figure 1 This illustrates the system architecture of the operating environment for this exemplary embodiment;

[0012] Figure 2 This diagram illustrates a scene change detection method according to an exemplary embodiment of the present invention.

[0013] Figure 3 This illustration shows a schematic diagram of dividing a target frame image into a 3×3 array according to an exemplary embodiment of the present invention;

[0014] Figure 4 This diagram illustrates a process for acquiring changes in infrared data of a target frame image in this exemplary embodiment.

[0015] Figure 5 This illustrates a flowchart of a method for determining scene change detection results of a first sub-region based on changes in infrared data of that first sub-region, as described in this exemplary embodiment.

[0016] Figure 6 This diagram illustrates a process for acquiring the change in the AC light source component of a target frame image according to an exemplary embodiment of the present invention.

[0017] Figure 7 This diagram illustrates a process for acquiring the color temperature change of a target frame image in this exemplary embodiment.

[0018] Figure 8 This diagram illustrates a process for acquiring the brightness change of a target frame image in this exemplary embodiment.

[0019] Figure 9 This diagram illustrates a process in this exemplary embodiment of determining whether to refocus based on scene change detection results of a target frame image;

[0020] Figure 10 This diagram illustrates a scene change detection method according to an exemplary embodiment of the present invention.

[0021] Figure 11 This diagram illustrates the structure of a scene change detection device according to this exemplary embodiment.

[0022] Figure 12 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0023] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.

[0024] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.

[0025] In related technologies, scene change detection is usually performed based on the entire frame image, which makes it difficult to capture scenes with small or inconspicuous changes, reducing the accuracy of scene change detection and resulting in low scene change detection efficiency.

[0026] In view of one or more of the above-mentioned problems, this disclosure first provides a scene change detection method through exemplary embodiments. The following describes a method for detecting scene changes. Figure 1 The system architecture of the operating environment for this exemplary embodiment will be described.

[0027] refer to Figure 1As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be an electronic device such as a smartphone, tablet, or camera, and can be used to acquire a target frame image and spectral data of multiple first sub-regions within the target frame image. The server 120 generally refers to a backend system that provides scene change detection related services in this exemplary embodiment, such as a server implementing the scene change detection method. The server 120 may be a single server or a cluster of multiple servers; this disclosure does not limit this. The terminal device 110 and the server 120 can be connected via a wired or wireless communication link for data interaction.

[0028] In one embodiment, the scene change detection method in this exemplary embodiment can be executed by the terminal device 110. For example, in a camera autofocus scenario, the terminal device 110 can be a smartphone with a camera function. During the process of taking a picture with the smartphone, the scene captured by the camera and displayed on the smartphone can be used as the target frame image. The terminal device 110 can obtain the scene change detection result of the target frame image by executing the scene change detection method, and determine whether to perform autofocus based on the scene change result, so as to present a clearer picture to the user, thereby improving the clarity of the captured image and improving the user experience.

[0029] In one implementation, the terminal device 110 first acquires the target frame image and the spectral data of multiple first sub-regions in the target frame image, and then pushes the spectral data of the multiple first sub-regions to the server 120. After receiving the spectral data of the multiple sub-regions in the target frame image, the server 120 parses the spectral data of the first sub-regions to obtain the illumination data of the first sub-regions. Then, it acquires the illumination data of multiple second sub-regions in the reference frame image, wherein the second sub-regions correspond to the first sub-regions. Finally, based on the amount of change in illumination data between the illumination data of the first sub-regions and the illumination data of the second sub-regions, the scene change detection result of the target frame image compared to the reference frame image is determined.

[0030] As can be seen from the above, the scene change detection method in this exemplary embodiment can be executed by the terminal device 110 or the server 120.

[0031] The following is combined Figure 2 The method for detecting scene changes is explained. Figure 2 An exemplary flow of a scene change detection method is shown, including the following steps S210 to S240:

[0032] Step S210: Obtain the target frame image and the spectral data of multiple first sub-regions in the target frame image;

[0033] Step S220: Obtain the illumination data of the first sub-region by analyzing the spectral data of the first sub-region;

[0034] Step S230: Obtain illumination data of multiple second sub-regions in the reference frame image; the second sub-regions correspond to the first sub-regions;

[0035] Step S240: Based on the amount of change in illumination data between the first sub-region and the second sub-region, determine the scene change detection result of the target frame image compared to the reference frame image.

[0036] Based on the above method, on the one hand, the spectral data of multiple first sub-regions in the target frame image are analyzed to obtain the illumination data of the first sub-regions. Dividing the target frame image into multiple first sub-regions to obtain illumination data improves the accuracy of the obtained illumination data, which is beneficial to improving the accuracy of scene change detection. On the other hand, the scene change detection result of the target frame image compared with the reference frame image is determined based on the change in illumination data between the first sub-region of the target frame image and the second sub-region of the reference frame image. The scene change detection result of the target frame image is determined based on the change in illumination data of the sub-regions of the target frame image, which improves the accuracy of scene change detection, increases the efficiency of scene change detection, and improves the user experience.

[0037] The following is about Figure 2 Each step in the process will be explained in detail.

[0038] refer to Figure 2 In step S210, the target frame image and the spectral data of multiple first sub-regions in the target frame image are acquired;

[0039] In one embodiment, the target frame image may include a currently captured image or a currently previewed image of the terminal device 110; the first sub-region may be a local region of the target frame image. This disclosure does not specifically limit the size, shape, or number of the first sub-region; for example, it may be arranged as follows: Figure 3 The 3×3 arrangement shown divides the target frame image into 9 first sub-regions. The spectral data can be the spectral distribution data of multiple first sub-regions in the target frame image. This disclosure does not make any special limitation on the specific content and acquisition method of the spectral data. In one embodiment, the spectral data can include monospectral data and multispectral data.

[0040] Since traditional RGGB type sensors can only provide spectral data in three bands (R, G, and B), while spectral sensors can provide spectral data in multiple bands, in one embodiment, spectral sensors can be used to acquire the spectral data of the target frame image. In this exemplary embodiment, K groups of spectral sensors can be arranged in an M×N array, where M represents the number of rows and N represents the number of columns, so K = M×N; each spectral sensor corresponds to a detection window, and each detection window corresponds to a first sub-region in the target frame image. Therefore, K spectral sensors can divide the target frame image into K detection windows, and the K detection windows correspond to K first sub-regions in the target frame image.

[0041] For example, if M=3 and N=3, then the terminal device 110 may include nine spectral sensors to acquire spectral data of a first sub-region of the target frame image. These nine spectral sensors can divide the target frame image into nine detection windows, such as... Figure 3 As shown, the nine detection windows can correspond to nine sub-regions in the target frame image.

[0042] Table 1 shows the peak wavelength and full width at half maximum (FWHM) of the 12-channel spectral sensor. The 12 channels indicate that the spectral sensor can acquire spectral data in 12 different bands, covering 12 important bands in the range of 350–1000 nm.

[0043] Table 1

[0044]

[0045]

[0046] In this exemplary embodiment, by acquiring spectral data of different bands in the target frame image based on multiple spectral sensors, very rich spectral data can be obtained, which is beneficial to improving the accuracy of the entire scene change detection process.

[0047] Continue to refer to Figure 2 In step S220, the illumination data of the first sub-region is obtained by analyzing the spectral data of the first sub-region.

[0048] The illumination data may include one or more light source attribute data. This disclosure does not specifically limit the type of illumination data. For example, illumination data may include infrared data, color temperature, brightness data, brightness information in automatic exposure, etc. The spectral data of the first sub-region is analyzed to obtain the illumination data of the first sub-region. Since the first sub-region is a local region in the target frame image, the illumination data obtained by analyzing the spectral data of the local region can reflect the light source attributes of the region in more detail, so as to detect subtle scene changes and improve the accuracy of scene change detection.

[0049] In one embodiment, the illumination data includes infrared data, and obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region may include the following steps:

[0050] The infrared data of the first sub-region is obtained by removing visible light data from the spectral data of the first sub-region; or the infrared response data of the first sub-region is extracted from the spectral data of the first sub-region.

[0051] Infrared data can include the energy response of the infrared band in the spectral data. Since different light sources (such as sunlight, incandescent lamps, and fluorescent lamps) have different energy responses in the infrared band, the type of light source in the first sub-region can be determined to a certain extent by detecting infrared data.

[0052] In this exemplary embodiment, two methods for acquiring infrared data are provided. For spectral sensors that cannot directly acquire infrared data, visible light data can be removed from the spectral data of the first sub-region to obtain the infrared data of the first sub-region. For example, infrared data can be extracted according to the following formula:

[0053] IR = (2.7WC) / C

[0054] Wherein, IR can represent the infrared data mentioned above, W can be the full spectrum data, and C can include the visible light data.

[0055] In this exemplary embodiment, for a spectral sensor capable of acquiring infrared data, response data of the infrared band can be extracted from the spectral data of the first sub-region to obtain infrared data of the first sub-region. For example, response data of the NIR (Near Infrared) band in the spectral data can be extracted to obtain infrared data.

[0056] The method described above for obtaining analytical spectral data to obtain infrared data for the first sub-region can improve the accuracy of infrared data acquisition, thereby accurately reflecting the proportion of natural light sources in the first sub-region, and thus improving the scene change detection efficiency of the target frame image.

[0057] In one embodiment, the illumination data includes an AC light source component, and obtaining the illumination data of the first sub-region by analyzing the spectral data of the first sub-region may include the following steps:

[0058] The AC light source component of the first sub-region is determined based on the light source frequency information in the spectral data.

[0059] The AC light source component refers to the proportion of light sources driven by alternating current (AC) among all light sources. Artificial light sources are typically driven by AC and are therefore AC light sources, while natural light can be considered a direct current (DC) light source. Therefore, the AC light source component reflects the composition of the light source. This disclosure does not impose any special limitations on the method for determining the AC light source component based on the light source frequency information. For example, the AC light source component can be calculated using the following formula:

[0060] Ac_ratio=MAX(flicker_fre_mag1, flicker_fre_mag2) / (128ave_flicker_channel)

[0061] Here, Ac_ratio can represent the AC light source component, fliker_fre_mag1 and fliker_fre_mag2 can represent the light source frequency, which can be calculated based on the changes in spectral data over a period of time, and 128ave_flicker_channel represents the average value of the light source frequency.

[0062] The AC light source component in the spectral data obtained based on the light source frequency information can be used to obtain the proportion of natural light source in the first sub-region. Dividing the target frame image into multiple first sub-regions and extracting the AC light source component can improve the accuracy of obtaining the AC light source component in each sub-region, thereby more accurately reflecting the proportion of natural light source in the first sub-region.

[0063] Since both infrared data and AC light source components can reflect the type of light source in the first sub-region, the changes in the type of light source in the first sub-region can be determined based on the changes in the infrared data and AC light source components in the first sub-region. Thus, it can be concluded that the type of light source in the first sub-region is one or more of indoor light and outdoor natural light.

[0064] In one embodiment, the illumination data includes color temperature, and obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region may include the following steps:

[0065] The color temperature of the first sub-region is determined by analyzing the response data of the visible light band in the spectral data of the first sub-region.

[0066] Color temperature is a unit of measurement that represents the color components contained in light. Therefore, the color component information of the first sub-region can be obtained based on the color temperature of the first sub-region. This disclosure does not impose any special limitation on the method of obtaining the color temperature of the first sub-region. For example, the color temperature of the first sub-region can be obtained by analyzing the visible light band in the spectral data through an AI (Artificial Intelligence) model.

[0067] In one embodiment, the illumination data includes brightness data, and the method of obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region may include:

[0068] The response data of the visible light band in the spectral data of the first sub-region is mapped to the XYZ color space to obtain the response data of the XYZ color space. The brightness data of the first sub-region is determined based on the response data of the XYZ color space.

[0069] In this exemplary embodiment, the response data of the visible light band in the spectral data can be mapped to the XYZ color space using a color correction matrix to obtain the response data of the first sub-region in the XYZ color space. This disclosure does not specifically limit the specific content of the color correction matrix. For example, when the response data of the visible light band in the spectral data is the response data of the first sub-region in the RGB color space, the response data of the first sub-region in the XYZ color space can be determined based on the convolution result of the gamma transform of the response data in the RGB color space and the color correction matrix. After obtaining the response data in the XYZ color space, the luminance data of the first sub-region can be determined based on the response data in the XZY color space. This disclosure does not specifically limit the specific representation method of the luminance data of the first sub-region. For example, the luminance data can be represented by illuminance, and the luminance data of the first sub-region can be determined based on the level of Lux in the response data of the first sub-region in the XYZ color space.

[0070] Since the XYZ color space can reflect the standard response of the human eye to monochromatic light of different wavelengths, it can show the spectral power distribution response of the long, medium and short photoreceptor cone cells of the retina to light. The method described above for determining brightness data based on the response data of the first sub-region in the XYZ color space can quantify the human eye's perception of image brightness to obtain the human eye's perception of brightness in the first target frame image.

[0071] After obtaining the illumination information of the first sub-region in the target frame image, continue to refer to Figure 2 In step S230, illumination data of multiple second sub-regions in the reference frame image can be obtained; the second sub-regions correspond to the aforementioned first sub-regions.

[0072] The reference frame image provides reference information for scene change detection of the target frame image. For example, in an autofocus scene, the reference frame image can be the image after the last autofocus was completed, or it can be the previous frame image of the target frame image. The second sub-region can be a local region in the reference frame image corresponding to the first sub-region. For example, if the target frame image is divided into 9 first sub-regions in a 3×3 array, then the second sub-region can include the 9 sub-regions obtained by dividing the reference frame image into a 3×3 array.

[0073] The illumination data of the second sub-region may include the infrared component, AC light source component, color temperature and brightness data of the second sub-region. This disclosure does not impose any special limitation on the method of obtaining the illumination data of the second sub-region. For example, the illumination data of the second sub-region can be cached by caching the illumination data obtained when performing scene change detection on the reference frame image. Then, when performing scene change detection on the target frame image, the illumination data of the second sub-region can be directly obtained from the cache area to reduce repeated steps and improve the overall efficiency of scene change detection.

[0074] After obtaining the illumination data of the target frame image and the reference frame image, continue with the reference... Figure 2 In step S240, the scene change detection result of the target frame image compared with the reference frame image can be determined based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region.

[0075] The change in illumination data is a comparison between the illumination data of the first sub-region and the illumination data of the second sub-region. This disclosure does not impose any special limitation on the method of obtaining the change in illumination data. For example, the change in illumination data may include the difference between the illumination data of the first sub-region and the illumination data of the second sub-region; it may also include the ratio of the difference between the illumination data of the first sub-region and the illumination data of the second sub-region to the illumination data of the first sub-region; or the difference between the illumination data of the first sub-region and the illumination data of the corresponding sub-region in the previous frame image may be denoted as minusA, and the difference between the illumination data of the first sub-region and the second sub-region in the reference frame image may be denoted as minusB. In this case, the change in illumination data may be the ratio of minusA to minusB.

[0076] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include the following steps:

[0077] The difference between the infrared data of the first sub-region and the infrared data of the second sub-region is obtained to determine the change in the infrared data of the first sub-region.

[0078] If the change in infrared data is greater than the threshold for the change in infrared data, it is determined that the scene has changed in the first sub-region compared to the second sub-region.

[0079] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0080] The infrared data change threshold can be used as a basis for determining whether the infrared data in the first sub-region has changed. This disclosure does not impose any special limitations on the acquisition method and specific value of the infrared data change threshold. For example, the infrared data change threshold can be obtained by experimental measurement. For example, the infrared data before and after different scene changes can be collected multiple times by controlling a single variable to obtain multiple infrared data changes. Then, the average value of the multiple infrared data changes is calculated and used as the infrared data change threshold.

[0081] First, the difference between the infrared data of the first sub-region and the infrared data of the second sub-region is obtained as the change in infrared data of the first sub-region. Taking a 3×3 array as an example, refer to... Figure 4 As shown, each first sub-region and each second sub-region contains infrared data. The change in infrared data between the target frame image and the reference frame image can be calculated using the following formula:

[0082] IR_Di = IR_Ci - IR_Ri

[0083] Where i is a positive integer, is the index of the sub-region, IR_Ci is the infrared data of the i-th first sub-region in the target frame image, IR_Ri is the infrared data of the i-th second sub-region in the reference frame image, and IR_Di is the change in the infrared data of the i-th first sub-region.

[0084] In this exemplary embodiment, the process of determining the scene change between the first sub-region and the second sub-region can be referred to Figure 5 As shown, in step S510, after obtaining the change in infrared data of the first sub-region, it can be determined in step S520 whether the change in infrared data of the first sub-region is greater than the infrared data change threshold. If so, the process jumps to step S530; otherwise, it jumps to step S540. In step S530, if the change in infrared data is greater than the infrared data change threshold, it is determined that the scene of the first sub-region has changed compared to the second sub-region. In step S540, it is determined that the infrared data of the first sub-region has not changed compared to the second sub-region.

[0085] For example, if the change in infrared data IR_Di of the first sub-region is greater than the infrared data change threshold IR_threshold, it can be considered that the light source of the first sub-region has changed. For example, the first sub-region has undergone an indoor scene change or an indoor / outdoor light source change, thus determining that the first sub-region has a scene change compared to the second sub-region.

[0086] After obtaining the scene change detection results of the first sub-region, it is possible to determine whether the target frame image has undergone scene changes compared to the reference frame image based on whether scene changes have occurred in each of the first sub-regions in the target frame image.

[0087] In one implementation, the number of first sub-regions where scene changes occur can be determined based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region; when the number of first sub-regions exceeds a threshold, it is determined that the target frame image has undergone scene changes compared to the reference frame image.

[0088] The quantity threshold can be used as a basis for determining whether the scene has changed compared to the reference frame image. This disclosure does not impose any special limitation on the specific value of the quantity threshold. For example, the quantity threshold can be 1, or it can be a value obtained by rounding up 50% of the number of the first sub-regions.

[0089] For example, if the target frame image is divided into 9 first sub-regions in a 3×3 array and the number threshold is 1, then when the change in infrared data of the i-th first sub-region in the target frame image is greater than the infrared data change threshold, it can be determined that the i-th first sub-region has a scene change compared to the i-th second sub-region, thus determining that the target frame image has a scene change relative to the reference frame image.

[0090] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include the following steps:

[0091] The difference between the AC light source component of the first sub-region and the AC light source component of the second sub-region is obtained to obtain the change in the AC light source component of the first sub-region.

[0092] If the change in the AC light source component is greater than the threshold for the change in the AC light source component, it is determined that the scene has changed in the first sub-region compared to the second sub-region.

[0093] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0094] The threshold for the change in AC light source components can be used as a basis for determining whether the AC light source components in the first sub-region have changed. This disclosure does not impose any special limitations on the acquisition method or specific value of the threshold for the change in AC light source components. For example, the threshold for the change in AC light source components can be obtained by experimental measurement. For example, the AC light source components before and after changes in different scenes can be collected multiple times by controlling a single variable to obtain multiple changes in AC light source components. Then, the average value of the multiple changes in AC light source components is calculated, and the average value is used as the threshold for the change in AC light source components.

[0095] In this exemplary embodiment, the difference between the AC light source components of the first sub-region and the second sub-region can first be obtained to obtain the change in the AC light source components of the first sub-region; taking a 3×3 array as an example, refer to... Figure 6 As shown, each first sub-region and each second sub-region contains infrared data. The change in the AC light source component of the target frame image compared to the reference frame image can be calculated using the following formula:

[0096] Ac_ratio_Di=Ac_ratio_Ci-Ac_ratio_Ri

[0097] Where i is a positive integer, is the index of the sub-region, Ac_ratio_Ci is the AC light source component of the i-th first sub-region in the target frame image, Ac_ratio_Ri is the AC light source component of the i-th second sub-region in the reference frame image, and Ac_ratio_Di is the change in the AC light source component of the i-th first sub-region.

[0098] Similar to the process described above for determining whether a scene change has occurred in the first sub-region based on infrared data, after obtaining the change in the AC light source component, if the change in the AC light source component is greater than the threshold for the change in the AC light source component, it can be determined that a scene change has occurred in the first sub-region compared to the second sub-region; otherwise, it is determined that the AC light source component of the first sub-region has not changed compared to the second sub-region.

[0099] For example, if the change in the AC light source component Ac_ratio_Di of the first sub-region is greater than the AC light source component change threshold Ac_ratio_threshold, then it can be considered that the light source of the first sub-region has changed, thus determining that the scene of the first sub-region has changed compared to the second sub-region.

[0100] After obtaining the scene change detection results for the first sub-region, it can be determined whether the target frame image has undergone a scene change compared to the reference frame image based on whether scene changes have occurred in each of the first sub-regions in the target frame image. For example, if the target frame image is divided into 9 first sub-regions using a 3×3 array, and the number threshold is 5, then if the change in the AC light source component of 5 first sub-regions in the target frame image is greater than the AC light source component change threshold, it can be determined that these 5 first sub-regions have undergone a scene change compared to the corresponding 5 second sub-regions, thus determining that the target frame image has undergone a scene change relative to the reference frame image.

[0101] Both the infrared data and the AC light source component can characterize the changes in light source in the target frame image. Based on the comparison results of the infrared data change amount and the infrared data change amount threshold, or the comparison results of the AC light source component change amount and the AC light source component change amount threshold, it can be determined whether there has been a change in light source such as switching from an indoor scene to an outdoor scene, or switching from an outdoor scene to an indoor scene, or a change in indoor and outdoor light sources.

[0102] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include the following steps:

[0103] Obtain the difference between the color temperature of the first sub-region and the color temperature of the second sub-region to obtain the amount of color temperature change in the first sub-region;

[0104] If the color temperature change is greater than the color temperature change threshold, it is determined that the first sub-region has undergone a scene change compared to the second sub-region.

[0105] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0106] The color temperature change threshold can be used as a basis for determining whether the color temperature in the first sub-region has changed. This disclosure does not impose any special limitations on the acquisition method and specific value of the color temperature change threshold. For example, the color temperature change threshold can be obtained by experimental measurement. For example, the color temperature before and after the change in different scenes can be collected multiple times by controlling a single variable to obtain multiple color temperature change values. Then, the maximum value of the color temperature change value among the multiple color temperature change values ​​can be selected as the color temperature change threshold.

[0107] In this exemplary embodiment, the color temperature difference between the first sub-region and the second sub-region can first be obtained to obtain the color temperature change of the first sub-region. Taking a 3×3 array as an example, refer to... Figure 7As shown, each first sub-region and each second sub-region contains color temperature. The color temperature change of the target frame image compared to the reference frame image can be calculated using the following formula:

[0108] CCT_Di=CCT_Ci-CCT_Ri

[0109] Where i is a positive integer, is the index of the sub-region, CCT_Ci is the color temperature of the i-th first sub-region in the target frame image, CCT_Ri is the color temperature of the i-th second sub-region in the reference frame image, and CCT_Di is the color temperature change of the i-th first sub-region.

[0110] After obtaining the color temperature change, if the color temperature change is greater than the color temperature change threshold, it can be determined that the first sub-region has undergone a scene change compared to the second sub-region; otherwise, it is determined that the color temperature of the first sub-region has not changed compared to the second sub-region. For example, if the color temperature change CCT_Di of the first sub-region is greater than the color temperature change threshold CCT_threshold, it can be considered that the color of the first sub-region has changed, thus determining that the first sub-region has undergone a scene change compared to the second sub-region.

[0111] After obtaining the scene change detection results for the first sub-region, it can be determined whether the target frame image has undergone a scene change compared to the reference frame image based on whether scene changes have occurred in each of the first sub-regions in the target frame image. For example, if the target frame image is divided into 9 first sub-regions using a 3×3 array, and the number threshold is 1, then if the color temperature change of the i-th first sub-region in the target frame image is greater than the color temperature change threshold, it can be determined that the i-th first sub-region has undergone a scene change compared to the i-th second sub-region, thus determining that the target frame image has undergone a scene change relative to the reference frame image.

[0112] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include the following steps:

[0113] The difference between the brightness data of the first sub-region and the brightness data of the second sub-region is obtained to obtain the brightness change of the first sub-region;

[0114] If the brightness change is greater than the brightness change threshold, it is determined that the first sub-region has undergone a scene change compared to the second sub-region.

[0115] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0116] The brightness change threshold can be used as a basis for determining whether the brightness in the first sub-region has changed. This disclosure does not impose any special limitations on the acquisition method and specific value of the brightness change threshold. For example, the brightness change threshold can be obtained by experimental measurement. For example, the brightness before and after different scene changes can be collected multiple times by controlling a single variable to obtain multiple brightness change values, and then the maximum value of the brightness change value among the multiple brightness change values ​​can be selected as the brightness change threshold.

[0117] In this exemplary embodiment, the difference between the brightness data of the first sub-region and the brightness data of the second sub-region can first be obtained to obtain the brightness change of the first sub-region. Taking a 3×3 array as an example, refer to... Figure 8 As shown, when the brightness data includes illuminance information, the brightness change of the target frame image compared to the reference frame image can be calculated using the following formula:

[0118] Lux_Di = Lux_Ci - Lux_Ri

[0119] Where i is a positive integer, is the index of the sub-region, Lux_Ci is the brightness data of the i-th first sub-region in the target frame image, Lux_Ri is the brightness data of the i-th second sub-region in the reference frame image, and Lux_Di is the brightness change of the i-th first sub-region.

[0120] After obtaining the brightness change amount, if the brightness change amount is greater than the brightness change amount threshold, it can be determined that the scene of the first sub-region has changed compared to the second sub-region; otherwise, it is determined that the brightness data of the first sub-region has not changed compared to the second sub-region. For example, if the brightness change amount Lux_Di of the first sub-region is greater than the brightness change amount threshold Lux_threshold, it can be considered that the brightness of the first sub-region has changed, thus determining that the scene of the first sub-region has changed compared to the second sub-region.

[0121] After obtaining the scene change detection results for the first sub-region, it can be determined whether the target frame image has undergone a scene change compared to the reference frame image based on whether scene changes have occurred in each of the first sub-regions in the target frame image. For example, if the target frame image is divided into 9 first sub-regions using a 3×3 array, and the number threshold is 1, then if the brightness change of the i-th first sub-region in the target frame image is greater than the brightness change threshold, it can be determined that the i-th first sub-region has undergone a scene change compared to the i-th second sub-region, thus determining that the target frame image has undergone a scene change relative to the reference frame image.

[0122] The above method determines the amount of change in illumination data by the difference between the illumination data of the first sub-region and the illumination data of the second sub-region, then determines the scene change detection result of the first sub-region based on the amount of change in illumination data, and finally determines whether the scene of the target frame image has changed compared to the reference frame image based on the scene change detection results of each first sub-region in the target frame image. The method uses the difference to determine the amount of change in illumination data, which has a small amount of computation, low computational complexity, and fast operation speed, which is beneficial to improving the speed of the entire scene change detection process.

[0123] After determining the scene change detection result of the target frame image, in one embodiment, the target frame image can be a currently captured image or a currently previewed image; the scene change method may further include the following steps:

[0124] If it is determined that the scene has changed compared to the reference frame image, then refocusing is performed.

[0125] The currently captured image or the currently previewed image can be the image displayed on the display module of the terminal device 110 before the camera is capturing the image and the shutter button is pressed.

[0126] The process of this exemplary embodiment can be referred to Figure 9 As shown, in step S910, the scene change detection result of the target frame image can be obtained. When any of the indoor and outdoor light source detection (including infrared data detection and AC light source component detection), color temperature detection, and brightness detection detects a change, it can be considered that the scene of the target frame image has changed, thereby triggering the autofocus algorithm to focus, so as to ensure that the currently presented image is clear.

[0127] Based on the above method, spectral data of different bands in multiple first sub-regions of the target frame image can be received by a spectral sensor. By detecting changes in indoor and outdoor light sources, color temperature, and brightness, it can be determined whether the scene has changed, and then whether to refocus. This enriches the detection basis for scene change detection, and can cope with more complex and changeable scenes in real life. While ensuring the accuracy of scene change detection, it improves the comprehensiveness of scene change detection methods, thereby improving the user experience.

[0128] In one implementation, gyroscope data can also be acquired during the process of the terminal capturing the reference frame image and the target frame image to obtain the change in gyroscope data between the target frame image and the reference frame image. By combining the change in gyroscope data and the change in illumination data, it can be determined whether the scene has changed.

[0129] For example, the gyroscope data during the process of capturing the reference frame image and the target frame image can be obtained according to the following formula, which can be used as the change in gyroscope data between the target frame image and the reference frame image:

[0130]

[0131] Among them, gyroSqr is the gyroscope data during the process of the terminal capturing the reference frame image and the target frame image, and x, y, and z represent the motion values ​​in the three directions of forward / backward, left / right, and up / down, respectively.

[0132] If the change in gyroscope data of the target frame image is greater than the motion distance threshold, and the change in illumination data of the target frame image is greater than the illumination data change threshold, then it can be determined that the scene of the target frame image has changed compared to the reference frame image.

[0133] In one implementation, an exemplary process of this disclosure is as follows: Figure 10 As shown in this exemplary embodiment, the aforementioned quantity threshold can be 1, and scene change detection can be performed according to steps S1001 to S1015:

[0134] Step S1001: Obtain the target frame image;

[0135] Step S1002: Acquire spectral data of multiple first sub-regions in the target frame image;

[0136] Step S1003: Obtain illumination data of multiple second sub-regions in the reference frame image;

[0137] Step S1004: Analyze the spectral data to obtain the illumination data of multiple first sub-regions in the target frame image;

[0138] Step S1005: Illumination data includes infrared data. The difference between the infrared data of the first sub-region and the infrared data of the second sub-region is obtained to obtain the change in infrared data of the first sub-region.

[0139] Step S1006: Does the change in infrared data in the first sub-region exceed the threshold for change in infrared data? If yes, proceed to step S1014; otherwise, proceed to step S1007.

[0140] Step S1007: The illumination data includes AC light source components. The difference between the AC light source components of the first sub-region and the AC light source components of the second sub-region is obtained to obtain the change in the AC light source components of the first sub-region.

[0141] Step S1008: Is the change in the AC light source component of the first sub-region greater than the threshold for the change in the AC light source component? If yes, proceed to step S1014; otherwise, proceed to step S1009.

[0142] Step S1009: The illumination data includes color temperature. The difference between the color temperature of the first sub-region and the color temperature of the second sub-region is obtained to obtain the color temperature change of the first sub-region.

[0143] Step S1010: Does the color temperature change in the first sub-region exceed the color temperature change threshold? If yes, proceed to step S1014; otherwise, proceed to step S1011.

[0144] Step S1011: The illumination data includes brightness data. The difference between the brightness data of the first sub-region and the brightness data of the second sub-region is obtained to obtain the brightness change of the first sub-region.

[0145] Step S1012: Does the brightness change of the first sub-region exceed the brightness change threshold? If yes, proceed to step S1014; otherwise, proceed to step S1013.

[0146] Step S1013: The first sub-region has no scene change compared to the second sub-region; Scene change detection is performed on the next first sub-region in the target frame image;

[0147] Step S1014: The scene changes in the first sub-region compared to the second sub-region;

[0148] Step S1015: The target frame image undergoes a scene change compared to the reference frame image.

[0149] Exemplary embodiments of this disclosure also provide a scene change detection device. For example... Figure 11 As shown, the scene change detection device 1100 may include:

[0150] The spectral data acquisition module 1110 is configured to acquire the spectral data of the target frame image and multiple first sub-regions in the target frame image;

[0151] The spectral data parsing module 1120 is configured to obtain the illumination data of the first sub-region by parsing the spectral data of the first sub-region;

[0152] The illumination data acquisition module 1130 is configured to acquire illumination data of multiple second sub-regions in a reference frame image; the second sub-regions correspond to the first sub-regions.

[0153] The scene detection module 1140 is configured to determine the scene change detection result of the target frame image compared with the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region.

[0154] In one embodiment, the illumination data includes infrared data, and the method of obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region may include:

[0155] Remove the visible light data from the spectral data of the first sub-region to obtain the infrared data of the first sub-region; or

[0156] The infrared response data of the first sub-region is extracted from the spectral data of the first sub-region to obtain the infrared data of the first sub-region.

[0157] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include:

[0158] The difference between the infrared data of the first sub-region and the infrared data of the second sub-region is obtained to determine the change in the infrared data of the first sub-region.

[0159] If the change in infrared data is greater than the threshold for the change in infrared data, it is determined that the scene has changed in the first sub-region compared to the second sub-region.

[0160] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0161] In one embodiment, the illumination data includes an AC light source component, and the method of obtaining the illumination data of the first sub-region by analyzing the spectral data of the first sub-region includes:

[0162] The AC light source component of the first sub-region is determined based on the light source frequency information in the spectral data.

[0163] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include:

[0164] The difference between the AC light source component of the first sub-region and the AC light source component of the second sub-region is obtained to obtain the change in the AC light source component of the first sub-region.

[0165] If the change in the AC light source component is greater than the threshold for the change in the AC light source component, it is determined that the scene has changed in the first sub-region compared to the second sub-region.

[0166] Based on whether scene changes occur in each first sub-region, it is determined whether the target frame image has undergone scene changes compared to the reference frame image.

[0167] In one embodiment, the illumination data includes color temperature, and the method of obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region includes:

[0168] The color temperature of the first sub-region is determined by analyzing the response data of the visible light band in the spectral data of the first sub-region.

[0169] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include:

[0170] The difference between the color temperature of the first sub-region and the color temperature of the second sub-region is obtained to determine the amount of color temperature change in the first sub-region.

[0171] If the color temperature change is greater than the color temperature change threshold, it is determined that the first sub-region has undergone a scene change compared to the second sub-region.

[0172] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0173] In one embodiment, the illumination data includes brightness data, and the method of obtaining the illumination data of the first sub-region by parsing the spectral data of the first sub-region includes:

[0174] The response data of the visible light band in the spectral data of the first sub-region is mapped to the XYZ color space to obtain the response data of the XYZ color space. The brightness data of the first sub-region is determined based on the response data of the XYZ color space.

[0175] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include:

[0176] The difference between the brightness data of the first sub-region and the brightness data of the second sub-region is obtained to obtain the brightness change of the first sub-region;

[0177] If the brightness change is greater than the brightness change threshold, it is determined that the first sub-region has undergone a scene change compared to the second sub-region;

[0178] Based on whether scene changes occur in each first sub-region, determine whether the target frame image has undergone scene changes compared to the reference frame image.

[0179] In one implementation, determining the scene change detection result of the target frame image compared to the reference frame image based on the amount of change in illumination data between the illumination data of the first sub-region and the illumination data of the second sub-region may include:

[0180] The number of first sub-regions where scene changes occur is determined based on the amount of change in lighting data between the lighting data of the first sub-region and the lighting data of the second sub-region.

[0181] If the number of first sub-regions where scene changes occur exceeds a certain threshold, it is determined that the target frame image has undergone scene changes compared to the reference frame image.

[0182] In one implementation, the target frame image is a currently captured image or a currently previewed image; the scene change detection may further include an autofocus module configured to refocus if it is determined that the target frame image has undergone a scene change compared to the reference frame image.

[0183] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation, and therefore will not be repeated here.

[0184] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In an alternative embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0185] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0186] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0187] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0188] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0189] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes the executable instructions to perform the methods of this exemplary embodiment.

[0190] The following is for reference. Figure 12 The following description uses a mobile terminal as an example to illustrate an electronic device. It should be understood that... Figure 12 The electronic device 1200 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0191] refer to Figure 12 As shown, the electronic device 1200 may include: a processor 1201, a memory 1202, a mobile communication module 1204, a wireless communication module 1205, a display screen 1206, a camera module 1207, an audio module 1208, a power supply module 1209, and a sensor module 1210.

[0192] The processor 1201 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a display processing unit (DPU), a graphics processing unit (GPU), an image signal processor (ISP), a controller, an encoder, a decoder, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). The scene change detection method in this exemplary embodiment can be executed by the CPU. In one embodiment, the camera module 1207 can acquire spectral data of multiple first sub-regions in the target frame image. The CPU can parse the spectral data of the first sub-regions to obtain the illumination data of the first sub-regions. The CPU can then acquire illumination data of multiple second sub-regions in the reference frame image. The second sub-regions correspond to the first sub-regions. Finally, the scene change detection result of the target frame image compared to the reference frame image can be determined based on the amount of change in illumination data between the first and second sub-regions.

[0193] The memory 1202 can be used to store computer executable program code, which includes instructions. The processor 1201 executes various functional applications and data processing of the electronic device 1200 by running the instructions stored in the memory 1202. The memory 1202 can also store application data and various intermediate data, such as images, videos, and the aforementioned spectral data, local illumination data, etc.

[0194] The communication function of electronic device 1200 can be implemented through mobile communication module 1204, antenna 1, wireless communication module 1205, antenna 2, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 1204 can provide 3G, 4G, 5G and other mobile communication solutions for electronic device 1200. Wireless communication module 1205 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication for electronic device 1200.

[0195] The display screen 1206 is used to implement display functions, such as displaying a user interface, images, videos, etc. In one embodiment, the display screen 1206 can be used to display the target frame image of this embodiment. The camera module 1207 is used to implement shooting functions, such as capturing images, videos, etc. For example, the camera module 1207 may include an image sensor and the aforementioned spectral sensor. The image sensor can be used to acquire the target frame image. Combining multiple spectral sensors can more accurately acquire the spectral data of the target frame image, thereby improving the detection accuracy and efficiency of local illumination data of the image. The audio module 1208 is used to implement audio functions, such as playing audio and acquiring voice. The power module 1209 is used to implement power management functions, such as charging the battery, supplying power to the device, and monitoring the battery status. The sensor module 1210 may include one or more sensors, which are used to acquire status assessments of various aspects of the electronic device 1200.

[0196] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0197] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0198] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.

Claims

1. A method of scene change detection, characterized by, The method comprises: obtaining a target frame image and spectral data of a plurality of first sub-regions in the target frame image; obtaining illumination data of the first sub-regions by analyzing the spectral data of the first sub-regions; the illumination data of the first sub-regions reflect light source properties of the first sub-regions, so as to detect subtle scene changes; the illumination data comprises one or more light source property data of infrared data, alternating current light component, color temperature, and brightness data; obtaining illumination data of a plurality of second sub-regions in a reference frame image; the second sub-regions have a corresponding relationship with the first sub-regions; determining a scene change detection result of the target frame image compared with the reference frame image according to an illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions; the determining the scene change detection result of the target frame image compared with the reference frame image according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions comprises: determining a number of first sub-regions that have a scene change according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions; when the number of first sub-regions that have a scene change exceeds a number threshold, it is determined that the target frame image has a scene change compared with the reference frame image.

2. The method of claim 1, wherein, the illumination data comprises infrared data, and the obtaining the illumination data of the first sub-regions by analyzing the spectral data of the first sub-regions comprises: removing visible light data from the spectral data of the first sub-regions to obtain infrared data of the first sub-regions; or extracting response data of an infrared wave band from the spectral data of the first sub-regions to obtain the infrared data of the first sub-regions.

3. The method of claim 2, wherein, the determining the scene change detection result of the target frame image compared with the reference frame image according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions comprises: obtaining a difference between the infrared data of the first sub-regions and the infrared data of the second sub-regions to obtain an infrared data change amount of the first sub-regions; if the infrared data change amount is greater than an infrared data change amount threshold, it is determined that the first sub-regions have a scene change compared with the second sub-regions; determining whether the target frame image has a scene change compared with the reference frame image according to whether each of the first sub-regions has a scene change.

4. The method of claim 1, wherein, the illumination data comprises an alternating current light component, and the obtaining the illumination data of the first sub-regions by analyzing the spectral data of the first sub-regions comprises: determining the alternating current light component of the first sub-regions according to light source frequency information in the spectral data.

5. The method of claim 4, wherein, the determining the scene change detection result of the target frame image compared with the reference frame image according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions comprises: obtaining a difference between the AC light source component of the first sub-region and the AC light source component of the second sub-region to obtain an AC light source component variation of the first sub-region; if the AC light source component variation is greater than an AC light source component variation threshold, determining that the first sub-region has a scene change compared to the second sub-region; determining whether the target frame image has a scene change compared to the reference frame image according to whether each of the first sub-regions has a scene change.

6. The method of claim 1, wherein, The illumination data includes color temperature, and the illumination data of the first sub-region is obtained by analyzing the spectral data of the first sub-region, including: The color temperature of the first sub-region is determined by analyzing the response data of the visible light band in the spectral data of the first sub-region.

7. The method of claim 6, wherein, The scene change detection result of the target frame image compared to the reference frame image is determined according to the illumination data variation between the illumination data of the first sub-region and the illumination data of the second sub-region, including: obtaining a difference between the color temperature of the first sub-region and the color temperature of the second sub-region to obtain a color temperature variation of the first sub-region; if the color temperature variation is greater than a color temperature variation threshold, determining that the first sub-region has a scene change compared to the second sub-region; determining whether the target frame image has a scene change compared to the reference frame image according to whether each of the first sub-regions has a scene change.

8. The method of claim 1, wherein, The illumination data includes brightness data, and the illumination data of the first sub-region is obtained by analyzing the spectral data of the first sub-region, including: The brightness data of the first sub-region is determined by mapping the response data of the visible light band in the spectral data of the first sub-region to the XYZ color space to obtain the response data of the XYZ color space.

9. The method of claim 8, wherein, The scene change detection result of the target frame image compared to the reference frame image is determined according to the illumination data variation between the illumination data of the first sub-region and the illumination data of the second sub-region, including: obtaining a difference between the brightness data of the first sub-region and the brightness data of the second sub-region to obtain a brightness variation of the first sub-region; if the brightness variation is greater than a brightness variation threshold, determining that the first sub-region has a scene change compared to the second sub-region; determining whether the target frame image has a scene change compared to the reference frame image according to whether each of the first sub-regions has a scene change.

10. The method of claim 1, wherein, The target frame image is a currently captured image or a current preview image; the method further includes: if it is determined that the target frame image has a scene change compared to the reference frame image, performing refocusing.

11. A scene change detection apparatus characterized by comprising: including: a spectral data acquisition module configured to acquire spectral data of a target frame image and a plurality of first sub-regions in the target frame image; The spectral data analysis module is configured to obtain illumination data of the first sub-region by analyzing the spectral data of the first sub-region; the illumination data of the first sub-region is used to reflect the light source attribute of the first sub-region, so as to detect subtle scene changes; the illumination data includes one or more light source attribute data of infrared data, alternating current light source component, color temperature, and brightness data; The illumination data acquisition module is configured to acquire illumination data of a plurality of second sub-regions in the reference frame image; the second sub-regions have a corresponding relationship with the first sub-regions; The scene detection module is configured to determine a scene change detection result of the target frame image compared with the reference frame image according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions; The scene detection module is configured to: determine the number of first sub-regions that have scene changes according to the illumination data change amount between the illumination data of the first sub-regions and the illumination data of the second sub-regions; when the number of first sub-regions that have scene changes exceeds a number threshold, it is determined that the target frame image has a scene change compared with the reference frame image.

12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-10.

13. An electronic device, comprising: comprises: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method of any one of claims 1-10 by executing the executable instructions.

Citation Information

Patent Citations

  • Day-night mode switching method for camera and terminal equipment

    CN108093183A

  • Scene change detection method and device, storage medium and terminal equipment

    CN111783524A