Image difference detection method, electronic device and storage medium
By identifying target regions with differences greater than a threshold in an image and obtaining feature matching degrees, the system automatically detects changes in the state of significant objects, solving the problems of low efficiency and insufficient accuracy of manual detection in existing technologies, and achieving efficient and accurate automated detection.
Patent Information
- Application Number
- CN202111681276.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In existing technologies, determining the changing state of significant objects requires regular manual inspection or image comparison, resulting in high labor costs and low efficiency, and is prone to missed detections and false detections.
By identifying target region pairs with a difference greater than a threshold in the image to be detected and the background image, feature matching degree is obtained, and the change state of significant objects is automatically determined.
It enables automatic detection of significant changes in the state of objects, reducing labor costs and improving detection efficiency and accuracy.
Smart Images

Figure CN114549875B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image difference detection method, electronic device, and computer-readable storage medium. Background Technology
[0002] A salient object can be any definable entity whose state may change, such as snacks on a shelf, grease in a kitchen, or industrial goods on a conveyor belt. In many applications, it's necessary to determine the changing state of salient objects in a designated area at different points in time. For example, in fire safety applications, it can be determined whether unrelated items are piled up in the fire-fighting zone; in security applications, it can be determined whether items within a designated area are lost, left behind, or have changed location.
[0003] In existing technologies, it is necessary to manually inspect the site at regular intervals or compare images taken at different times to determine the changes in significant objects. Therefore, existing methods not only consume excessive manpower but are also inefficient and prone to missed or false detections. Summary of the Invention
[0004] This application provides an image difference detection method, an electronic device, and a computer-readable storage medium, which can automatically determine the change state of a significant object.
[0005] To address the aforementioned technical problems, this application provides an image difference detection method. The method includes: identifying a pair of target regions with a difference greater than a difference threshold in the image to be detected and the corresponding background image, wherein the target region pair includes a first target region in the image to be detected and a second target region in the background image; obtaining the feature matching degree of the target region pair; and determining the change state of salient objects in the target region pair based on the feature matching degree.
[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, which includes a processor and a memory connected to the processor, wherein the memory stores program instructions; the processor is used to execute the program instructions stored in the memory to implement the above-mentioned method.
[0007] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium storing program instructions that, when executed, can implement the above-mentioned method.
[0008] By means of the above method, this application identifies target region pairs in the image to be detected and the corresponding background image where the difference is greater than a difference threshold. The target region pair includes a first target region in the image to be detected and a second target region in the background image. The feature matching degree of the target region pair is obtained. Based on the feature matching degree, the change state of salient objects in the target region pair is determined. Since the difference between the region pairs in the image to be detected and the corresponding background image is sufficiently large (greater than the difference threshold), it means that there are salient objects in the region pair, and it is a region pair related to salient objects. Therefore, this region pair is used as the target region pair, and the change state of salient objects in the target region pair can be determined based on the feature matching degree of the target region pair. Thus, the method provided by this application can automatically determine the change state of salient objects, reducing labor costs and improving the efficiency and accuracy of change state determination. Attached Figure Description
[0009] Figure 1 This is a schematic flowchart of an embodiment of the image difference detection method of this application;
[0010] Figure 2 This is a schematic flowchart of another embodiment of the image difference detection method of this application;
[0011] Figure 3 This is a flowchart illustrating another embodiment of the image difference detection method of this application;
[0012] Figure 4 yes Figure 3 A detailed flowchart of the S31 process;
[0013] Figure 5 This is a flowchart illustrating a specific example of the image difference detection method of this application;
[0014] Figure 6 This is a schematic diagram of the image to be detected and the background image;
[0015] Figure 7 This is a schematic diagram of the target region pair;
[0016] Figure 8 This is another flowchart illustrating a specific example of the image difference detection method of this application;
[0017] Figure 9 These are schematic diagrams of binarization result 1 and binarization result 2;
[0018] Figure 10 This is a schematic diagram of the first and second salient object regions;
[0019] Figure 11 This is another flowchart illustrating a specific example of the image difference detection method of this application;
[0020] Figure 12 This is a schematic diagram of the structure of an embodiment of the electronic device of this application;
[0021] Figure 13 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0023] The terms "first," "second," and "third" used in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments without conflict.
[0025] Figure 1 This is a schematic flowchart of an embodiment of the image difference detection method of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily replace it. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment may include:
[0026] S11: In the image to be detected and the corresponding background image, identify the target region pair with a difference greater than the difference threshold.
[0027] The target region includes a first target region of the image to be detected and a second target region of the background image.
[0028] The image to be detected and the background image were captured at different times, using the same shooting parameters, and at the same geographical location. Shooting parameters may include shooting angle, shooting distance, etc. Hereinafter, the time point at which the image to be detected was captured will be referred to as the first time point, and the time point at which the background image was captured will be referred to as the second time point.
[0029] A first image region in the image to be detected and its corresponding second image region in the background image together form an image region pair. Therefore, the position of the first image region in the image to be detected and the position of the second image region in the background image are the same. The difference between multiple image region pairs between the image to be detected and the background image can be calculated separately. Image region pairs with a difference greater than a difference threshold are designated as target region pairs. The first image region in each image region pair with a difference greater than the difference threshold is designated as the first target region, and the second image region is designated as the second target region.
[0030] If the difference between the corresponding pixel values in the first target region and the second target region is greater than the difference threshold, the first target region and the second target region can be regarded as regions related to salient objects, or as coarse localization regions of salient objects.
[0031] For example, if the background image and the image to be detected are taken from a kitchen, and a certain area in the kitchen is free of oil stains when the background image is taken, but a certain area is free of oil stains when the image to be detected is taken, then the area corresponding to that area in the image to be detected is determined as the first target area, and the area corresponding to that area in the background image is determined as the second target area. The first target area and the second target area are areas related to the salient object "oil stain".
[0032] For example, if the background image and the image to be detected are taken from a product shelf, and a product 1 is placed upright in a designated area on the product shelf when the background image is taken, and a product 1 is placed diagonally in a designated area on the product shelf when the image to be detected is taken, then the area corresponding to this designated area in the image to be detected is determined as the first target area, and the area corresponding to this designated area in the background image is determined as the second target area. The first target area and the second target area are areas related to the salient object "product 1".
[0033] S12: Obtain the feature matching degree of the target region pair.
[0034] In some embodiments, feature point extraction and feature point matching can be performed on the first target region and the second target region respectively, and the number of matched feature points is used as the feature matching degree. The feature point extraction algorithm includes, but is not limited to, the SIFT algorithm.
[0035] In some embodiments, to improve the accuracy of feature matching, fine localization can be performed based on the target region pairs to obtain the fine localization results of salient objects; then, the feature matching degree can be obtained based on the fine localization results. Please refer to the description of the embodiments below for a detailed implementation process.
[0036] S13: Based on feature matching degree, determine the change status of salient objects in the target region.
[0037] The change state of a salient object in the target region refers to the change state of the salient object between the second target region (background image) and the first target region (image to be detected), or in other words, the change state of the salient object from the second time point to the first time point.
[0038] The state of change of a salient object is divided into altered and unchanged. The unchanged state is further divided into appearing and disappearing. For example, if oil stains exist in both the second and first target areas, the state of change of the salient object is altered; if oil stains do not exist in the second target area but exist in the first target area, the state of change of the salient object is appearing; if oil stains exist in both the second and first target areas, the state of change of the salient object is disappearing.
[0039] Through the implementation of this embodiment, in this application, since the difference between the regions in the image to be detected and the corresponding background image is sufficiently large (greater than the difference threshold), it means that there is a salient object in the region pair, and it is a region pair related to the salient object. Therefore, this region pair is taken as the target region pair, and the change state of the salient object in the target region pair can be determined based on the feature matching degree of the target region pair. Thus, the method provided by this application can automatically determine the change state of the salient object, reduce labor costs, and improve the efficiency and accuracy of determining the change state.
[0040] Figure 2 This is a schematic flowchart of another embodiment of the image difference detection method of this application. It should be noted that if substantially the same result is obtained, this embodiment is not necessarily identical. Figure 2 The illustrated process sequence is limited. This embodiment is a further extension of S11, such as... Figure 2 As shown, in this embodiment, S11 may include:
[0041] S21: Obtain the difference image between the image to be detected and the background image.
[0042] In some embodiments, the background image can be directly subtracted from the image to be detected to obtain the difference image. That is, the absolute value of the difference between corresponding pixels in the image to be detected and the background image is used as the corresponding pixel value in the difference image.
[0043] In some embodiments, the image to be detected can be rotated multiple times at different angles and / or translated in different directions to obtain multiple foreground images. For each foreground image, a difference image between the foreground image and the background image is obtained. Thus, multiple difference images are obtained. It is understood that camera shake during the capture of the image to be detected can cause differences in the shooting parameters and positions of the image to be detected and the background image, introducing errors into subsequent processing. This method obtains multiple foreground images by rotating and translating the image to be detected, and applies these multiple foreground images to the calculation of the first binarized image, thereby reducing or even eliminating errors caused by shake.
[0044] For example, let the image to be detected be Fg, and the background image be Bg. Rotate Fg from -5° to 5°, in 2° increments. Then, horizontally shift Fg left and right by 1% of its image width, and vertically shift Fg up and down by 1% of its image width. Fill any missing pixels with 0 after each shift. This yields the i-th foreground image Fg′. i ∈{Fg′1,Fg′2...,Fg′2}, n=10. Will Fg′ i Subtracting Bg yields the i-th difference image Sub. i =|Fg i -Bg|.
[0045] S22: Binarize the difference image to obtain the first binarized image.
[0046] When there is only one difference image, it can be directly binarized to obtain a first binarized image. When there are multiple difference images, each difference image can be binarized separately to obtain multiple second binarized images; the corresponding pixel values in the multiple second binarized images are then ANDed to obtain a first binarized image.
[0047] S23: Determine the target region pair based on the first binarized image.
[0048] The first binarized image can be regarded as a coarse segmentation mask for salient objects.
[0049] In some embodiments, a target connected component in a first binarized image may be determined; the bounding rectangle of the target connected component may be used as a change region; the region corresponding to the change region in the image to be detected may be used as a first target region; and the region corresponding to the change region in the background image may be used as a second target region.
[0050] In some embodiments, dilation and erosion operations can be performed on the first binarized image before determining the target connected components in the first binarized image to update the first binarized image. It is understood that dilation and erosion operations can not only remove noise from the first binarized image but also optimize the boundaries of the target connected components.
[0051] In some embodiments, the bounding rectangle of the target connected component can be enlarged before being used as the transformation region. The enlarged bounding rectangle does not exceed the boundary of the first binarized image. It is understood that if AND, dilation, and erosion operations are performed during the process of obtaining the first binarized image, the area of the target connected component may be smaller than the actual connected component area, resulting in the area of the bounding rectangle being smaller than the actual rectangle area. Therefore, using the enlarged bounding rectangle as the transformation region can reduce the error in the transformation region.
[0052] The following example illustrates the enlargement process, using an enlargement ratio of 5% of the original width and height of the circumscribed rectangle:
[0053] Let the circumscribed rectangle be [x ul y ul x rd y rd ], where (x ul y ul (x) represents the coordinates of the top-left vertex. rd y rd ) represents the coordinates of the bottom right vertex, with width w and height h.
[0054] Let the enlarged bounding rectangle be [x′]. ul y′ ul x′ rd y′ rd ], where (x′ ul y′ ul (x′) represents the coordinates of the top-left vertex after the enlargement process. rd y′ rd () represents the coordinates of the bottom right vertex after the enlargement process:
[0055]
[0056]
[0057]
[0058]
[0059] Figure 3This is a flowchart illustrating another embodiment of the image difference detection method of this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily replace it. Figure 3 The illustrated process sequence is limited. In this embodiment, S31-S32 are further extensions of S12, and S33-S35 are further extensions of S13. For example... Figure 3 As shown, this embodiment may include:
[0060] S31: Determine the first salient object region of the first target region and the second salient object region of the second target region.
[0061] The first salient object region can be regarded as the precise localization region of the salient object in the first target region, and the second salient object region can be regarded as the precise localization region of the salient object in the second target region.
[0062] A first saliency feature map of the first target region and a second saliency feature map of the second target region can be extracted; a first salient object region is obtained based on the first saliency feature map, and a second salient object region is obtained based on the second saliency feature map.
[0063] This process involves performing saliency detection on the first / second target regions to obtain first / second saliency feature maps. The saliency detection algorithm can be LC, HC, AC, FT, etc. The first / second saliency feature maps can be, but are not limited to, contrast feature maps and frequency coordination feature maps.
[0064] The contrast feature map is obtained in the LC algorithm as follows: Each pixel value in the image is taken as the current pixel value, and the sum of the absolute values of the differences between the current pixel value and other pixel values is calculated. This sum is then used as the pixel value C(I) corresponding to the current pixel value in the contrast feature map. m ):
[0065]
[0066] Where I1 represents the image to be detected / background image, I m Indicates the current pixel value, I n Indicates other pixel values.
[0067] The frequency-coordinated feature map is obtained in the FT algorithm as follows:
[0068] ① Filter the image (in some embodiments, to remove noise, ① can be skipped and the process proceeds directly to ②). Filtering methods include, but are not limited to, Gaussian filtering. For example, a 5x5 Gaussian kernel can be used to perform Gaussian filtering on the image.
[0069] ② Convert the color space of the image from RGB to CIELAB to obtain an image with three channels: L, A, and B.
[0070] ③ Calculate the average pixel value of the images in the three channels L, A, and B respectively (let the pixel in the L channel image be l, the pixel in the A channel image be a, and the pixel in the B channel image be b).
[0071] ④ Calculate the distance between l, a, b and the average pixel value of their respective channels to obtain the frequency coordination feature maps of the three channels L, A, and B.
[0072] For a given channel, the frequency coordination feature map can be obtained using the following formula:
[0073] F(I n )=||I n -I μ ||;
[0074] Among them, I μ I represents the average pixel value. n F(I) represents the current pixel value in a certain channel of the image. n This represents the pixel value corresponding to the current pixel value in the frequency coordination feature map.
[0075] See also Figure 4 If the first saliency feature map includes a first contrast feature map and a first frequency coordination feature map, and the second saliency feature map includes a second contrast feature map and a second frequency coordination feature map, then S31 may include the following sub-steps:
[0076] S311: The first contrast feature map and the first frequency coordination feature map are fused to obtain the first fused feature map, and the second contrast feature map and the second frequency coordination feature map are fused to obtain the second fused feature map.
[0077] Before fusion, the first / second contrast feature maps and the first / second frequency coordination feature maps can be normalized.
[0078] Taking the first fused feature map as an example, fusion can be achieved based on the following calculation formula:
[0079]
[0080] Among them, S(I m ) represents the pixel value corresponding to the current pixel value in the first fused feature map, C min C max F represents the minimum and maximum pixel values in the first contrast feature map, respectively. min F max These represent the minimum and maximum pixel values in the first frequency coordination feature map, respectively, with α and β representing weights (e.g., α and β are set to 0.3 and 0.7, respectively).
[0081] S312: Obtain the first salient object region based on the first fused feature map, and obtain the second salient object region based on the second fused feature map.
[0082] The first fused feature map can be binarized to obtain binarization result 1, and the second fused feature map can be binarized to obtain binarization result 2. Binarization result 1 can be regarded as a fine segmentation mask for salient objects in the first target region, and binarization result 2 can be regarded as a fine segmentation mask for salient objects in the second target region. Therefore, the first salient object region can be determined in the first target region based on binarization result 1, and the second salient object region can be determined in the second target region based on binarization result 2.
[0083] S32: Perform feature point matching on the first salient object region and the second salient object region, and use the number of matched feature points as the feature matching degree.
[0084] S33: Determine whether the feature matching degree is greater than the matching degree threshold.
[0085] If yes, execute S34; otherwise, execute S35.
[0086] S34: Determine the status of the significant object as unchanged.
[0087] S35: Determine the changed state of a significant object as "change".
[0088] The changes are categorized into two types: appearance and disappearance. If the number of feature points in the first salient object region is greater than the number of feature points in the second salient object region, then the second salient object region is considered to have no salient object, while the first salient object region has a salient object, and the change state of the salient object is considered to be appearance; otherwise, the second salient object region is considered to have a salient object, while the first salient object region does not have a salient object, and the change state of the salient object is considered to be disappearance.
[0089] The following combination Figure 5 The method provided in this application is illustrated with an example:
[0090] 1) Obtain the target region pair between the image to be detected and the background image. See the example of the image to be detected and the background image. Figure 6 . Figure 6 The left image represents the image to be detected, and the right image represents the background image. See examples of target region pairs. Figure 7 . Figure 7 In the left image, 'a' represents the first target region, and in the right image, 'b' represents the second target region.
[0091] Combination Figure 8 Detailed explanation of 1):
[0092] ① Rotation and translation transformations. Rotation and translation operations are performed on the image to be detected to obtain 4 foreground images.
[0093] ② Subtract the background. Subtract the background image from each of the four foreground images to obtain four difference images.
[0094] ③ Remove the intersection of the difference images. Binarize the four difference images to obtain four second binarized images. Perform an AND operation on the four second binarized images to obtain the first binarized image.
[0095] ④ Morphological operations. Dilation and erosion operations are performed on the first binarized image to update the first binarized image (binary map of the changed region).
[0096] ⑤ Outward Expansion and Capture. Determine the target connected component in the binary image of the changed region, expand the outer rectangle of the target connected component to obtain the changed region; take the region corresponding to the changed region in the image to be detected as the first target region; take the region corresponding to the changed region in the background image as the second target region. Figure 8 The rightmost image shows the second target area.
[0097] 2) Perform saliency detection on the first target region and the second target region respectively to obtain the first saliency feature map and the second saliency feature map.
[0098] 3) Binarize the first saliency feature map and the second saliency feature map respectively, resulting in binarization result 1 and binarization result 2. Examples of binarization result 1 and binarization result 2 are shown below. Figure 9 . Figure 9 The left image represents binarization result 1, and the right image represents binarization result 2, where the white part represents salient objects.
[0099] 4) Based on binarization result 1, determine the first salient object region in the first target region, and based on binarization result 2, determine the second salient object region in the second target region. Examples of the first and second salient object regions are shown below. Figure 10 . Figure 10 The left image represents the first salient object region, and the right image represents the second salient object region.
[0100] 5) Determine the change state of the salient objects based on the first salient object region and the second salient object region.
[0101] Combination Figure 11 Detailed explanation of 5):
[0102] ① Perform SIFT feature point extraction and feature point matching on the first salient object region (foreground image) and the second salient object region (background image) respectively, and determine the number of matched feature points.
[0103] ② If the number of matched feature points is greater than the threshold, then the state of the significant object is determined to be unchanged.
[0104] ③ If the number of matched feature points is not greater than the threshold, then compare the number of feature points in the first salient object region and the second salient object region; if the number of feature points (foreground features) in the first salient object region is greater, then determine that the salient object is present; if the number of feature points (background features) in the second salient object region is greater, then determine that the salient object is absent.
[0105] Figure 12 This is a schematic diagram of the structure of an embodiment of the electronic device of this application. Figure 12 As shown, the electronic device includes a processor 21 and a memory 22 coupled to the processor 21.
[0106] The memory 22 stores program instructions for implementing the methods of any of the above embodiments; the processor 21 executes the program instructions stored in the memory 22 to implement the steps of the above method embodiments. The processor 21 may also be referred to as a CPU (Central Processing Unit). The processor 21 may be an integrated circuit chip with signal processing capabilities. The processor 21 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor.
[0107] The electronic device mentioned in this embodiment can be an access management node or other devices that have established a connection with the access management node.
[0108] Figure 13 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of this application. Figure 13As shown, the computer-readable storage medium 30 of this application embodiment stores program instructions 31, which, when executed, implement the methods provided in the above embodiments of this application. The program instructions 31 can form a program file and be stored in the computer-readable storage medium 30 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) or processor can execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned computer-readable storage medium 30 includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An image difference detection method, characterized in that, include: In the image to be detected and the corresponding background image, a pair of target regions with a difference greater than a difference threshold is determined, wherein the pair of target regions includes a first target region of the image to be detected and a second target region of the background image; A first salient object region of the first target region and a second salient object region of the second target region are determined. The positioning accuracy of the salient object in the first salient object region and the second salient object region is higher than that in the first target region and the second target region, respectively. Feature point matching is performed on the first salient object region and the second salient object region, and the number of matched feature points is used as the feature matching degree. If the feature matching degree is greater than the matching degree threshold, the state of the significant object is determined to be unchanged; otherwise, the state of the significant object is determined to be changed.
2. The method according to claim 1, characterized in that, The step of determining the target region pair with a difference greater than a difference threshold in the image to be detected and the corresponding background image includes: Obtain the difference image between the image to be detected and the background image; The difference image is binarized to obtain a first binarized image; Based on the first binarized image, the target region pair is determined.
3. The method according to claim 2, characterized in that, The step of obtaining the difference image between the image to be detected and the background image includes: Multiple foreground images are obtained by performing rotation operations at different angles and translation operations in different directions on the image to be detected. For each of the foreground images, obtain the difference image between the foreground image and the background image; The step of binarizing the difference image to obtain a first binarized image includes: The multiple difference images are binarized to obtain multiple second binarized images; The first binarized image is obtained by performing a bitwise AND operation on the corresponding pixel values in multiple second binarized images.
4. The method according to claim 2, characterized in that, Determining the target region pair based on the binarized image includes: Dilation and erosion operations are performed on the first binarized image to update the first binarized image; Determine the target connected component in the first binarized image; The bounding rectangle of the target connected region is expanded to obtain the variable region. The region corresponding to the changed region in the image to be detected is taken as the first target region, and the region corresponding to the changed region in the background image is taken as the second target region.
5. The method according to claim 1, wherein Determining the first salient object region of the first target region and the second salient object region of the second target region includes: Extract the first saliency feature map of the first target region and the second saliency feature map of the second target region; The first salient object region is obtained based on the first salient feature map, and the second salient object region is obtained based on the second salient feature map.
6. The method according to claim 5, characterized in that, The first saliency feature map includes a first contrast feature map and a first frequency coordination feature map, and the second saliency feature map includes a second contrast feature map and a second frequency coordination feature map. The step of obtaining the first salient object region based on the first salient feature map, or obtaining the second salient object region based on the second salient feature map, includes: The first contrast feature map and the first frequency coordination feature map are fused to obtain a first fused feature map, and the second contrast feature map and the second frequency coordination feature map are fused to obtain a second fused feature map. The first salient object region is obtained based on the first fused feature map, and the second salient object region is obtained based on the second fused feature map.
7. The method according to claim 1, characterized in that, Determining the changed state of the significant object as a change includes: If the number of feature points in the first salient object region is greater than the number of feature points in the second salient object region, then the change state of the salient object is "appearance"; otherwise, the change state of the salient object is "disappearance".
8. An electronic device, characterized in that, Includes a processor and a memory connected to the processor, wherein, The memory stores program instructions; The processor is configured to execute the program instructions stored in the memory to implement the method of any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The storage medium stores program instructions, which, when executed, implement the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Image difference detection method and device and computer equipment
CN112330597A
Motion state detection method and related device
CN113674322A