Image data detection method, device, computer equipment and storage medium
By performing edge detection and verification of the detection image, the problem of low detection accuracy of the existing ground glass detection model is solved, and the accuracy of the target Gaussian fuzzy position is improved.
Patent Information
- Application Number
- CN202011494792.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2040-12-17
AI Technical Summary
The detection accuracy of existing ground glass detection models is low, resulting in low detection accuracy of ground glass special effects in images, especially when the training samples are incomplete or the training results are not good.
By acquiring the detected image for edge detection, the initial Gaussian blur position is determined, and input it into the verification model for verification. The verification model is obtained by training the target sample image, which is a sample image in which there is a Gaussian blur position based on edge detection in at least two sample images.
The accuracy of detecting the target Gaussian blur position in the image is improved, and the initial Gaussian blur position is checked through the verification model, which enhances the accuracy of the detection results.
Smart Images

Figure CN113516674B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to an image data detection method, apparatus, computer equipment and storage medium. Background Art
[0002] With the continuous development of computer networks, image processing technology has penetrated into every aspect of daily life, such as image processing technology that adds frosted glass effects to image data.
[0003] In the prior art, the position of the frosted glass effect added to the image can usually be detected by a frosted glass detection model. It can be seen that whether the detected image has a frosted glass effect and the specific position of the frosted glass effect are both dependent on the detection accuracy of the frosted glass detection model. Therefore, when the training samples of the frosted glass detection model are incomplete or the training effect of the frosted glass detection model is not good, it will directly lead to low detection accuracy of the frosted glass detection model, and further lead to low accuracy of the frosted glass effect of the image detected by the frosted glass detection model. Summary of the invention
[0004] The present application provides an image data detection method, apparatus, computer equipment and storage medium, which can improve the accuracy of the detected target Gaussian blur position.
[0005] On one hand, the present application provides an image data detection method, comprising:
[0006] Acquire a detection image, perform edge detection on the detection image, and obtain an edge detection result;
[0007] When it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image, the detection image is input into the verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training the target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection among at least two sample images;
[0008] According to the initial Gaussian blur position and the verification result, the target Gaussian blur position of the detection image is determined.
[0009] On one hand, the present application provides an image data detection device, comprising:
[0010] The edge detection module is used to obtain a detection image, perform edge detection on the detection image, and obtain an edge detection result;
[0011] A verification module is used for inputting the detection image into a verification model to obtain a verification result for the initial Gaussian blur position when it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image; the verification model is obtained by training a target sample image; the target sample image is a sample image in which a sample Gaussian blur position obtained based on edge detection exists among at least two sample images;
[0012] The position determination module is used to determine the target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result.
[0013] The verification result includes a first verification result and a second verification result; the first verification result indicates that the detected image is an image after Gaussian blurring; the second verification result indicates that the detected image is an image after Gaussian blurring;
[0014] Position determination module, including:
[0015] A first position determining unit, configured to determine the initial Gaussian blur position as the target Gaussian blur position when the verification result is the first verification result;
[0016] The second position determining unit is used to determine that the target Gaussian blur position is empty when the verification result is the second verification result.
[0017] Wherein, the location determination module includes:
[0018] A straight line detection unit is used to perform image straight line detection on the detection image to obtain a detection straight line in the detection image when the verification result is a first verification result; the first verification result indicates that the verification result of the detection image is an image after Gaussian blur;
[0019] The target position determination unit is used to determine the target Gaussian blur position according to the detection straight line and the initial Gaussian blur position.
[0020] Wherein, the target position determination unit includes:
[0021] A first position determination subunit, configured to determine an initial Gaussian blur position as a target Gaussian blur position when the number of detected straight lines is a first number;
[0022] a second position determination subunit, configured to determine the initial Gaussian blur position as the target Gaussian blur position when the number of detection lines is a second number and the distance between the detection lines and the image center axis of the detection image is less than a distance threshold; and the second number is greater than the first number;
[0023] a third position determination subunit, configured to, when the number of detection lines is a second number and the distance between the detection lines and the image center axis of the detection image is greater than or equal to a distance threshold, symmetrically flip the detection lines based on the image center axis to obtain symmetrical detection lines, and determine the target Gaussian blur position according to the detection lines and the symmetrical detection lines;
[0024] The fourth position determination subunit is used to determine the target Gaussian blur position according to the initial Gaussian blur position and the detection line with the largest distance from the image center axis when the number of detection lines is a third number; the third number is greater than the second number.
[0025] The above device further comprises:
[0026] A sample detection module, used for performing edge detection on at least two sample images, and determining the sample image at the sample Gaussian blur position detected by the edge detection as the target sample image;
[0027] An image input module is used to input a target sample image into an initial verification model; the target sample image carries a sample label; the sample label is a first sample label or a second sample label; the first sample label represents that the target sample image is an image after Gaussian blurring; the second sample label represents that the target sample image is an image without Gaussian blurring;
[0028] A result output module is used to output a sample verification result for a target sample image in an initial verification model; the sample verification result is a first sample verification result or a second sample verification result; the first sample verification result indicates that the target sample image is verified to be an image after Gaussian blurring; the second verification result indicates that the target sample image is verified to be an image after Gaussian blurring;
[0029] The correction module is used to correct the model parameters of the initial verification model according to the sample verification results and the sample labels carried by the target sample image to obtain the verification model.
[0030] The edge detection module includes:
[0031] A convolution unit, used for performing a convolution operation on the detection image based on the edge detection convolution kernel to obtain an edge image of the detection image;
[0032] The result determination unit is used to determine the edge detection result for the detection image according to the edge image.
[0033] Among them, the convolution unit includes:
[0034] A low-pass convolution subunit, used for performing a convolution operation on the detection image based on the low-pass convolution kernel to obtain a low-frequency signal image of the detection image when the edge detection convolution kernel is a low-pass convolution kernel;
[0035] A signal filtering subunit, used to filter the low-frequency signal image in the detection image to obtain an edge image of the detection image; or
[0036] The high-pass convolution subunit is used to perform a convolution operation on the detection image based on the high-pass convolution kernel when the edge detection convolution kernel is a high-pass convolution kernel, so as to obtain an edge image of the detection image.
[0037] wherein the edge image includes edge detection values in at least two unit columns;
[0038] The result determination unit comprises:
[0039] A summing subunit is used to sum the edge detection values in each unit column of the edge image to obtain the edge sum value corresponding to each unit column;
[0040] A vector generating unit, used for generating an edge detection vector according to the edge sum values corresponding to each unit column;
[0041] The traversal unit is used to traverse the edge sum value in the edge detection vector based on the edge detection threshold, and determine the edge detection result according to the traversal result.
[0042] Among them, the traversal unit includes:
[0043] A first traversal subunit is used to traverse the edge sum values in the edge detection vector in sequence according to a first traversal order, stop traversing when an edge sum value greater than or equal to an edge detection threshold is traversed, and determine a first edge position according to the traversed edge sum value greater than or equal to the edge detection threshold;
[0044] A second traversal subunit is used to traverse the edge sum values in the edge detection vector in sequence according to a second traversal order, stop traversing when an edge sum value greater than or equal to the edge detection threshold is traversed, and determine a second edge position according to the traversed edge sum value greater than or equal to the edge detection threshold;
[0045] The edge result determination subunit is used to determine the first edge position and the second edge position as edge detection results.
[0046] Wherein, the edge detection result includes the first edge position and the second edge position of the detected detection image; the initial Gaussian blur position includes the first Gaussian blur position and the second Gaussian blur position;
[0047] Verification module, including:
[0048] A blur width value determining unit, used to determine a first Gaussian blur width value according to a first edge position, and to determine a second Gaussian blur width value according to a second edge position;
[0049] a clear width value determining unit, used to determine a clear image width value of the detection image according to the first Gaussian blur width value, the second Gaussian blur width value and the image width value of the detection image;
[0050] A model input unit is used to determine the first edge position as the first Gaussian blur position, the second edge position as the second Gaussian blur position, and input the detection image into the verification model when the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold and the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval.
[0051] The edge detection module includes:
[0052] A black edge cropping unit is used to detect a black edge image in a detection image, and crop the black edge image in the detection image to obtain a target image;
[0053] The target detection unit is used to perform edge detection on the target image to obtain an edge detection result.
[0054] Among them, the edge detection module is also used for:
[0055] Divide the video data into frames to obtain at least two image frames, and determine the at least two image frames as detection images;
[0056] The above device also includes:
[0057] An image cropping module is used to crop the detection image based on the target Gaussian blur position to obtain a clear image in the detection image;
[0058] A clear picture generation module, used for generating clear picture video data of video data according to the clear image;
[0059] The clear picture output module is used to output clear picture video data in the client page.
[0060] On one hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method in the present application.
[0061] On one hand, the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the above method.
[0062] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the above various optional modes.
[0063] The present application can first obtain a detection image, perform edge detection on the detection image, and obtain an edge detection result; when it is determined that there is an initial Gaussian blur position in the detection image according to the edge detection result, the detection image can be input into a verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training a target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection in at least two sample images; and then the target Gaussian blur position of the detection image is determined according to the initial Gaussian blur position and the verification result. It can be seen that after the method proposed in the present application performs edge detection on the detection image to obtain the initial Gaussian blur position of the detection image, the initial Gaussian blur position can also be verified by the verification model to obtain a verification result for the initial Gaussian blur position. And the verification model is also obtained by training a specific sample image in which a sample Gaussian blur position is detected based on edge detection, so the target Gaussian blur position of the detection image obtained by the initial Gaussian blur position and the verification result will be more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 It is a structural diagram of a network architecture provided by an embodiment of the present application;
[0066] Figure 2 It is a schematic diagram of an image processing scene provided by this application;
[0067] Figure 3 It is a flowchart of an image data detection method provided by the present application;
[0068] Figure 4 This is a schematic diagram of a scene for obtaining an edge image provided by the present application;
[0069] Figure 5 This is a schematic diagram of a scenario for obtaining edge vectors provided by the present application;
[0070] Figure 6 This is a schematic diagram of a scenario for obtaining edge positions provided by this application;
[0071] Figure 7 This is a schematic diagram of a model training scenario provided by this application;
[0072] Figure 8 This is a schematic diagram of an image detection scenario provided by this application;
[0073] Fig. 9 This is a schematic diagram of a scene for obtaining a Gaussian blur position provided by the present application;
[0074] Fig.10 This is a schematic diagram of a frosted glass detection scenario provided by the present application;
[0075] Fig.11 It is a schematic diagram of an image processing scene provided by this application;
[0076] Fig.12 It is a structural schematic diagram of an image data detection device provided by the present application;
[0077] Fig.13 It is a structural schematic diagram of a computer device provided by this application. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0079] This application involves artificial intelligence related technologies. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0080] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0081] This application mainly involves machine learning in artificial intelligence. Among them, machine learning (ML) is a multi-field interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by teaching.
[0082] The machine learning involved in this application mainly refers to obtaining a correction model through machine learning, through which the initial Gaussian blur position of the detection image can be corrected. For details, please refer to the following Figure 3 Related description in the corresponding embodiment.
[0083] See also Figure 1 , Figure 1 Schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1 As shown, the network architecture may include a server 200 and a terminal device cluster, and the terminal device cluster may include one or more terminal devices, and the number of terminal devices is not limited here. Figure 1 As shown, the multiple terminal devices may specifically include a terminal device 100a, a terminal device 101a, a terminal device 102a, ..., a terminal device 103a; Figure 1 As shown, the terminal device 100a, the terminal device 101a, the terminal device 102a, ..., the terminal device 103a can all be connected to the server 200 through a network, so that each terminal device can exchange data with the server 200 through the network connection.
[0084] like Figure 1The server 200 shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal device can be: a smart terminal such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, etc. The following takes the communication between the terminal device 100a and the server 200 as an example to describe the embodiment of the present application in detail. The terminal device 100a can carry a client, which can be any type of client such as a video client, a browser client, an education client, a game client, and / or a communication application client. The terminal device 100a can interact with the server 200 through the carried client. For example, the terminal device 100a can obtain the video data sent by the server 200 through the carried client, and then the terminal device 100a can play the obtained video data through the carried client. Please refer to the following content description for details.
[0085] Please also see Figure 2 , Figure 2 This is a schematic diagram of an image processing scenario provided by this application. Figure 2 As shown, the detection image 100b can be any image, and the server 200 can detect the detection image 100b, that is, detect whether the detection image 100b is added with a frosted glass effect, and the position of the added frosted glass effect, please refer to the following description.
[0086] Adding a frosted glass effect to an image means performing Gaussian blur on the image. The server 200 can perform edge detection on the detection image 100b. When the server 200 performs edge detection on the detection image 100b and obtains the initial Gaussian blur position 101b of the detection image 100b, it indicates that the detection image 100b is detected as an image with a frosted glass effect by performing edge detection on the image 100b. The initial Gaussian blur position 101b is the position of the frosted glass effect added to the detection image 100b detected by performing edge detection on the detection image 100b. The position of the frosted glass effect is the boundary of the frosted glass effect. For the specific process of performing edge detection on the detection image 100b to obtain the initial Gaussian blur position 101b, please refer to the following Figure 3 The corresponding step is S101 in the embodiment.
[0087] When the server 200 obtains the initial Gaussian blur position 101b of the detection image 100b, the server 200 can also continue to input the detection image 100b into the verification model 102b, and the verification model 102b can further detect whether the above detection image 100b is added with the frosted glass effect. The training process of the verification model 102b can be referred to as follows Figure 3 The corresponding step is S102 in the embodiment.
[0088] Therefore, it can be understood that after inputting the detection image 100b into the verification model 102b, a verification result 103b for the detection image 100b can be obtained. The verification result 103b indicates whether the detection image 100b detected by the verification model 102b is an image with a frosted glass effect added or not.
[0089] Furthermore, the server 200 can obtain the target Gaussian blur position 104b in the detection image 100b through the verification result 103b and the initial Gaussian blur position 101b. The target Gaussian blur position 104b is the position of the frosted glass effect added to the detection image 100b that is finally detected. The specific process of obtaining the target Gaussian blur position of the detection image 100b through the verification result 103b and the initial Gaussian blur position 101b can also be referred to below. Figure 3 This corresponds to step S103 in the embodiment.
[0090] like Figure 2 As shown, the target Gaussian blur position 104b may include a left frosted glass boundary 105b and a right frosted glass boundary 106b. The left frosted glass boundary 105b may correspond to the first Gaussian blur position in step S103, and the right frosted glass boundary 105b may correspond to the second Gaussian blur position in step S103.
[0091] Therefore, the server 200 can obtain the area of frosted glass special effects added in the left image area of the detection image 100b (i.e., the left frosted glass area) through the left frosted glass boundary 105b, and can obtain the area of frosted glass special effects added in the right image area of the detection image 100b (i.e., the right frosted glass area) through the right frosted glass boundary 106b.
[0092] Furthermore, the server 200 can crop the detection image 100b according to the left frosted glass area and the right frosted glass area obtained above, that is, crop the image area with frosted glass effects added in the detection image 100b, and obtain a partial image of the detection image 100b without frosted glass effects added. This partial image can be called a clear image 107b in the detection image 100b.
[0093] Among them, the detection image 100b can be any image frame obtained after framing the video data with frosted glass effects added. Therefore, the server 200 can adopt the same method as that of obtaining the clear image 107b without frosted glass effects added in the detection image 100b to obtain the partial image without frosted glass effects added in each image frame of the video data. The server 200 can generate a new video data based on the partial image without frosted glass effects added in each image frame. Compared with the original video data, the partial picture data with frosted glass effects added in the new video data is cropped. Since the video data with frosted glass effects added will affect the user's perception, the server 200 can synchronize the new video data to the terminal device 100a, so that the terminal device 100a can play the new video data without playing the original video data, which can improve the user's perception of the video data.
[0094] Among them, the server 200 can be the background server of the client carried by the terminal device 100a. Therefore, the server 200 can send the new video data obtained after the above-mentioned cropping of the frosted glass image to the client carried by the terminal device 100a, and then the terminal device 100a can play the received new video data through the carried client.
[0095] Using the method provided in the present application, after the initial Gaussian blur position of the detection image is detected after edge detection, the verification model can be used to further verify whether the detection image has been added with a frosted glass effect, which improves the accuracy of the detection results finally obtained for the detection image.
[0096] See also Figure 3 , Figure 3 is a flow chart of an image data detection method provided by the present application, such as Figure 3 As shown, the method may include:
[0097] Step S101, acquiring a detection image, performing edge detection on the detection image, and obtaining an edge detection result;
[0098] Specifically, the execution subject in the embodiment of the present application can be a computer device or a computer device cluster composed of multiple computer devices. The computer device can be a server or a terminal device. Therefore, the execution subject in the embodiment of the present application can be a server, a terminal device, or a server and a terminal device. Here, the server is used as an example to illustrate the execution subject in the embodiment of the present application.
[0099] The detection image may be any image, for example, the detection image may be any image frame among a plurality of (at least two) image frames obtained after framing the video data. After acquiring the detection image, the server may perform edge detection on the detection image to obtain an edge detection result for the detection image. The process of performing edge detection on the detection image may be the following process, but is not limited to the following process:
[0100] First, the server may use an edge detection convolution kernel to perform a convolution operation on the detection image to obtain an edge image of the detection image. The edge detection convolution kernel may be a high-pass convolution kernel or a low-pass convolution kernel. Since the edge image is an image that retains the high-frequency signal in the detection image, when the edge detection convolution kernel is a high-pass convolution kernel, the edge detection image may be directly convolved with the high-pass convolution kernel to obtain an edge image that retains the high-frequency signal in the detection image.
[0101] Alternatively, when the edge detection convolution kernel is a low-pass convolution kernel, the server can use the low-pass convolution kernel to perform a convolution operation on the detection image, and can obtain an image that retains the low-frequency signal in the detection image. The image that retains the low-frequency signal in the detection image can be called a low-frequency signal image. Furthermore, the server can use the detection image to subtract the low-frequency signal image to obtain an edge image of the detection image. For example, the low-pass convolution kernel can be a 3×3 low-pass mean convolution kernel.
[0102] The image sizes of the detection image and the low-frequency signal image are the same. When the detection image is subtracted from the low-frequency signal image, the pixel values at corresponding positions in the detection image and the low-frequency signal image can be subtracted to obtain the edge image of the detection image. The behavior of subtracting the low-frequency signal image from the detection image can be understood as filtering out the low-frequency signal image in the detection image, that is, filtering out its low-frequency image signal in the detection image and retaining its high-frequency image signal.
[0103] See also Figure 4 , Figure 4 Schematic diagram of a scene for obtaining edge images provided by this application. Figure 4 As shown, the detection image 100c includes 9 elements, which are a1, a2, a3, a4, a5, a6, a7, a8 and a9. Both the low-pass convolution kernel and the high-pass convolution kernel belong to edge detection convolution kernels.
[0104] The server can perform a convolution operation on the detection image 100c through a low-pass convolution kernel to obtain a low-frequency signal image 101c, which includes the low-frequency signal in the detection image 100c. The low-frequency signal image 101c also includes 9 elements, which are b1, b2, b3, b4, b5, b6, b7, b8 and b9.
[0105] The server can use the element value of each element in the detection image 100c to subtract the element value of each element in the low-frequency signal image 101c to obtain the edge image 102c. The edge image 102c also includes 9 element values, which are c1, c2, c3, c4, c5, c6, c7, c8 and c9.
[0106] Among them, c1 can be equal to a1 minus b1, c2 can be equal to a2 minus b2, c3 can be equal to a3 minus b3, c4 can be equal to a4 minus b4, c5 can be equal to a5 minus b5, c6 can be equal to a6 minus b6, c7 can be equal to a7 minus b7, c8 can be equal to a8 minus b8, and c9 can be equal to a9 minus b9.
[0107] Alternatively, the server may directly perform a convolution operation on the detection image 100c through a high-pass filter, i.e., an edge image 103c. The edge image 103c also includes 9 elements, which are d1, d2, d3, d4, d5, d6, d7, d8 and d9.
[0108] After the server obtains the edge image of the detection image, it can obtain the edge detection result for the detection image according to the edge image. Please refer to the following description:
[0109] The edge image may be of size m×n, which means that the edge image has m rows and n columns. The element value of each element in the edge image may be referred to as an edge detection value, and each column in the edge image may be referred to as a unit column in the edge image, so a unit column in the edge image may include m edge detection values.
[0110] The server can sum the m edge detection values in each unit column in the edge image to obtain a sum value corresponding to each unit column, which can be called an edge sum value. Therefore, the edge sum value corresponding to a unit column is the value obtained by summing the m edge detection values in the unit column. The server can generate an edge detection vector based on the edge sum values corresponding to each unit column, and the edge detection vector includes the edge sum values corresponding to each unit column. The order of the edge sum values corresponding to each unit column in the edge detection vector is also the order of each unit column in the edge image.
[0111] See also Figure 5 , Figure 5 This is a schematic diagram of a scenario for obtaining edge vectors provided by this application. Figure 5 As shown, the edge image 100d may have five columns, including unit column 1, unit column 2, unit column 3, unit column 4, and unit column 5.
[0112] Among them, unit column 1 includes edge detection value c1, edge detection value c6, edge detection value c11, edge detection value c16 and edge detection value c21. Unit column 2 includes edge detection value c2, edge detection value c7, edge detection value c12, edge detection value c17 and edge detection value c22. Unit column 3 includes edge detection value c3, edge detection value c8, edge detection value c13, edge detection value c18 and edge detection value c23. Unit column 4 includes edge detection value c4, edge detection value c9, edge detection value c14, edge detection value c19 and edge detection value c24. Unit column 5 includes edge detection value c5, edge detection value c10, edge detection value c15, edge detection value c20 and edge detection value c25.
[0113] Therefore, the edge detection values in unit column 1 can be summed to obtain the first edge summation value c1+c6+c11+c16+c21 in the detection vector. The edge detection values in unit column 2 can be summed to obtain the second edge summation value c2+c7+c12+c17+c22 in the detection vector. The edge detection values in unit column 3 can be summed to obtain the third edge summation value c3+c8+c13+c18+c23 in the detection vector. The edge detection values in unit column 4 can be summed to obtain the fourth edge summation value c4+c9+c14+c19+c24 in the detection vector. The edge detection values in unit column 4 can be summed to obtain the fifth edge summation value c5+c10+c15+c20+c25 in the detection vector.
[0114] After obtaining the edge vector, the server can traverse the edge sum values in the edge vector to obtain the edge detection result: first, the server can traverse the edge sum values in the edge vector in order from left to right, and when the edge sum value greater than or equal to the edge detection threshold is traversed, the traversal can be stopped, and the corresponding image position of the edge sum value greater than or equal to the edge detection threshold in the detection image can be referred to as the first edge position. Among them, the order of traversing the edge sum values in the edge vector from left to right can be referred to as the first traversal order.
[0115] Similarly, the server can traverse the edge sum values in the edge vector in order from right to left. When the edge sum value greater than or equal to the edge detection threshold is traversed, the traversal can be stopped, and the corresponding image position of the edge sum value greater than or equal to the edge detection threshold in the detection image can be referred to as the second edge position. Among them, the order of traversing the edge sum values in the edge vector from right to left can be referred to as the second traversal order.
[0116] The size of the edge detection threshold can be set according to the actual application scenario. For example, the edge detection threshold can be determined according to the edge sum value in the edge vector. For example, the value s1 times the maximum edge sum value in the edge vector can be used as the edge detection threshold. s1 can be a value between 0 and 1, such as s1 can be equal to 0.32.
[0117] The server may use the first edge position and the second edge position as edge detection results for the detection image.
[0118] See also Figure 6 , Figure 6 This is a schematic diagram of a scenario for obtaining edge positions provided by this application. Figure 6 As shown, the detection vector 101e may include edge sum value x1, edge sum value x2, ... and edge sum value x50. The server may traverse the edge sum values in the detection vector 101e from left to right in the first traversal order, and find that the edge sum value x3 is the first traversed edge sum value greater than or equal to the edge detection threshold, and the edge sum value x1 and the edge sum value x2 are both less than the edge detection threshold. Therefore, the server may use the position corresponding to the edge sum value x3 in the detection image as the first edge position.
[0119] It can be understood that the number of edge sum values in the detection vector 101e is equal to the number of pixels contained in the length of the detection image. Since the edge sum value x3 is the third element in the edge vector 101e, the position corresponding to the edge sum value x3 in the detection image can be the position of the third pixel from left to right in the detection image.
[0120] Similarly, the server can traverse the edge sum values in the detection vector 101e from right to left in the second traversal order, and find that the edge sum value x47 is the first edge sum value traversed that is greater than or equal to the edge detection threshold, and the edge sum value x48, the edge sum value x49 and the edge sum value 50 are all less than the edge detection threshold. Therefore, the server can use the position corresponding to the edge sum value 47 in the detection image as the second edge position.
[0121] It can be understood that the number of edge sum values in the detection vector 101e is equal to the number of pixels contained in the length of the detection image. Since the edge sum value x47 is the 47th element in the edge vector 101e, the position corresponding to the edge sum value x47 in the detection image can be the position of the 47th pixel from left to right in the detection image.
[0122] Optionally, in some scenarios, the detection image may have black edges, which do not fall within the scope of Gaussian blur. Therefore, after acquiring the detection image, the server can also detect the black-edge image in the detection image. When the server detects the black-edge image in the detection image, the server can crop the detected black-edge image from the detection image. The image after the black-edge image is cropped from the detection image can be called the target image. Furthermore, the server can perform edge detection on the target image, and can also obtain edge detection results for the detection image.
[0123] Optionally, if the detection image is added with a Gaussian blur effect, then usually the entire height of the detection image is added with the Gaussian blur effect, while part of the width is not added with the Gaussian blur effect. Therefore, in order to improve the detection efficiency, the detection image can be cropped, and an image of a specified size in the middle of the detection image (which can be called a cropped image) is cropped for edge detection, and the edge detection result for the detection image can also be obtained. For example, the top 25% of the image and the bottom 25% of the image of the detection image can be cropped, so the cropped image can be a partial image in the middle area of the detection image whose height is 50% of the height of the entire image of the detection image, and the width of the cropped image is the same as the width of the entire image of the detection image.
[0124] It should be noted that if the first edge position and the second edge position are the same position, then the detection image can be considered to be an image that has not been Gaussian blurred, and subsequent steps can be omitted, and the detection of the detection image is completed.
[0125] Alternatively, if the first edge position and the second edge position detected above are the same position (which may be referred to as a single edge position), the single edge position may be symmetrically flipped with the image center axis of the detection image as the symmetry axis to obtain the symmetrical position of the single edge position in the detection image. The server may use the single edge position and the position on the left side of the detection image as the first edge position, and the single edge position and the position on the right side of the detection image as the second edge position.
[0126] Step S102, when it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image, the detection image is input into the verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training the target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection among at least two sample images;
[0127] Specifically, after obtaining the above edge detection result, the server can also verify whether the initial Gaussian blur position in the detection image can be obtained through the edge detection result, as described in the following content:
[0128] It can be understood that Gaussian blur is a professional term for frosted glass. Adding frosted glass effects to an image is to perform Gaussian blur on the image. Therefore, the server can obtain the width of the image that is Gaussian blurred in the left image area of the detected image according to the first edge position in the edge detection result. This width is the width between the leftmost image position of the detected image and the first edge position. This width can be called the first Gaussian blur width value.
[0129] Similarly, the server can obtain the width of the image subjected to Gaussian blur in the right image area of the detected image based on the second edge position in the edge detection result. This width is also the width between the rightmost image position of the detected image and the second edge position. This width can be called the second Gaussian blur width value.
[0130] The entire image width of the detection image may be referred to as the image width value of the detection image. The server may subtract the first Gaussian blur width from the image width value of the detection image, and then subtract the second Gaussian blur width to obtain the width of the image in the detection image that is not Gaussian blurred, and this width may be referred to as the clear image width value.
[0131] The server can compare whether the difference between the first Gaussian blur width value and the second Gaussian blur width value (the absolute value of the difference) is less than or equal to the width symmetry detection threshold. When the comparison shows that the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold, it can be considered that the first edge position and the second edge position are symmetrical to each other in the detected image.
[0132] On the contrary, when the difference between the first Gaussian blur width value and the second Gaussian blur width value is greater than the width symmetry detection threshold, it can be considered that the first edge position and the second edge position are not symmetrical with each other in the detected image. Among them, the above-mentioned width symmetry detection threshold can be set according to the actual application scenario, such as the width symmetry detection threshold can be equal to s2 times the image width value of the detected image, s2 can be a value between 0 and 1, such as s2 can be equal to 0.25. In actual application scenarios, the positions of the frosted glass effects added on the left and right sides of an image are usually symmetrical.
[0133] The entire image height of the detection image can be referred to as the image height value of the detection image, and the server can also obtain the ratio between the clear image width value and the image height value of the detection image. When the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval, the first edge position and the second edge position can be considered to be reasonable. On the contrary, when the ratio between the clear image width value and the image height value of the detection image is not in the ratio detection interval, the first edge position and the second edge position can be considered to be unreasonable. The ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval, which means that the ratio between the clear image width value and the image height value of the detection image is greater than or equal to the lower limit value (lower interval) of the ratio detection interval, and the ratio between the clear image width value and the image height value of the detection image is less than or equal to the upper limit value (upper interval) of the ratio detection interval.
[0134] Among them, the upper limit and lower limit of the ratio detection interval can be set according to the actual application scenario. The ratio between the clear image width value and the image height value of the detection image needs to be greater than or equal to the lower limit of the ratio detection interval in order to ensure that the width of the image in the detection image that is not Gaussian blurred (which can be called the clear image in the detection image) is not too small compared to the image width value of the detection image.
[0135] The ratio of the clear image width value to the image height value of the detection image needs to be less than or equal to the upper limit value of the ratio detection interval. This is because when a video image is played in portrait mode, the width of the left and right sides of the video image is not enough to fill the entire screen. Therefore, when the video image is played in portrait mode, a frosted glass effect can be added to the blank spaces on the left and right sides of the video image.
[0136] Therefore, when the ratio between the clear image width value and the image height value of the detection image is less than or equal to the upper limit of the ratio detection interval, it can be considered that the video data is played in portrait mode rather than landscape mode. Conversely, when the ratio between the clear image width value and the image height value of the detection image is greater than the upper limit of the ratio detection interval, it can be considered that the video data is played in landscape mode rather than portrait mode.
[0137] Therefore, when the difference between the first Gaussian blur width value and the second Gaussian blur width value is greater than the width symmetry detection threshold, and the ratio between the clear image width value and the image height value of the detection image is not in the ratio detection interval, it can be considered that the initial Gaussian blur position in the detection image is not obtained according to the edge detection result, then it can be considered that the detection image has not been added with frosted glass effects, and there is no need to input the detection image into the verification model, and the detection of the detection image can be stopped.
[0138] On the contrary, when the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold, and the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval, the first edge position can be used as the first Gaussian blur position, and the second edge position can be used as the second Gaussian blur position. The first Gaussian blur position is also the position of the frosted glass effect added in the left image area of the detection image. The second Gaussian blur position is also the position of the frosted glass effect added in the right image area of the detection image.
[0139] The first Gaussian blur position and the second Gaussian blur position are the initial Gaussian blur positions in the detection image obtained by the server according to the edge detection result. After the server obtains the initial Gaussian blur position, it indicates that the detection image is an image after Gaussian blurring by edge detection on the detection image, and the server can continue to input the detection image into the verification model.
[0140] The verification model can perform recognition verification on the input detection image to obtain a verification result for the detection image, which is also a verification result for the initial Gaussian blur position. The verification result can indicate whether the verification model detects that the detection image is added with a frosted glass effect or not.
[0141] Here is a detailed description of how to verify the initial verification model to obtain the verification model:
[0142] The model structure of the initial verification model can be seen in Table 1 below:
[0143]
[0144]
[0145] Table 1
[0146] Among them, ReLU is an activation function.
[0147] First, multiple (at least two) sample images can be prepared, and the server can perform edge detection on the multiple sample images. The server can use the sample image with the sample Gaussian blur position detected after edge detection on the multiple sample images as the target sample image. The server can use the target sample image as training data for the initial verification model, and train the initial verification model through the target sample image.
[0148] The process in which the server performs edge detection on the multiple sample images to detect the sample Gaussian blur positions of the sample images is the same as the process in which the server performs edge detection on the detection image to detect the initial Gaussian blur position in the detection image, and will not be described in detail here. That is, the detection method of the sample Gaussian blur position is the same as the detection method of the initial Gaussian blur position.
[0149] The server can input the target sample image into the initial verification model, and the initial verification model can identify the target sample image to obtain a sample verification result for the target sample image. The sample verification result can be a first sample verification result and a second sample verification result. The first sample result represents that the initial verification model recognizes that the target sample image is an image after Gaussian blurring, that is, the first sample result represents that the initial verification model recognizes that the target sample image is an image with frosted glass effects added. The second sample result represents that the initial verification model recognizes that the target sample image is not an image after Gaussian blurring, that is, the second sample result represents that the initial verification model recognizes that the target sample image is not an image with frosted glass effects added.
[0150] The target sample image is also added with a sample label, which may be a first sample label and a second sample label. The target sample image with the first sample label is actually an image after Gaussian blurring, that is, the target sample image with the first sample label is actually an image with a frosted glass effect added. The target sample image with the second sample label is actually an image without Gaussian blurring, that is, the target sample image with the second sample label is actually an image without a frosted glass effect added.
[0151] Therefore, the server can correct the model parameters of the initial verification model according to the sample label added to the target sample image and the sample verification result of the target sample image identified by the initial verification model: when the sample verification result detected by the initial detection model is the first sample verification result, and the sample label added to the target sample image is the second sample label, it indicates that the initial verification model fails to recognize the target sample image, and the server needs to correct the model parameters of the initial verification model so that when the sample label added to the target sample image is the second sample label, the sample verification result for the target sample image identified by the initial verification model can also be the second verification result.
[0152] Similarly, when the sample verification result detected by the initial detection model is the second sample verification result, and the sample label added to the target sample image is the first sample label, it also indicates that the initial verification model fails to recognize the target sample image. The server needs to correct the model parameters of the initial verification model so that when the sample label added to the target sample image is the first sample label, the sample verification result for the target sample image identified by the initial verification model can also be the first verification result.
[0153] Therefore, the model parameters of the initial verification model can be corrected through several target sample images, and the initial verification model whose model parameters are corrected through several target sample images can be used as the above verification model. When the initial verification model is trained through several target sample images until convergence, it can be considered that the model parameters of the initial verification model are corrected, or when the initial verification model is trained through a sufficient number of target sample images, it can also be considered that the model parameters of the initial verification model are corrected.
[0154] As can be seen from the above, the verification model is obtained by training a sample image with a sample Gaussian blur position detected based on edge detection. The verification model is a model specifically used to verify the detection results of edge detection. Therefore, after edge detection is performed on the above detection image, the detection accuracy of the detection image can be improved by verifying and identifying the detection image through the verification model. Since the detection image is input into the verification model only after the initial Gaussian blur position is detected by edge detection of the detection image, the verification model verifies and identifies the detection image, which is also a verification of the initial Gaussian blur position detected by the edge detection.
[0155] See also Figure 7 , Figure 7This is a schematic diagram of a scenario for model training provided by the present application. First, the sample data set 100f may include multiple sample images, and the multiple sample images may be sample images that are manually annotated with sample labels. The server may use a coarse detection method 101f to detect the multiple sample images. The coarse detection method 101f may be an edge detection method, and the details may refer to the above step S101.
[0156] By using the rough detection method 101f to detect multiple sample data in the sample data set 100f, a rough detection result 102f can be obtained, and the rough detection result 102f can include a frosted glass detection result 103f and a non-frosted glass detection result 104f. Among them, the frosted glass detection result 103f includes a sample image whose sample Gaussian blur position is detected by the rough detection method, that is, the above-mentioned target sample image. And the non-frosted glass detection result 104f includes a sample image whose sample Gaussian blur position is not detected by the rough detection method.
[0157] Therefore, the server can use the sample image included in the frosted glass detection result 103f as training sample data to train the initial verification model (ie, model training 105f). By using the sample image included in the frosted glass detection result 103f to train the initial verification model, a verification model 106f can be obtained.
[0158] See also Figure 8 , Figure 8 This is a schematic diagram of an image detection scenario provided by this application. Figure 8 As shown, first, the detection image 100g can be cropped and scaled 101g. By cropping and scaling the detection image 100g, the detection efficiency of the detection image 100g can be improved. For example, the middle part image 104g of the detection image (such as the cropped image in the above step S101) can be cropped, and the partial image 104b includes a partial area of the left frosted glass area and a partial area of the right frosted glass area of the detection image 100g. Therefore, it is only necessary to perform edge detection 102g on the partial image 104g, and after obtaining the edge vector 105g of the partial image 104g, the edge vector 105g is scanned 106g on the left and right boundaries (i.e., the elements in the edge vector 105g are traversed according to the first traversal order and the second traversal order respectively), and the initial Gaussian blur position of the detection image (i.e., the rough detection result 107g) can also be obtained. If the initial Gaussian blur position is accurate, then the first edge position in the initial Gaussian blur position should be the left boundary of the frosted glass, and the second edge position should be the right boundary of the frosted glass.
[0159] Step S103, determining the target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result;
[0160] Specifically, the verification result of the detection image verified by the verification model may include a first verification result and a second verification result. The first verification result indicates that the verification model verifies that the detection image is an image after Gaussian blurring, that is, it verifies that the detection image is added with a frosted glass effect. The second verification result indicates that the verification model verifies that the detection image is not an image after Gaussian blurring, that is, it verifies that the detection image is not added with a frosted glass effect.
[0161] Therefore, when the verification result for the detection image is the first verification result, the initial Gaussian blur position can be used as the target Gaussian blur position of the detection image. When the verification result for the detection image is the second verification result, it indicates that the detection image is detected to have no frosted glass effect, that is, there is no target Gaussian blur position in the detection image, the target Gaussian blur position is empty, and the detection of the detection image is completed. The target Gaussian blur position is the position where frosted glass is added in the detection image that is finally detected.
[0162] Optionally, when the verification result for the detection image is the first verification result, the server may further perform straight line detection on the detection image to improve the accuracy of the target Gaussian blur position of the detection image, as described in the following content:
[0163] The server may use any straight line detection method to detect straight lines (vertical straight lines) in the detection image. For example, the server may use the Hough straight line detection algorithm to perform straight line detection on the detection image. The detected straight line in the detection image may be called a detection straight line.
[0164] When the number of detected straight lines is the first number (the first number is equal to 0), it indicates that no straight line in the detection image is detected, and the server may use the initial Gaussian blur position of the detection image as the target Gaussian blur position of the detection image.
[0165] When the number of detection lines is the second number (the second number is 1), it indicates that only one line in the detection image is detected, and the server can determine whether the distance between the detection line and the image center axis of the detection image is greater than the distance threshold. If the server determines that the distance between the detection line and the image center axis is greater than or equal to the distance threshold, it indicates that the width of the clear image in the detection image is not too small, and the detection line is available. The distance threshold can be set according to actual applications.
[0166] The server can use the image center axis of the detection image as the axis of symmetry, and symmetrically flip the detection line in the detection image to obtain a symmetrical line of the detection line (which can be called a symmetrical detection line). The server can use the left line of the detection line and the symmetrical detection line as the first Gaussian blur position, and the server can use the right line of the detection line and the symmetrical detection line as the second Gaussian blur position. The server can use the first Gaussian blur position and the second Gaussian blur position as the target Gaussian blur position in the detection image.
[0167] When the number of detection lines is the second number, and the distance between the detection lines and the image center axis of the detection image is less than the above-mentioned distance threshold, it indicates that the width of the clear image in the detection image is too small, and the detection image is unavailable at this time. In this case, it can also be considered that the detected detection lines are 0, and the initial Gaussian blur position of the detection image can also be used as the target Gaussian blur position of the detection image.
[0168] When the number of detection lines is the third number (the third number is 2), the server can compare the distances between the two detection lines and the image center axis of the detection image. If the distances between the two detection lines and the image center axis of the detection image are both less than the distance threshold, it can be considered that the detected detection lines are 0, and the initial Gaussian blur position of the detection image can be used as the target Gaussian blur position of the detection image.
[0169] When the distance between one of the two detection lines and the central axis of the image is greater than or equal to the distance threshold, and the distance between the other detection line and the central axis of the image is less than the distance threshold, the detection line whose distance to the central axis of the image is less than the distance threshold can be discarded, and the detection line whose distance to the central axis of the image is greater than or equal to the distance threshold is retained. In this case, it can be considered that only one detection line is detected, that is, the number of detection lines is the second number. At this time, the method for obtaining the target Gaussian blur position is the same as above.
[0170] When the distances between the two detection lines and the image center axis are greater than or equal to the distance threshold, the server can also detect whether the two detection lines are symmetrical in the detection image. If the two detection lines are symmetrical in the detection image, the server can use the position of the detection line on the left in the detection image as the first Gaussian blur position, and the position of the detection line on the right in the detection image as the second Gaussian blur position. The server can use the first Gaussian blur position and the second Gaussian blur position as the target Gaussian blur position in the detection image.
[0171] On the contrary, if the two detection lines are not symmetrical in the detection image, the initial Gaussian blur position can also be used as the target Gaussian blur position. Alternatively, the detection line closer to the image center axis of the detection image can be discarded, and the detection line farther from the image center axis of the detection image can be retained. In this case, it can also be considered that only one detection line is detected, and the process of obtaining the target Gaussian blur position is the same as the process of obtaining the target Gaussian blur position when the number of the detection lines is the second number.
[0172] The method for detecting whether the two detection lines are symmetrical may be the same as the method for detecting whether the first edge position and the second edge position are symmetrical. For example, the position of the detection line on the left of the two detection lines may be used as the first edge position, and the position of the detection line on the right of the two detection lines may be used as the second edge position, and the method described in step S102 may be used to detect whether the two detection lines are symmetrical.
[0173] Furthermore, when the number of detected straight lines is the fourth number (the fourth number is a number greater than 2), the server may obtain the target Gaussian blur position in the following manner:
[0174] When the number of detection lines is the fourth number and all detection lines are on one side of the image center axis of the detection image, the server can retain the detection line farthest from the image center axis and discard other detection lines. At this time, it can be considered that only one detection line is detected, and this detection line is the detection line farthest from the image center axis. Therefore, the process of obtaining the target Gaussian blur position is the same as the process of obtaining the target Gaussian blur position when the number of detection lines is the second number, and will not be repeated here.
[0175] When the number of detection lines is the fourth number, and all detection lines are scattered on both sides of the image center axis of the detection image, the detection line on the left side of the image center axis that is farthest from the image center axis in the image, and the detection line on the right side of the image center axis that is farthest from the image center axis in the image can be retained, and other detection lines are discarded. In this case, it can be considered that only two detection lines are detected, and the two detection lines include the detection line on the left side of the image center axis that is farthest from the image center axis in the image, and the detection line on the right side of the image center axis that is farthest from the image center axis in the image, so the process of obtaining the target Gaussian blur position is the same as the process of obtaining the target Gaussian blur position when the number of detection lines is the third number, and will not be repeated here.
[0176] Through the above process, the initial Gaussian blur position of the detection image can be corrected by performing straight line detection on the detection image to obtain a more accurate target Gaussian blur position of the detection image. The target Gaussian blur position is the image boundary in the detection image that is Gaussian blurred.
[0177] See also Fig. 9 , Fig. 9 This is a schematic diagram of a scene for obtaining a Gaussian blur position provided by this application. Fig. 9 As shown, the rough detection here may refer to edge detection of the detection image. The server may perform Hough line detection 101h on the detection image 100h to detect the detection line in the detection image. When there is only one detection line 102h, the server may use the detection line as a frosted glass boundary. The server may symmetrically flip the detection line through the central axis (the image central axis of the detection image) to obtain another frosted glass boundary. The two frosted glass boundaries constitute the target Gaussian blur position 109h.
[0178] When there are more than two detection lines (as shown in box 103h), and all the detection lines are on one side of the central axis (as shown in box 104h), the server can select a detection line farthest from the central axis (as shown in box 105h) as a frosted glass boundary. The server can flip the frosted glass boundary symmetrically about the central axis to obtain another frosted glass boundary (as shown in box 106h). The two frosted glass boundaries also constitute the target Gaussian blur position 109h.
[0179] When there are more than two detection lines (as shown in box 103h), and all the detection lines are distributed on both sides of the central axis (as shown in box 107h), the server can select a detection line farthest from the central axis on both sides of the central axis as a frosted glass position (as shown in box 108h), the left side of the central axis corresponds to a frosted glass position, and the right side of the central axis also corresponds to a frosted glass position. The two frosted glass boundaries also constitute the target Gaussian blur position 109h.
[0180] When no detection line is detected (as shown in box 110h), the rough detection result 111h (ie, the initial Gaussian blur position) may be directly used as the target Gaussian blur position 109h.
[0181] See also Fig.10 , Fig.10 The server can use a rough detection method 101i (ie, an edge detection method) to detect the detection image 100i, and can obtain a rough detection result 102i of an image without rough glass or a rough detection result 103i of an image with rough glass.
[0182] The result 102i of the rough inspection of the frosted glass-free image indicates that the detection image 100i is detected by edge detection without adding frosted glass effects, so there is no initial Gaussian blur position. Therefore, when the result 102i of the rough inspection of the frosted glass-free image is obtained, it means that the detection of the detection image is completed and no subsequent detection is required.
[0183] The result 103i of the rough inspection of the frosted glass image shows that the edge detection of the inspection image 100i detects that the inspection image 100i has a frosted glass effect added and has an initial Gaussian blur position. Therefore, the inspection image can be further input into the verification model 104i for further inspection.
[0184] The verification model 104i can be used to obtain the verification result 106i of the image with frosted glass (i.e. the first verification result mentioned above) or the verification result 105i of the image without frosted glass (i.e. the second verification result mentioned above). Therefore, after obtaining the verification result 106i of the image with frosted glass, the frosted glass boundary can be further precisely positioned 107i on the detection line. The precise positioning of the frosted glass boundary 107i means performing straight line detection on the detection image, and accurately determining the target Gaussian blur position through the detected detection line and the initial Gaussian blur position mentioned above.
[0185] After obtaining the target Gaussian blur position of the detection image, the server can also crop the detection image according to the target Gaussian blur position to obtain a clear image in the detection image, which is a portion of the detection image that is not Gaussian blurred.
[0186] The detection image may also be a plurality of image frames obtained after framing the video data. Therefore, after the server cuts the detection image by the target Gaussian blur position, it can also obtain a clear image corresponding to each image frame of the video data.
[0187] The server can generate clear picture video data of the video data according to the clear image corresponding to each image frame, and the clear picture video data is the video picture data without frosted glass added. The server can synchronize the clear picture video data of the video data to the client, so that the client can output (play) the clear picture video data in the client page. In this way, the video data with frosted glass special effects added can be cropped into video data without frosted glass special effects added, which can improve the viewing effect of the user for the video data.
[0188] Alternatively, in some scenarios, when the present application detects that certain video data is video data with frosted glass effects added, the video data with frosted glass effects added can be filtered out and not recommended to users for viewing. Instead, other video data without frosted glass effects added can be recommended to users, which can also improve the user's viewing experience of the video data.
[0189] See also Fig.11 , Fig.11 1 is a schematic diagram of an image processing scenario provided by the present application. The video database 100j includes n video data, namely, video data 1, video data 2, ..., and video data n. The server can divide each video data into frames to obtain multiple image frames after each video data is divided into frames.
[0190] The server can use the method described above to detect the target Gaussian blur position of each image frame of each video data. When it is detected that more than a specified proportion (such as 1 / 3 of all image frames of the video data) of the image frames in a video data are detected to have the target Gaussian blur position, it is considered that the video data has been added with a frosted glass effect.
[0191] On the contrary, when the server detects that no more than a specified proportion (such as 1 / 3 of all image frames of the video data) of the image frames in the video data are detected to have the target Gaussian blur position, it is considered that the video data has not been added with the frosted glass effect.
[0192] By judging whether frosted glass is added to each video data, the video data in the video data set 100j can be divided into two categories, one is the video data detected in the video set 101j to be added with frosted glass effects, and the other is the video data detected in the video set 102j not to be added with frosted glass effects.
[0193] Therefore, step 104j: the server can directly recommend the video data detected in the video set 102j that are not added with the frosted glass effect to the user for viewing. And step 103j: the server can not recommend the video data detected in the video set 101j that are added with the frosted glass effect to the user. Alternatively, the server can crop each image frame of the video data according to the target Gaussian blur position of each image frame of the video data detected in the video set 101j, that is, crop the part of the image added with the frosted glass effect in each image frame, and obtain the image without the frosted glass effect added in each image frame.
[0194] The server can generate new video data based on the image without frosted glass effect added in each cropped image frame, and the new video data does not have frosted glass effect added. The server can synchronize the new video data to the client for playback to improve the user's viewing experience of the video data.
[0195] For example, the video set 101j may include video data 105j. The video data 105j may include image frame 1, image frame 2, image frame 3, and image frame 4 in sequence. The server may cut off the portion of the image with the frosted glass effect added in image frame 1 according to the detected target Gaussian blur position of image frame 1, and obtain a new image frame 11. The server may cut off the portion of the image with the frosted glass effect added in image frame 2 according to the detected target Gaussian blur position of image frame 2, and obtain a new image frame 22. The server may cut off the portion of the image with the frosted glass effect added in image frame 3 according to the detected target Gaussian blur position of image frame 3, and obtain a new image frame 33. The server may cut off the portion of the image with the frosted glass effect added in image frame 4 according to the detected target Gaussian blur position of image frame 4, and obtain a new image frame 44.
[0196] The server can generate new video data 106j according to the new image frame 11, image frame 22, image frame 33 and image frame 44. As shown in box 107j: the server can send the video data 106j to the terminal device 112j, so that the terminal device 112j can play the video data 106j on the video play page 108j, the video play page 109j, the video play page 110j and the video play page 111j. It can be understood that the video play page 108j, the video play page 109j, the video play page 110j and the video play page 111j are actually the same video play page, but the video play page 108j, the video play page 109j, the video play page 110j and the video play page 111j correspond to different play progress of the video data 106j.
[0197] The present application can first obtain a detection image, perform edge detection on the detection image, and obtain an edge detection result; when it is determined that there is an initial Gaussian blur position in the detection image according to the edge detection result, the detection image can be input into a verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training a target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection in at least two sample images; and then the target Gaussian blur position of the detection image is determined according to the initial Gaussian blur position and the verification result. It can be seen that after the method proposed in the present application performs edge detection on the detection image to obtain the initial Gaussian blur position of the detection image, the initial Gaussian blur position can also be verified by the verification model to obtain a verification result for the initial Gaussian blur position. And the verification model is also obtained by training a specific sample image in which a sample Gaussian blur position is detected based on edge detection, so the target Gaussian blur position of the detection image obtained by the initial Gaussian blur position and the verification result will be more accurate.
[0198] See also Fig.12 , Fig.12 Schematic diagram of the structure of an image data detection device provided by the present application. Fig.11 As shown, the image data detection device 1 may include: an edge detection module 101, a verification module 102 and a position determination module 103;
[0199] The edge detection module 101 is used to obtain a detection image, perform edge detection on the detection image, and obtain an edge detection result;
[0200] The verification module 102 is used for inputting the detection image into the verification model to obtain the verification result for the initial Gaussian blur position when it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image; the verification model is obtained by training the target sample image; the target sample image is a sample image in which the sample Gaussian blur position obtained based on edge detection exists among at least two sample images;
[0201] The position determination module 103 is used to determine the target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result.
[0202] The specific functional implementation of the edge detection module 101, the verification module 102 and the position determination module 103 can be found in Figure 3 Steps S101 to S103 in the corresponding embodiment will not be described in detail here.
[0203] The verification result includes a first verification result and a second verification result; the first verification result indicates that the detected image is an image after Gaussian blurring; the second verification result indicates that the detected image is an image after Gaussian blurring;
[0204] The position determination module 103 includes: a first position determination unit 1031 and a second position determination unit 1032;
[0205] A first position determining unit 1031 is configured to determine the initial Gaussian blur position as the target Gaussian blur position when the verification result is the first verification result;
[0206] The second position determining unit 1032 is configured to determine that the target Gaussian blur position is empty when the verification result is the second verification result.
[0207] The specific functional implementation of the first position determination unit 1031 and the second position determination unit 1032 can be found in Figure 3 The corresponding step S103 in the embodiment will not be described in detail here.
[0208] The position determination module 103 includes: a straight line detection unit 1033 and a target position determination unit 1034;
[0209] A straight line detection unit 1033 is used to perform image straight line detection on the detection image to obtain a detection straight line in the detection image when the verification result is a first verification result; the first verification result indicates that the detection image is verified to be an image after Gaussian blur;
[0210] The target position determination unit 1034 is used to determine the target Gaussian blur position according to the detected straight line and the initial Gaussian blur position.
[0211] The specific functional implementation of the straight line detection unit 1033 and the target position determination unit 1034 can be found in Figure 3 The corresponding step S103 in the embodiment will not be described in detail here.
[0212] The target position determination unit 1034 includes: a first position determination subunit 10341, a second position determination subunit 10342, a third position determination subunit 10343 and a fourth position determination subunit 10344;
[0213] A first position determining subunit 10341 is configured to determine an initial Gaussian blur position as a target Gaussian blur position when the number of detected straight lines is a first number;
[0214] The second position determination subunit 10342 is used to determine the initial Gaussian blur position as the target Gaussian blur position when the number of detection lines is a second number and the distance between the detection lines and the image center axis of the detection image is less than a distance threshold; and the second data is greater than the first number;
[0215] The third position determination subunit 10343 is configured to, when the number of detection lines is a second number and the distance between the detection lines and the image center axis of the detection image is greater than or equal to the distance threshold, symmetrically flip the detection lines based on the image center axis to obtain symmetrical detection lines, and determine the target Gaussian blur position according to the detection lines and the symmetrical detection lines;
[0216] The fourth position determination subunit 10344 is used to determine the target Gaussian blur position according to the initial Gaussian blur position and the detection line with the largest distance from the image center axis when the number of detection lines is a third number; the third number is greater than the second number.
[0217] The specific functional implementation of the first position determination subunit 10341, the second position determination subunit 10342, the third position determination subunit 10343 and the fourth position determination subunit 10344 can be found in Figure 3 The corresponding step S103 in the embodiment will not be described in detail here.
[0218] The device 1 further comprises: a sample detection module 104, an image input module 105, a result output module 106 and a correction module 107;
[0219] The sample detection module 104 is used to perform edge detection on at least two sample images, and determine the sample image at the sample Gaussian blur position detected by the edge detection as the target sample image;
[0220] The image input module 105 is used to input the target sample image into the initial verification model; the target sample image carries a sample label; the sample label is a first sample label or a second sample label; the first sample label indicates that the target sample image is an image after Gaussian blurring; the second sample label indicates that the target sample image is an image without Gaussian blurring;
[0221] The result output module 106 is used to output the sample verification result for the target sample image in the initial verification model; the sample verification result is a first sample verification result or a second sample verification result; the first sample verification result indicates that the target sample image is verified to be an image after Gaussian blurring; the second verification result indicates that the target sample image is verified to be an image after Gaussian blurring;
[0222] The correction module 107 is used to correct the model parameters of the initial verification model according to the sample verification result and the sample label carried by the target sample image to obtain the verification model.
[0223] The specific functional implementation of the sample detection module 104, the image input module 105, the result output module 106 and the correction module 107 can be found in Figure 3 The corresponding step S102 in the embodiment will not be described in detail here.
[0224] The edge detection module 101 includes: a convolution unit 1011 and a result determination unit 1012;
[0225] The convolution unit 1011 is used to perform a convolution operation on the detection image based on the edge detection convolution kernel to obtain an edge image of the detection image;
[0226] The result determination unit 1012 is used to determine the edge detection result for the detection image according to the edge image.
[0227] The specific functional implementation of the convolution unit 1011 and the result determination unit 1012 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0228] The convolution unit 1011 includes: a low-pass convolution subunit 10111, a signal filtering subunit 10112 and a high-pass convolution subunit 10113;
[0229] The low-pass convolution subunit 10111 is used for performing a convolution operation on the detection image based on the low-pass convolution kernel to obtain a low-frequency signal image of the detection image when the edge detection convolution kernel is a low-pass convolution kernel;
[0230] The signal filtering subunit 10112 is used to filter the low-frequency signal image in the detection image to obtain an edge image of the detection image; or
[0231] The high-pass convolution subunit 10113 is used to perform a convolution operation on the detection image based on the high-pass convolution kernel to obtain an edge image of the detection image when the edge detection convolution kernel is a high-pass convolution kernel.
[0232] The specific functional implementation of the low-pass convolution subunit 10111, the signal filtering subunit 10112 and the high-pass convolution subunit 10113 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0233] wherein the edge image includes edge detection values in at least two unit columns;
[0234] The result determination unit 1012 includes: a summing subunit 10121, a vector generating unit 10122 and a traversing unit 10123;
[0235] A summing subunit 10121 is used to sum the edge detection values in each unit column of the edge image to obtain the edge sum value corresponding to each unit column;
[0236] A vector generating unit 10122, configured to generate an edge detection vector according to the edge sum values corresponding to each unit column;
[0237] The traversal unit 10123 is used to traverse the edge sum value in the edge detection vector based on the edge detection threshold, and determine the edge detection result according to the traversal result.
[0238] The specific functional implementation of the summing subunit 10121, the vector generating unit 10122 and the traversing unit 10123 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0239] The traversal unit 10123 includes: a first traversal subunit 101231, a second traversal subunit 101232 and an edge result determination subunit 101233;
[0240] A first traversal subunit 101231 is used to traverse the edge sum values in the edge detection vector in sequence according to a first traversal order, stop traversing when an edge sum value greater than or equal to an edge detection threshold is traversed, and determine a first edge position according to the traversed edge sum value greater than or equal to the edge detection threshold;
[0241] The second traversal subunit 101232 is used to traverse the edge sum values in the edge detection vector in sequence according to the second traversal order, stop traversing when the edge sum value greater than or equal to the edge detection threshold is traversed, and determine the second edge position according to the traversed edge sum value greater than or equal to the edge detection threshold;
[0242] The edge result determination subunit 101233 is used to determine the first edge position and the second edge position as edge detection results.
[0243] The specific functional implementation of the first traversal subunit 101231, the second traversal subunit 101232 and the edge result determination subunit 101233 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0244] Wherein, the edge detection result includes the first edge position and the second edge position of the detected detection image; the initial Gaussian blur position includes the first Gaussian blur position and the second Gaussian blur position;
[0245] The verification module 102 includes: a fuzzy width value determination unit 1021, a clear width value determination unit 1022 and a model input unit 1023;
[0246] A blur width value determining unit 1021, configured to determine a first Gaussian blur width value according to a first edge position, and determine a second Gaussian blur width value according to a second edge position;
[0247] A clear width value determining unit 1022, configured to determine a clear image width value of the detection image according to the first Gaussian blur width value, the second Gaussian blur width value and the image width value of the detection image;
[0248] The model input unit 1023 is used to determine the first edge position as the first Gaussian blur position, the second edge position as the second Gaussian blur position, and input the detection image into the verification model when the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold, and the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval.
[0249] The specific functional implementation of the fuzzy width value determination unit 1021, the clear width value determination unit 1022 and the model input unit 1023 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0250] The edge detection module 101 includes: a black edge cutting unit 1013 and a target detection unit 1014;
[0251] A black edge cutting unit 1013 is used to detect a black edge image in a detection image, and cut the black edge image in the detection image to obtain a target image;
[0252] The target detection unit 1014 is used to perform edge detection on the target image to obtain an edge detection result.
[0253] The specific functional implementation of the black edge cutting unit 1013 and the target detection unit 1014 can be found in Figure 3 The corresponding step S101 in the embodiment will not be described in detail here.
[0254] Wherein, the edge detection module 101 is also used for:
[0255] Divide the video data into frames to obtain at least two image frames, and determine the at least two image frames as detection images;
[0256] The above device 1 further includes: an image cropping module 108, a clear picture generating module 109 and a clear picture output module 110;
[0257] An image cropping module 108 is used to crop the detection image based on the target Gaussian blur position to obtain a clear image in the detection image;
[0258] A clear picture generation module 109, used to generate clear picture video data of the video data according to the clear image;
[0259] The clear picture output module 110 is used to output clear picture video data in the client page.
[0260] The specific functional implementation of the image cropping module 108, the clear picture generating module 109 and the clear picture output module 110 can be found in Figure 3 The corresponding step S103 in the embodiment will not be described in detail here.
[0261] The present application can first obtain a detection image, perform edge detection on the detection image, and obtain an edge detection result; when it is determined that there is an initial Gaussian blur position in the detection image according to the edge detection result, the detection image can be input into a verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training a target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection among at least two sample images; and then the target Gaussian blur position of the detection image is determined according to the initial Gaussian blur position and the verification result. It can be seen that after the device proposed in the present application performs edge detection on the detection image to obtain the initial Gaussian blur position of the detection image, the initial Gaussian blur position can also be verified by the verification model to obtain a verification result for the initial Gaussian blur position. And the verification model is also obtained by training a specific sample image in which a sample Gaussian blur position is detected based on edge detection, so the target Gaussian blur position of the detection image obtained by the initial Gaussian blur position and the verification result will be more accurate.
[0262] See also Fig.13 , Fig.13 Schematic diagram of the structure of a computer device provided by this application. Fig.13As shown, if the computer device 1000 is a server, the computer device 1000 may include: a processor 1001, a network interface 1004, a memory 1005 and at least one communication bus 1002. If the computer device 1000 is a terminal device, in addition to the processor 1001, the network interface 1004, the memory 1005 and at least one communication bus 1002, the computer device 1000 may also include: a user interface 1003. Among them, the communication bus 1002 is used to realize the connection and communication between various components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may also be optionally at least one storage device located away from the aforementioned processor 1001. As Fig.12 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0263] exist Fig.13 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0264] Acquire a detection image, perform edge detection on the detection image, and obtain an edge detection result;
[0265] When it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image, the detection image is input into the verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training the target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection among at least two sample images;
[0266] According to the initial Gaussian blur position and the verification result, the target Gaussian blur position of the detection image is determined.
[0267] The verification result includes a first verification result and a second verification result; the first verification result indicates that the detected image is an image after Gaussian blurring; the second verification result indicates that the detected image is an image after Gaussian blurring;
[0268] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0269] When the verification result is the first verification result, the initial Gaussian blur position is determined as the target Gaussian blur position;
[0270] When the verification result is the second verification result, it is determined that the target Gaussian blur position is empty.
[0271] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0272] When the verification result is the first verification result, image straight line detection is performed on the detection image to obtain a detection straight line in the detection image; the first verification result indicates that the detection image is verified to be an image after Gaussian blur;
[0273] The target Gaussian blur position is determined based on the detected straight line and the initial Gaussian blur position.
[0274] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0275] When the number of the detected straight lines is the first number, determining the initial Gaussian blur position as the target Gaussian blur position;
[0276] When the number of detection straight lines is a second number and the distance between the detection straight lines and the image center axis of the detection image is less than a distance threshold, determining the initial Gaussian blur position as the target Gaussian blur position; the second number is greater than the first number;
[0277] When the number of detection lines is the second number and the distance between the detection lines and the image center axis of the detection image is greater than or equal to the distance threshold, the detection lines are symmetrically flipped based on the image center axis to obtain symmetrical detection lines, and the target Gaussian blur position is determined according to the detection lines and the symmetrical detection lines;
[0278] When the number of detection lines is a third number, the target Gaussian blur position is determined according to the initial Gaussian blur position and the detection line with the largest distance from the central axis of the image; the third number is greater than the second number.
[0279] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0280] Performing edge detection on at least two sample images, and determining the sample image at the sample Gaussian blur position detected by the edge detection as the target sample image;
[0281] The target sample image is input into the initial verification model; the target sample image carries a sample label; the sample label is a first sample label or a second sample label; the first sample label represents that the target sample image is an image after Gaussian blurring; the second sample label represents that the target sample image is an image without Gaussian blurring;
[0282] In the initial verification model, a sample verification result for the target sample image is output; the sample verification result is a first sample verification result or a second sample verification result; the first sample verification result indicates that the target sample image is verified to be an image after Gaussian blurring; the second verification result indicates that the target sample image is verified to be an image after Gaussian blurring;
[0283] According to the sample verification results and the sample labels carried by the target sample images, the model parameters of the initial verification model are corrected to obtain the verification model.
[0284] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0285] Performing a convolution operation on the detection image based on the edge detection convolution kernel to obtain an edge image of the detection image;
[0286] An edge detection result for the detection image is determined according to the edge image.
[0287] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0288] When the edge detection convolution kernel is a low-pass convolution kernel, a convolution operation is performed on the detection image based on the low-pass convolution kernel to obtain a low-frequency signal image of the detection image;
[0289] Filtering the low-frequency signal image in the detection image to obtain an edge image of the detection image; or
[0290] When the edge detection convolution kernel is a high-pass convolution kernel, a convolution operation is performed on the detection image based on the high-pass convolution kernel to obtain an edge image of the detection image.
[0291] The edge image includes edge detection values in at least two unit columns;
[0292] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0293] The edge detection values in each unit column of the edge image are summed up respectively to obtain the edge sum value corresponding to each unit column;
[0294] Generate an edge detection vector according to the edge sum values corresponding to each unit column;
[0295] The edge sum values in the edge detection vector are traversed based on the edge detection threshold, and the edge detection result is determined according to the traversal result.
[0296] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0297] According to the first traversal order, the edge sum values in the edge detection vector are traversed in sequence, and when the edge sum value greater than or equal to the edge detection threshold is traversed, the traversal is stopped, and the first edge position is determined according to the edge sum value greater than or equal to the edge detection threshold that is traversed;
[0298] According to the second traversal order, the edge sum values in the edge detection vector are traversed in sequence, and when the edge sum value greater than or equal to the edge detection threshold is traversed, the traversal is stopped, and the second edge position is determined according to the edge sum value greater than or equal to the edge detection threshold that is traversed;
[0299] The first edge position and the second edge position are determined as edge detection results.
[0300] The edge detection result includes a first edge position and a second edge position of the detected detection image; the initial Gaussian blur position includes a first Gaussian blur position and a second Gaussian blur position;
[0301] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0302] Determine a first Gaussian blur width value according to the first edge position, and determine a second Gaussian blur width value according to the second edge position;
[0303] Determine a clear image width value of the detection image according to the first Gaussian blur width value, the second Gaussian blur width value and the image width value of the detection image;
[0304] When the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold, and the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval, the first edge position is determined as the first Gaussian blur position, the second edge position is determined as the second Gaussian blur position, and the detection image is input into the verification model.
[0305] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0306] Detect the black-bordered image in the detection image, and crop the black-bordered image in the detection image to obtain the target image;
[0307] Perform edge detection on the target image to obtain edge detection results.
[0308] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0309] Divide the video data into frames to obtain at least two image frames, and determine the at least two image frames as detection images;
[0310] In an optional embodiment, the processor 1001 may also be used to call a device control application stored in the memory 1005 to perform the following steps:
[0311] Based on the target Gaussian blur position, the detection image is cropped to obtain a clear image in the detection image;
[0312] Generate clear picture video data of video data according to the clear image;
[0313] In the client page, clear picture video data is output.
[0314] In addition, it should be pointed out that: the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the image data detection device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above-mentioned Figure 3 The description of the image data detection method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0315] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0316] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for detecting image data, characterized in that: include: Acquire a detection image, perform edge detection on the detection image, and obtain an edge detection result; When it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image, the detection image is input into a verification model to obtain a verification result for the initial Gaussian blur position; the verification model is obtained by training a target sample image; the target sample image is a sample image in which there is a sample Gaussian blur position obtained based on edge detection among at least two sample images; Determining the target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result, including: when the verification result is a first verification result, performing image straight line detection on the detection image to obtain a detection straight line in the detection image; the first verification result indicates that the detection image is verified to be an image after Gaussian blur; determining the target Gaussian blur position according to the detection straight line and the initial Gaussian blur position; Wherein, determining the target Gaussian blur position according to the detection straight lines and the initial Gaussian blur position includes: when the number of the detection straight lines is a first number, determining the initial Gaussian blur position as the target Gaussian blur position; when the number of the detection straight lines is a second number, and the distance between the detection straight line and the image center axis of the detection image is less than a distance threshold, determining the initial Gaussian blur position as the target Gaussian blur position; when the number of the detection straight lines is the second number, and the distance between the detection straight line and the image center axis of the detection image is greater than or equal to the distance threshold, symmetrically flipping the detection straight line based on the image center axis to obtain symmetrical detection straight lines, and determining the target Gaussian blur position according to the detection straight line and the symmetrical detection straight line; when the number of the detection straight lines is a third number, determining the target Gaussian blur position according to the initial Gaussian blur position and the detection straight line with the largest distance to the image center axis; the second number is greater than the first number, and the third number is greater than the second number.
2. The method according to claim 1, characterized in that The step of determining a target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result includes: When the verification result is the second verification result, determining that the target Gaussian blur position is empty; The second verification result indicates that the detection image is verified to be an image that has not been Gaussian blurred.
3. The method according to claim 1, characterized in that The method further comprises: Performing edge detection on the at least two sample images, and determining the sample image at the sample Gaussian blur position detected by the edge detection as the target sample image; The target sample image is input into the initial verification model; the target sample image carries a sample label; the sample label is a first sample label or a second sample label; the first sample label represents that the target sample image is an image after Gaussian blurring; the second sample label represents that the target sample image is an image without Gaussian blurring; In the initial verification model, a sample verification result for the target sample image is output; the sample verification result is a first sample verification result or a second sample verification result; the first sample verification result indicates that the target sample image is verified to be an image after Gaussian blurring; the second sample verification result indicates that the target sample image is verified to be an image after not Gaussian blurring; According to the sample verification result and the sample label carried by the target sample image, the model parameters of the initial verification model are corrected to obtain the verification model.
4. The method according to claim 1, characterized in that: The performing edge detection on the detection image to obtain an edge detection result includes: Performing a convolution operation on the detection image based on an edge detection convolution kernel to obtain an edge image of the detection image; The edge detection result for the detection image is determined according to the edge image.
5. The method according to claim 4, characterized in that The step of performing a convolution operation on the detection image based on the edge detection convolution kernel to obtain an edge image of the detection image includes: When the edge detection convolution kernel is a low-pass convolution kernel, performing a convolution operation on the detection image based on the low-pass convolution kernel to obtain a low-frequency signal image of the detection image; filtering the low-frequency signal image in the detection image to obtain the edge image of the detection image; or When the edge detection convolution kernel is a high-pass convolution kernel, a convolution operation is performed on the detection image based on the high-pass convolution kernel to obtain the edge image of the detection image.
6. The method according to claim 4, characterized in that The edge image includes edge detection values in at least two unit columns; Determining the edge detection result for the detection image according to the edge image includes: The edge detection values in each unit column of the edge image are summed up respectively to obtain the edge sum value corresponding to each unit column; Generate an edge detection vector according to the edge sum values corresponding to each unit column; The edge sum values in the edge detection vector are traversed based on the edge detection threshold, and the edge detection result is determined according to the traversal result.
7. The method according to claim 6, characterized in that The traversing the edge sum value in the edge detection vector based on the edge detection threshold, and determining the edge detection result according to the traversal result, comprises: According to a first traversal order, the edge sum values in the edge detection vector are traversed in sequence, and when an edge sum value greater than or equal to the edge detection threshold is traversed, the traversal is stopped, and a first edge position is determined according to the edge sum value greater than or equal to the edge detection threshold that is traversed; According to the second traversal order, the edge sum values in the edge detection vector are traversed in sequence, and when the edge sum value greater than or equal to the edge detection threshold is traversed, the traversal is stopped, and the second edge position is determined according to the edge sum value greater than or equal to the edge detection threshold that is traversed; The first edge position and the second edge position are determined as the edge detection result.
8. The method according to claim 1, characterized in that: The edge detection result includes the first edge position and the second edge position of the detected image; the initial Gaussian blur position includes the first Gaussian blur position and the second Gaussian blur position; When it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image, inputting the detection image into the verification model comprises: Determine a first Gaussian blur width value according to the first edge position, and determine a second Gaussian blur width value according to the second edge position; Determine a clear image width value of the detection image according to the first Gaussian blur width value, the second Gaussian blur width value and the image width value of the detection image; When the difference between the first Gaussian blur width value and the second Gaussian blur width value is less than or equal to the width symmetry detection threshold, and the ratio between the clear image width value and the image height value of the detection image is in the ratio detection interval, the first edge position is determined as the first Gaussian blur position, the second edge position is determined as the second Gaussian blur position, and the detection image is input into the verification model.
9. The method according to claim 1, characterized in that: The performing edge detection on the detection image to obtain an edge detection result includes: Detecting a black-bordered image in the detection image, and cropping the black-bordered image in the detection image to obtain a target image; Perform edge detection on the target image to obtain the edge detection result.
10. The method according to claim 1, characterized in that The step of acquiring the detection image comprises: Divide the video data into frames to obtain at least two image frames, and determine the at least two image frames as the detection images; The method further comprises: Based on the target Gaussian blur position, the detection image is cropped to obtain a clear image in the detection image; Generating clear picture video data of the video data according to the clear image; In the client page, the clear picture video data is output.
11. An image data detection device, characterized in that: include: An edge detection module is used to acquire a detection image, perform edge detection on the detection image, and obtain an edge detection result; A verification module, for inputting the detection image into a verification model to obtain a verification result for the initial Gaussian blur position when it is determined according to the edge detection result that there is an initial Gaussian blur position in the detection image; the verification model is obtained by training a target sample image; the target sample image is a sample image in which a sample Gaussian blur position obtained based on edge detection exists among at least two sample images; A position determination module, for determining a target Gaussian blur position of the detection image according to the initial Gaussian blur position and the verification result, comprising: when the verification result is a first verification result, performing image straight line detection on the detection image to obtain a detection straight line in the detection image; the first verification result indicates that the detection image is verified to be an image after Gaussian blur; and determining the target Gaussian blur position according to the detection straight line and the initial Gaussian blur position; Wherein, determining the target Gaussian blur position according to the detection straight lines and the initial Gaussian blur position includes: when the number of the detection straight lines is a first number, determining the initial Gaussian blur position as the target Gaussian blur position; when the number of the detection straight lines is a second number, and the distance between the detection straight line and the image center axis of the detection image is less than a distance threshold, determining the initial Gaussian blur position as the target Gaussian blur position; when the number of the detection straight lines is the second number, and the distance between the detection straight line and the image center axis of the detection image is greater than or equal to the distance threshold, symmetrically flipping the detection straight line based on the image center axis to obtain symmetrical detection straight lines, and determining the target Gaussian blur position according to the detection straight line and the symmetrical detection straight line; when the number of the detection straight lines is a third number, determining the target Gaussian blur position according to the initial Gaussian blur position and the detection straight line with the largest distance to the image center axis; the second number is greater than the first number, and the third number is greater than the second number.
12. A computer device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Detection method and device for similar video files
CN106484837A
Video frame image segmentation method and device
CN107292892A
Image processing method and device, electronic equipment and storage medium
CN110517246A