Image processing method and device, storage medium, and electronic device
Through the method of edge detection of graphs and texture feature values, the accuracy of occlusion detection in video surveillance is solved, and the accuracy of video occlusion detection is improved.
Patent Information
- Application Number
- CN202111649927.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In video surveillance, due to human or environmental factors, the surveillance screen will be blocked to varying degrees, resulting in information loss and loopholes in security systems. It is difficult for the existing technology to accurately determine whether the video is blocked.
By determining the edge detection map based on the first image, M image areas of the image are determined, texture feature values are calculated based on the pixel values of these areas, and whether the image is blocked based on the texture feature values is determined.
The purpose of determining whether the image is blocked through the texture feature value of the image is achieved, and the accuracy of video occlusion detection is improved.
Smart Images

Figure CN114359209B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of images, and in particular, to an image processing method and device, a storage medium, and an electronic device. Background Art
[0002] In video surveillance, the surveillance images may be blocked to varying degrees due to human or environmental factors. Video blocking will result in the loss of a large amount of effective information, forming monitoring blind spots. If not discovered in time, it will lead to loopholes in the entire security system. In today's era of big data, the number of video surveillance points in a security system may be as many as hundreds or thousands. Relying on manpower to observe whether each point is blocked in real time cannot accurately determine whether the video is blocked. Summary of the invention
[0003] Embodiments of the present invention provide an image processing method and device, a storage medium, and an electronic device to at least solve the problem of determining video occlusion in the related art.
[0004] According to one embodiment of the present invention, there is provided an image processing method, comprising: determining M image regions of the first image based on an edge detection map of the first image, wherein M is a positive integer; determining texture feature values of the first image based on pixel values in each of the M image regions; and determining whether the first image is occluded based on the texture feature values of the first image.
[0005] According to another embodiment of the present invention, there is provided an image processing device, comprising: a first determination module, used to determine M image regions of the first image based on an edge detection map of the first image, wherein M is a positive integer; a second determination module, used to determine texture feature values of the first image according to pixel values in each of the M image regions; and a third determination module, used to determine whether the first image is occluded based on the texture feature values of the first image.
[0006] In an exemplary embodiment, the first determination module includes: a first determination unit for binarizing the edge detection image to determine a binary image; and a second determination unit for dividing the binary image into regions to determine the M image regions.
[0007] In an exemplary embodiment, the second determination module includes: a first calculation unit, used to calculate the average value of the pixel values in each of the M image areas, and determine the M pixel average values; and a third determination unit, used to determine the texture feature value of the first image based on the relationship between the M pixel average values and a first preset pixel threshold.
[0008] In an exemplary embodiment, the third determination unit includes: a first determination subunit, used to determine the number of pixel average values that are less than the first preset pixel threshold from the M pixel average values; and a second determination subunit, used to determine the texture feature value of the first image based on the number.
[0009] In an exemplary embodiment, the third determination module includes: a fourth determination unit, used to determine the texture feature value of a reference image associated with the first image, wherein the reference image includes images in the target video other than the first image, and there is a preset number of frames between the reference image and the first image; and a fifth determination unit, used to determine whether the first image is occluded based on the relationship between the texture feature value of the first image and the texture feature value of the reference image.
[0010] In an exemplary embodiment, the fifth determination unit includes: a sixth determination unit, used to determine that the first image is occluded in response to the texture feature value of the first image being greater than the first texture feature threshold, and the texture feature value of the reference image being greater than the first texture feature threshold.
[0011] In an exemplary embodiment, the fifth determination unit includes: a seventh determination unit, used to determine the difference between the texture feature value of the first image and the texture feature value of the background image, wherein the reference image includes the background image, and the background image includes the image in the target video other than the occluded image; an eighth determination unit, used to determine that the first image is occluded in response to the difference being greater than a second texture feature threshold.
[0012] In an exemplary embodiment, the third determination module includes: a ninth determination unit, for determining that the first image is obscured in response to the texture feature value of the first image not being within a preset texture feature value range, wherein the preset texture feature value range is a pre-configured texture feature value range of an image obtained by normal shooting of the target area during a target shooting time period, the target shooting time period includes a time period for shooting the first image, and the first image is an image obtained after shooting the target area.
[0013] In an exemplary embodiment, the above-mentioned device also includes: a fourth determination module, which is used to determine the occluded image area in the above-mentioned first image after determining that the above-mentioned first image is occluded; and a fifth determination module, which is used to determine the occlusion assessment information of the above-mentioned first image being occluded based on the above-mentioned occluded image area and the above-mentioned first image.
[0014] In an exemplary embodiment, the apparatus further includes: a first processing module, configured to, after determining the occlusion assessment information that the first image is occluded, perform smoothing processing on the occluded image region based on the occlusion assessment information of the first image.
[0015] In an exemplary embodiment, the fourth determination module includes: a tenth determination unit, used to determine the label value of each pixel in the edge detection image; a first comparison unit, used to compare whether the label value of each pixel is equal to the label value of the neighboring pixel, and determine the comparison result; a first merging unit, used to merge pixels with equal label values according to the comparison result, and determine the connected area with the same label value; an eleventh determination unit, used to determine the occluded image area in the first image based on the connected area with the same label value.
[0016] In an exemplary embodiment, the fifth determination module includes: a twelfth determination unit, configured to determine a ratio of an area of the connected region to an area of the first image as occlusion assessment information indicating that the first image is occluded.
[0017] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.
[0018] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0019] Through the present invention, based on the edge detection map of the first image, M image regions of the first image are determined, where M is a positive integer; according to the pixel values in each of the M image regions, the texture feature value of the first image is determined; based on the texture feature value of the first image, it is determined whether the first image is blocked. Thus, the purpose of determining whether the image is blocked by the texture feature value of the image is achieved. Therefore, the problem of video occlusion in the related art can be solved, and the effect of improving the accuracy of video occlusion detection can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a hardware structure block diagram of a mobile terminal of an image processing method according to an embodiment of the present invention;
[0021] Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention;
[0022] Figure 3is a flow chart of a method for determining video occlusion according to an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of setting pixel label values according to an embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of traversing pixel label values according to an embodiment of the present invention;
[0025] Figure 6 is a structural block diagram of an image processing apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an image processing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only.
[0029] It does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] In this embodiment, an image processing method is provided. Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0033] Step S202, determining M image regions of the first image based on the edge detection map of the first image, where M is a positive integer;
[0034] Step S204, determining a texture feature value of the first image according to a pixel value in each of the M image regions;
[0035] Step S206: determining whether the first image is blocked based on the texture feature value of the first image.
[0036] In this embodiment, the first image is an image in a target video, the target video includes multiple frames of images, and whether the target video is blocked is determined from the texture feature value of each frame of the image.
[0037] In this embodiment, the first image is an image obtained by performing Gaussian filtering and denoising processing on the acquired image.
[0038] In this embodiment, image obstruction includes the image being occupied by foreign objects. For example, before the camera is turned on, the monitored area is obstructed by environmental and human factors, and the information of the original monitored area is lost. The image occupied by foreign objects is the obstructed area.
[0039] In this embodiment, according to the time when the image is blocked, the blockage can be divided into two situations: positioning blockage and dynamic video. Positioning blockage is used to indicate that the monitoring device has been blocked before the monitoring video starts. Dynamic blockage is used to indicate that the monitoring screen changes from unblocked to blocked in the normal operation state.
[0040] The execution subject of the above steps may be a terminal, etc., but is not limited thereto.
[0041] Through the above steps, based on the edge detection map of the first image, M image regions of the first image are determined, where M is a positive integer; based on the pixel values in each of the M image regions, the texture feature value of the first image is determined; based on the texture feature value of the first image, it is determined whether the first image is blocked. Thus, the purpose of determining whether the image is blocked by the texture feature value of the image is achieved. Therefore, the problem of video occlusion in the related art can be solved, and the effect of improving the accuracy of video occlusion detection can be achieved.
[0042] In an exemplary embodiment, determining M image regions of the first image based on an edge detection map of the first image includes:
[0043] S21, performing binarization processing on the edge detection image to determine a binarized image;
[0044] S22, dividing the binary image into regions to determine M image regions.
[0045] In this embodiment, for example, the binary image is divided into image regions of small grids of 16*16.
[0046] In an exemplary embodiment, determining a texture feature value of the first image according to a pixel value in each of the M image regions includes:
[0047] S31, calculating the average value of the pixel values in each of the M image regions to determine the M pixel average values;
[0048] S32, determining a texture feature value of the first image based on a relationship between an average value of the M pixels and a first preset pixel threshold.
[0049] In this embodiment, the pixels in each image region are counted respectively. If the average value of the pixels in the image region is less than the first preset threshold, the count is performed once, and the final count is determined as the texture feature value of the first image.
[0050] In an exemplary embodiment, determining the texture feature value of the first image based on the relationship between the M pixel averages and the first preset pixel threshold includes:
[0051] S41, determining the number of pixel average values that are less than a first preset pixel threshold from the M pixel average values;
[0052] S42: Determine a texture feature value of the first image based on the quantity.
[0053] In this embodiment, the counted number of pixels less than a first preset pixel threshold is determined as the texture feature value of the first image.
[0054] In an exemplary embodiment, determining whether the first image is blocked based on a texture feature value of the first image includes:
[0055] S51, determining a texture feature value of a reference image associated with the first image, wherein the reference image includes images in the target video except the first image, and the reference image is separated from the first image by a preset number of frames;
[0056] S52: Determine whether the first image is blocked based on the relationship between the texture feature value of the first image and the texture feature value of the reference image.
[0057] In this embodiment, the first image and the reference image may be continuous images or discontinuous images.
[0058] In an exemplary embodiment, determining that the first image is blocked based on a relationship between a texture feature value of the first image, a texture feature value of a reference image, and a texture feature threshold includes:
[0059] S61: In response to a texture feature value of the first image being greater than a first texture feature threshold and a texture feature value of the reference image being greater than the first texture feature threshold, determining that the first image is blocked.
[0060] In the case that the first image and the reference image are continuous images, it can be determined that they belong to positioning occlusion.
[0061] In an exemplary embodiment, determining that the first image is blocked based on a relationship between a texture feature value of the first image and a texture feature value of a reference image includes:
[0062] S71, determining a difference between a texture feature value of a first image and a texture feature value of a background image, wherein the reference image includes the background image, and the background image includes an image in the target video except an occluded image;
[0063] S72: In response to the difference being greater than a second texture feature threshold, determining that the first image is blocked.
[0064] This embodiment includes but is not limited to being applied to the scene of dynamic occlusion judgment. For example, when the video picture changes from unoccluded to occluded, a large amount of effective information in the picture is lost, and the texture degree of the picture is greatly reduced. When the texture feature degree value of each frame image is gradually greater than the texture feature degree value of the background frame image, it can be determined that video occlusion has occurred.
[0065] In an exemplary embodiment, determining that the first image is blocked based on a texture feature value of the first image includes:
[0066] S81, in response to the texture feature value of the first image not being within a preset texture feature value range, determining that the first image is obscured, wherein the preset texture feature value range is a pre-configured texture feature value range of an image obtained by normal shooting of the target area during a target shooting time period, the target shooting time period includes a time period for shooting the first image, and the first image is an image obtained after shooting the target area.
[0067] This embodiment can be applied to the judgment scene of positioning occlusion. For example, the texture feature value of each frame image is judged in the first 30 frames of the video, and if the texture feature value of this stage is continuously greater than the second preset threshold, it is determined to be a scene of positioning occlusion.
[0068] In an exemplary embodiment, after determining that the first image is blocked, the method further includes:
[0069] S91, determining an obstructed image area that is obstructed in the first image;
[0070] S92: Determine occlusion assessment information that the first image is occluded based on the occluded image area and the first image.
[0071] In this embodiment, the occlusion evaluation information is used to evaluate the occlusion ratio of the image.
[0072] In an exemplary embodiment, after determining the occlusion assessment information that the first image is occluded, the method further includes:
[0073] S101, performing smoothing processing on an occluded image area based on occlusion evaluation information of a first image.
[0074] In this embodiment, the average value of the occlusion ratios of multiple frames of images is calculated, and the occlusion area is smoothed, which can prevent the result jump of the video image due to noise interference.
[0075] In an exemplary embodiment, determining an occluded image region that is occluded in a first image includes:
[0076] S111, determining a label value for each pixel in the edge detection image;
[0077] S112, comparing the label value of each pixel with the label value of the neighboring pixel to determine whether they are equal, and determining the comparison result;
[0078] S113, merging pixels with equal label values according to the comparison result to determine connected areas with the same label values;
[0079] S114: Determine an obstructed image region in the first image based on connected regions with the same label value.
[0080] In this embodiment, all foreground pixels in the edge detection image are scanned row by row, and each pixel is assigned a label value. For example, based on the neighboring relationship between the pixel and the four domain pixels, if there is no existing label in the four neighborhood pixels, a new label is assigned to it. If there are labels in the four neighborhoods, the minimum label in the four neighborhoods is assigned to it. At the same time, the equality relationship between pixels belonging to the same connected area but with different label values is recorded. The pixels in the same connected area with an equality relationship are merged into one connected area and assigned the same label value.
[0081] In an exemplary embodiment, determining occlusion assessment information that the first image is occluded based on the occluded image area and the first image includes:
[0082] S121: Determine the ratio of the area of the connected region to the area of the first image as occlusion assessment information indicating that the first image is occluded.
[0083] In this embodiment, the number of pixels corresponding to each label value is counted to obtain the label value including the most pixels, that is, the area of the connected region represented by the label value is determined. The pixel-level video occlusion ratio can be obtained by dividing the area of the blocked connected region by the area of the original image.
[0084] The present invention will be described below in conjunction with specific embodiments:
[0085] This embodiment determines the video occlusion by time period, that is, determines whether the occlusion is a fixed occlusion or a dynamic occlusion. Fixed occlusion is used to indicate that the monitoring device has been blocked before the monitoring video begins. Dynamic occlusion is used to indicate that the monitoring screen changes from unblocked to blocked in normal operation.
[0086] like Figure 3 As shown, the method for determining video occlusion in this embodiment includes the following steps:
[0087] S301, the input of video occlusion detection is a video or a color image;
[0088] S302, texture feature extraction; specifically including:
[0089] Step 1: Analyze the data of the Y channel (Y channel data in YUV format) of the image in the video to obtain its Canny map and Canny expansion map (Canny image can be understood as edge image after edge detection; Canny expansion image can be understood as image after image enhancement or denoising of Canny image). Use Gaussian filtering to denoise the original grayscale image; then calculate the gradient strength and gradient direction of the filtered image, including the following formula:
[0090]
[0091] The maximum value is suppressed to obtain the canny edge texture map C; finally, the canny texture map C is processed using a 3×3 sliding window to obtain the canny expansion map (corresponding to the edge detection diagram above).
[0092] Step 2: Calculate the texture feature value N of the current frame image of the video, including the following formula:
[0093] in, Used to represent the result of binarizing the canny expansion map of the current frame image; It is used to represent the texture degree of the calculated image, specifically including: first, The image is divided into 16*16 small grids. Secondly, the pixels in the small grids are counted respectively. If the mean value of the pixels in the small grid is less than the threshold, N is counted once, and finally the texture feature value N of the image is obtained.
[0094] S303, judging the texture degree of the video: judging the texture degree of the image in the first 30 frames of the video, if the texture feature N of this stage is continuously greater than the threshold, it is judged as positioning occlusion.
[0095] S304, background initialization: taking the currently input image as the background frame, and saving the background frame image and its texture feature value. After the positioning occlusion determination time is over, the first background initialization is performed by default.
[0096] S305, video texture change judgment: When the video image changes from unobstructed to obstructed, a large amount of effective information in the image is lost, and the texture level of the image is greatly reduced. By monitoring the texture feature value N, when the texture feature N of the current frame image gradually exceeds the N of the background frame image, it can be determined that video occlusion has occurred, that is, N 当前帧 -N 背景帧 >N th , N 当前帧 is the texture feature of the current frame image, N 背景帧 is the texture feature of the background image, N this a threshold value. When the current difference between the two is greater than the threshold value, it is determined as video dynamic occlusion and the process goes to S307. Otherwise, the process goes to S306.
[0097] S306, background update. If no occlusion occurs, detection is continued. When the image texture feature remains unchanged for a long time, the background image is updated and the background image is reinitialized. The background frame image does not change at first after being determined. After a long time, the background frame image can be replaced. For example, when judging the second frame, the second frame is used as the background frame image. If the third frame image is not occluded, the second frame image is still used as the background frame when judging the occlusion of the fourth frame image. If 10 consecutive frames are not occluded, the background frame image can be updated to the 12th frame image in the judgment of the 13th frame image.
[0098] S307: Determine that the video is blocked.
[0099] S308, quantify the video occlusion area. When it is determined that the video is in "position occlusion" or "dynamic occlusion", the current occlusion area is quantified by calculating the area of the occluded connected domain in the image. The specific steps are as follows:
[0100] Step 1: Scan all foreground pixels in the canny binary expansion image row by row, and assign a label to each pixel. According to the neighboring relationship between the pixel and its 4-neighborhood, if there is no existing label in its 4-neighborhood, assign it a new label. If there is already a label in its 4-neighborhood, assign it the minimum label in its 4-neighborhood. At the same time, record the equality relationship between pixels belonging to the same connected area but with different label values. The 4-neighborhood of a pixel is as follows: Figure 4 As shown, the four gray squares are the 4-neighborhood of pixel P.
[0101] Step 2, scan and traverse all pixels, merge the pixels in the same connected area with equal relationship into one connected area and assign them the same Lable (here the minimum Lable in the connected area is selected), as shown in Figure 5 shown.
[0102] Step 3, count the number of pixels of each label, get the label with the most pixels, and the area of the connected area represented by the label. Divide the area of the blocked connected area by the area of the original image to get the pixel-level video occlusion ratio.
[0103] S309, outputting the occlusion ratio. The detection results of the three frames are averaged to smooth the output of the video occlusion detection to prevent result jumps caused by noise interference.
[0104] In summary, this embodiment utilizes a time-segmented video occlusion detection method to divide occlusion situations into "positioned occlusion" and "dynamic occlusion", and designs detection methods specifically for different situations, which is more adaptable to the use environment and more practical. The method of decoupling occlusion determination from occlusion quantification uses texture features for occlusion determination to improve the sensitivity of video occlusion detection, and uses occlusion connected domains for occlusion quantification to improve the accuracy of video occlusion detection. The method of quantifying the occlusion area after determining the video occlusion reduces honor calculations, increases the speed of the detection process, and realizes real-time video occlusion detection.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0106] In this embodiment, an image processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0107] Figure 6 is a structural block diagram of an image processing device according to an embodiment of the present invention. Figure 6 As shown, the device comprises:
[0108] A first determination module 62, configured to determine M image regions of the first image based on an edge detection map of the first image, where M is a positive integer;
[0109] A second determination module 64, configured to determine a texture feature value of the first image according to a pixel value in each of the M image regions;
[0110] The third determination module 66 is configured to determine whether the first image is blocked based on the texture feature value of the first image.
[0111] In an exemplary embodiment, the first determining module includes:
[0112] A first determining unit is used to perform a binarization process on the edge detection image to determine a binarized image;
[0113] The second determining unit is used to divide the binary image into regions to determine the M image regions.
[0114] In an exemplary embodiment, the second determining module includes:
[0115] A first calculation unit is used to calculate the average value of the pixel values in each of the M image regions to determine the M pixel average values;
[0116] The third determining unit is used to determine the texture feature value of the first image based on the relationship between the M pixel average values and the first preset pixel threshold.
[0117] In an exemplary embodiment, the third determining unit includes:
[0118] A first determining subunit, configured to determine the number of pixel average values that are less than the first preset pixel threshold from the M pixel average values;
[0119] The second determining subunit is used to determine the texture feature value of the first image based on the quantity.
[0120] In an exemplary embodiment, the third determining module includes:
[0121] a fourth determining unit, configured to determine a texture feature value of a reference image associated with the first image, wherein the reference image includes an image in the target video other than the first image, and a preset number of frames separate the reference image from the first image;
[0122] The fifth determining unit is used to determine whether the first image is blocked based on the relationship between the texture feature value of the first image and the texture feature value of the reference image.
[0123] In an exemplary embodiment, the fifth determining unit includes:
[0124] The sixth determining unit is configured to determine that the first image is blocked in response to the texture feature value of the first image being greater than a first texture feature threshold and the texture feature value of the reference image being greater than the first texture feature threshold.
[0125] In an exemplary embodiment, the fifth determining unit includes:
[0126] a seventh determining unit, configured to determine a difference between a texture feature value of the first image and a texture feature value of a background image, wherein the reference image includes the background image, and the background image includes an image other than an occluded image in the target video;
[0127] An eighth determining unit is configured to determine that the first image is blocked in response to the difference being greater than a second texture feature threshold.
[0128] In an exemplary embodiment, the third determining module includes:
[0129] A ninth determination unit is used to determine that the first image is blocked in response to the texture feature value of the first image not being within a preset texture feature value range, wherein the preset texture feature value range is a pre-configured texture feature value range of an image obtained by normal shooting of the target area during a target shooting time period, the target shooting time period includes a time period for shooting the first image, and the first image is an image obtained after shooting the target area.
[0130] In an exemplary embodiment, the above device further comprises:
[0131] A fourth determining module, configured to determine an obstructed image region in the first image after determining that the first image is obstructed;
[0132] The fifth determining module is used to determine the occlusion assessment information that the first image is occluded based on the occluded image area and the first image.
[0133] In an exemplary embodiment, the above device further comprises:
[0134] The first processing module is used for, after determining the occlusion assessment information that the first image is occluded, to perform smoothing processing on the occluded image area based on the occlusion assessment information of the first image.
[0135] In an exemplary embodiment, the fourth determining module includes:
[0136] a tenth determining unit, configured to determine a label value for each pixel in the edge detection image;
[0137] A first comparison unit is used to compare whether the label value of each pixel is equal to the label value of the neighboring pixel, and determine the comparison result;
[0138] A first merging unit is used to merge pixels with equal label values according to the comparison result to determine connected areas with the same label value;
[0139] An eleventh determining unit is used to determine the blocked image area in the first image based on the connected areas with the same label value.
[0140] In an exemplary embodiment, the fifth determining module includes:
[0141] The twelfth determining unit is used to determine the ratio of the area of the connected region to the area of the first image as the occlusion assessment information that the first image is occluded.
[0142] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0143] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0144] In this embodiment, the computer-readable storage medium may be configured to store a computer program for executing the above steps.
[0145] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0146] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0147] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0148] In an exemplary embodiment, the processor may be configured to execute the above steps through a computer program.
[0149] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0150] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0151] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image processing method, characterized in that: include: Determine M image regions of the first image based on an edge detection map of the first image, where M is a positive integer; Determining a texture feature value of the first image according to a pixel value in each of the M image regions; Determining whether the first image is blocked based on the texture feature value of the first image; Wherein, determining the texture feature value of the first image according to the pixel value in each of the M image regions comprises: calculating the average value of the pixel values in each of the M image regions to determine the M pixel average values; determining the texture feature value of the first image based on the relationship between the M pixel average values and a first preset pixel threshold; Based on the relationship between the M pixel averages and a first preset pixel threshold, determining the texture feature value of the first image includes: determining the number of pixel averages that are less than the first preset pixel threshold from the M pixel averages; and determining the texture feature value of the first image based on the number.
2. The method according to claim 1, characterized in that The determining, based on the edge detection map of the first image, the M image regions of the first image comprises: Binarizing the edge detection image to determine a binary image; The binary image is divided into regions to determine the M image regions.
3. The method according to claim 1, characterized in that The determining, based on the texture feature value of the first image, whether the first image is blocked includes: Determine a texture feature value of a reference image associated with the first image, wherein the reference image includes an image in the target video other than the first image, and a preset number of frames separate the reference image from the first image; Based on the relationship between the texture feature value of the first image and the texture feature value of the reference image, it is determined whether the first image is blocked.
4. The method according to claim 3, characterized in that: The method further comprises: In response to the texture feature value of the first image being greater than a first texture feature threshold, and the texture feature value of the reference image being greater than the first texture feature threshold, it is determined that the first image is blocked.
5. The method according to claim 3, characterized in that: The determining that the first image is blocked based on the relationship between the texture feature value of the first image and the texture feature value of the reference image includes: Determine a difference between a texture feature value of the first image and a texture feature value of a background image, wherein the reference image includes the background image, and the background image includes an image in the target video excluding an occluded image; In response to the difference being greater than a second texture feature threshold, it is determined that the first image is occluded.
6. The method according to claim 1, characterized in that Determining, based on the texture feature value of the first image, that the first image is blocked includes: In response to the texture feature value of the first image not being within a preset texture feature value range, it is determined that the first image is obscured, wherein the preset texture feature value range is a pre-configured texture feature value range of an image obtained by normal shooting of a target area during a target shooting time period, the target shooting time period includes a time period for shooting the first image, and the first image is an image obtained after shooting the target area.
7. The method according to any one of claims 3 to 6, characterized in that: After determining that the first image is blocked, the method further includes: Determining an occluded image region that is occluded in the first image; Based on the occluded image area and the first image, occlusion assessment information indicating that the first image is occluded is determined.
8. The method according to claim 7, after determining the occlusion assessment information that the first image is occluded, the method further comprises: Based on the occlusion evaluation information of the first image, a smoothing process is performed on the occluded image area.
9. The method according to claim 7, characterized in that: The determining the blocked image area blocked in the first image includes: Determining a label value for each pixel in the edge detection image; Compare the label value of each pixel with the label value of the neighboring pixels to see whether they are equal, and determine the comparison result; Merge pixels with equal label values according to the comparison result to determine connected areas with the same label values; The blocked image area in the first image is determined based on the connected areas with the same label value.
10. The method according to claim 9, characterized in that The determining, based on the occluded image area and the first image, occlusion assessment information indicating that the first image is occluded includes: The ratio of the area of the connected region to the area of the first image is determined as occlusion assessment information indicating that the first image is occluded.
11. An image processing device, characterized in that: include: A first determination module, configured to determine M image regions of the first image based on an edge detection map of the first image, wherein M is a positive integer; A second determination module, configured to determine a texture feature value of the first image according to a pixel value in each of the M image regions; A third determination module, configured to determine whether the first image is blocked based on the texture feature value of the first image; The second determination module is further used to calculate the average value of the pixel values in each of the M image regions to determine the M pixel average values; and determine the texture feature value of the first image based on the relationship between the M pixel average values and the first preset pixel threshold value; The second determination module is further used to determine the number of pixel average values that are less than the first preset pixel threshold from the M pixel average values; and determine the texture feature value of the first image based on the number.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the method described in any one of claims 1 to 10 when executed by a processor.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Video occlusion detection method and device
CN106599783A
Monitoring video occlusion detection method and system
CN111723644A
Camera shielding detection method and device, storage medium and electronic equipment
CN111970405A