An image processing method, device, storage medium, and electronic device

By filtering the initial image data, the storage and transmission pressure problems caused by the large amount of image data are solved, and the image data is reduced and the storage performance is improved.

CN112633198BActive Publication Date: 2025-06-03ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011589741.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2025-06-03
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

Large amount of data in images leads to greater storage and transmission pressure on images, and the prior art has not yet proposed an effective solution.

Method used

By acquiring the initial image data, analyzing whether the target data is included, and if included, filtering is performed to obtain the image data of the target object based on the processing results. The filtering method may include scaling processing or filtering processing, and determine the filtering method in combination with the frame rate control strategy and image detection results.

Benefits of technology

The size of image data is reduced, the pressure of storage and transmission is reduced, and the storage performance of image data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112633198B_ABST
    Figure CN112633198B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides an image processing method, apparatus, storage medium, and electronic device. The method includes: obtaining initial image data; parsing the initial image data to determine whether the initial image data contains target data; in the case where the initial image data contains the target data, performing a filtering process on the initial image data, and obtaining the image data of the target object based on the processing result. Through the present invention, the problem in the related art that the large amount of data of the image leads to a large storage and transmission pressure of the image is solved, and the effect of reducing the amount of data of the image and thus reducing the storage and transmission pressure of the image is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image processing, and more specifically, to an image processing method, apparatus, storage medium, and electronic device. Background Art

[0002] With the intelligent development of the video surveillance industry, traditional video recording has gradually evolved into a video recording method that combines video recording and image capture; at the same time, with the improvement of image resolution, the file size of the captured images is also increasing day by day.

[0003] In the case of large captured image files, it will increase the pressure on the image link transmission bandwidth and the supporting storage space, resulting in the problems of being unable to quickly transmit more images and unable to store more images.

[0004] In view of the above problems existing in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of the present invention provide an image processing method, apparatus, storage medium, and electronic device to at least solve the problem of large storage and transmission pressure of images caused by large amounts of image data in the related art.

[0006] According to an embodiment of the present invention, an image processing method is provided, including:

[0007] Obtaining initial image data;

[0008] Analyzing the initial image data to determine whether the initial image data contains target data, where the target data is used to indicate information about a target object that meets a preset condition included in the initial image data;

[0009] When the initial image data contains the target data, performing filtering processing on the initial image data, and obtaining image data of the target object based on the processing result.

[0010] In an exemplary embodiment, when the initial image data contains the target data, performing filtering processing on the initial image data, and obtaining image data of the target object based on the processing result includes:

[0011] Determining the data volume ratio of the target data in the initial image data;

[0012] When it is determined that the data volume ratio is less than a preset value, determining a target filtering method according to a pre-set frame rate control strategy;

[0013] Filter the initial image according to the target filtering method, and obtain the image data of the target object based on the processing result.

[0014] In an exemplary embodiment, filtering the initial image data according to the target filtering method and obtaining the image data of the target object based on the processing result includes:

[0015] When it is determined that the target filtering method is scaling processing, sequentially perform equal-proportion reduction and equal-proportion enlargement on the initial image data according to a preset scaling ratio coefficient to obtain first image data;

[0016] Perform target fusion processing on the first image data and the initial image data to obtain the image data of the target object.

[0017] In an exemplary embodiment, filtering the initial image data according to the target filtering method and obtaining the image data of the target object based on the processing result includes:

[0018] When it is determined that the target filtering method is filtering processing, filter the initial image data according to a target filtering algorithm to obtain second image data;

[0019] Perform target fusion processing on the second image data and the initial image data to obtain the image data of the target object.

[0020] In an exemplary embodiment, before filtering the initial image data according to the target filtering algorithm, the method further includes:

[0021] Perform image detection on the initial image data;

[0022] Determine the target filtering method according to the detection result of the image detection.

[0023] In an exemplary embodiment, parsing the initial image data to determine whether the initial image data contains target data includes:

[0024] Obtain reference data, where the reference data is used to indicate information about an object of the same category as the target object;

[0025] According to the reference data, perform frame rate synchronization operation on the initial image data so that the image frame rate of the initial image data is the same as the image frame rate of the reference data;

[0026] Match the initial image data after the frame rate synchronization operation with the reference data to determine whether the initial image data contains the target data.

[0027] In an exemplary embodiment, after obtaining the image data of the target object based on the processing result, the method further includes:

[0028] Performing encoding processing on the image data of the target object to obtain target image data.

[0029] According to another embodiment of the present invention, there is provided an image processing apparatus, including:

[0030] An initial image acquisition module, configured to acquire initial image data;

[0031] An image analysis module, configured to analyze the initial image data to determine whether the initial image data contains target data, where the target data is used to indicate information of a target object that meets a preset condition included in the initial image data;

[0032] A filtering module, configured to perform filtering processing on the initial image data when the initial image data contains the target data, and obtain the image data of the target object based on the processing result.

[0033] According to still another embodiment of the present invention, there is further provided a storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0034] According to still another embodiment of the present invention, there is further provided an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0035] Through the present invention, since the initial image data is filtered, invalid information in the image data can be filtered. Therefore, the problem in the related art that the large amount of image data leads to large storage and transmission pressure of the image can be solved, the amount of image data is reduced, and further, the storage of a smaller image and the reduction of transmission pressure are achieved. Description of the Drawings

[0036] Figure 1 It is a hardware structure block diagram of a mobile terminal of an image processing method according to an embodiment of the present invention;

[0037] Figure 2 It is a flowchart of an image processing method according to an embodiment of the present invention;

[0038] Figure 3 It is a structure block diagram of an image processing apparatus according to an embodiment of the present invention;

[0039] Figure 4 is the flow of a specific embodiment of the present invention Figure 1 ;

[0040] Figure 5 is the flow of a specific embodiment of the present invention Figure 2 。 Specific embodiments

[0041] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0043] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal for a picture processing method according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1 processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in Figure 1 is only illustrative and does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may further include more or fewer components than those shown in

[0044] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to a picture processing method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of a mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] In this embodiment, an image processing method is provided. Figure 2 It is a flowchart of an image processing method according to an embodiment of the present invention, as Figure 2 shown, and the process includes the following steps:

[0047] Step S202, obtaining initial image data;

[0048] In this embodiment, initial YUV (Luminance-Chrominance-Chroma) image data is obtained to facilitate subsequent processing of the initial YUV image data.

[0049] Among them, the initial YUV image data can be one frame or multiple frames; among them, one frame of initial YUV data can reduce the amount of calculation, while multiple frames of YUV data can improve the accuracy of the processing result; and the way to obtain the initial image data can be to collect image data of a target area through an image acquisition device, and then randomly or according to a predetermined rule select one frame or multiple frames of image data from the collected image data, or it can be obtained through other means; and when the initial image data is multiple frames, it can be consecutive frame image data, or non-consecutive frame image data selected according to a predetermined rule, or other forms of multiple frame image data.

[0050] It should be noted that the initial image data may (but is not limited to) include the position coordinates of the target area, the target object within the target area, the information of the target object (such as color, type, size, temperature, etc.), the threshold of the proportion of the image screen of the target data in the screen, the zoom ratio coefficient, the frame rate control strategy, the filtering algorithm, the filtering pixel radius, etc.

[0051] Step S204, parsing the initial image data to determine whether the initial image data contains target data, where the target data is used to indicate the information of the target object that meets the preset conditions included in the initial image data;

[0052] In this embodiment, by parsing the initial image data, it is determined whether the target data is included in the initial image data, and then subsequent filtering operations are performed.

[0053] Among them, the target data may (but is not limited to) include image data containing target objects of interest to users generated by intelligent ROI (region of interest) technology, such as images containing motor vehicles, pedestrians, animals, or containing the size of pedestrians, the brand of vehicles, etc., or may be pre-specified image data, or other data contents; the preset conditions may be the size, type, temperature, location, etc. of the target object.

[0054] It should be noted that the target data may be partial information of the target object that meets the preset conditions, and only partial information of the target object needs to meet the preset conditions to trigger the generation of the target data; among them, the acquisition of the target data may be before the initial image data is parsed, or may be carried out simultaneously.

[0055] Step S206, in the case where the target data is included in the initial image data, perform filtering processing on the initial image data, and obtain the image data of the target object based on the processing result.

[0056] In this embodiment, in the case where it is determined that the initial image contains the target data, filtering processing is performed on the initial image data, so as to eliminate or lose the non-target data, thereby reducing the size of the image data.

[0057] Among them, the image data of the target object obtained based on the processing result may (but is not limited to) include a small amount of non-target data in addition to the target data, so that the target object and the target data can be recognized; it may also only include the target object and the target data, thereby reducing the space occupied by the non-target data; the filtering processing may (but is not limited to) be filtered by an algorithm, such as a neural network of deep learning or a filtering algorithm, etc., or may be to lose the non-target data during the scaling process by means of image scaling, so as to realize the filtering of the initial image.

[0058] For example, all the image data outside the target area in the image is lost, so as to only retain the image data within the target area; or all the image data outside the target area and the data such as vehicles and buildings in the target area are lost, so as to only retain the image data of pedestrians, thereby greatly reducing the size of the image data.

[0059] With the rapid development of intelligent screenshot technology, there will be a certain amount of invalid information in the screenshot, which increases the size of the file obtained by the screenshot; therefore, without affecting the authenticity of the picture, by the above steps, reducing the invalid information contained in the file obtained by the screenshot can reduce the size of the video image, thereby reducing the pressure on the picture link transmission bandwidth and reducing the pressure on the supporting storage space, making the product solution more competitive in video surveillance.

[0060] Since the non-target data is lost through the filtering process, the size of the image data is reduced, solving the problem in the related technology that the large amount of image data leads to large storage and transmission pressure of the image, achieving the effect of reducing the amount of image data, and then realizing the storage of a smaller image and reducing the transmission pressure, improving the storage performance of the image data.

[0061] Among them, the execution subject of the above steps can be a base station, a terminal, etc., but not limited to this.

[0062] In an optional embodiment, the acquisition method of the target data can be obtained through the following steps:

[0063] Step S2002, obtain target object information, where the target object information is used to indicate the target object;

[0064] Step S2004, determine the frame rate control strategy according to the target object information, where the frame rate control strategy is used to indicate the execution of the frame rate synchronization operation;

[0065] Step S2006, perform target processing on the initial image data according to the target object information to obtain the target data.

[0066] In this embodiment, the target processing may be to perform intelligent algorithm processing on the initial image data according to the target object information to obtain the target data including ROI information. Among them, the intelligent algorithm may be an automatic vehicle detection algorithm or other algorithms; the target object information may (but is not limited to) include the content of interest preset according to the scene or the content of interest configured by the user, for example, vehicles, pedestrians, etc.

[0067] In an optional embodiment, when the initial image data contains the target data, performing a filtering process on the initial image data, and obtaining the image data of the target object based on the processing result includes:

[0068] Step S2062, determine the ratio of the data volume occupied by the target data in the initial image data;

[0069] Step S2064, when it is determined that the data volume ratio is less than the preset value, determine the target filtering method according to the preset frame rate control strategy;

[0070] Step S2066: Filter the initial image according to the target filtering method, and obtain the image data of the target object based on the processing result.

[0071] In this embodiment, before selecting the filtering method, first determine the ratio of the data volume of the target data in the initial image data, so as to avoid energy waste and efficiency reduction caused by little change in the filtered image data when filtering under the condition that the ratio of the target data is greater than the preset value; since the algorithm processing cycles corresponding to different user - interested contents included in the target data are different, the corresponding frame rate control strategies and the filtering methods corresponding to the frame rate control strategies are also different, so it is necessary to preset the frame rate control strategy; and determining the target filtering method through the preset frame rate control strategy is to ensure that the image frame rate of the filtered image data meets the requirements.

[0072] Among them, the ratio of the data volume of the target data in the initial image data can (but is not limited to) be the proportion of the image containing the target object in the initial image, or the proportion of the data volume of the image containing the target object in the initial image data after being converted into encoded data, or the proportion of the storage space occupied by the target data in the storage space of the initial image data; one frame rate control strategy can correspond to multiple different filtering methods, or can correspond to one filtering method.

[0073] In an optional embodiment, filtering the initial image data according to the target filtering method and obtaining the image data of the target object based on the processing result includes:

[0074] Step S20662: When it is determined that the target filtering method is scaling processing, sequentially reduce and enlarge the initial image data proportionally according to the preset scaling ratio coefficient to obtain the first image data;

[0075] Step S20664: Perform target fusion processing on the first image data and the initial image data to obtain the image data of the target object.

[0076] In this embodiment, during the proportional reduction process of the initial image data, the non - target data in the initial image data will be lost, thus realizing the reduction of the image data; and re - fusing the first image data with the initial image is because in the scaling process of the initial image, part of the target data may also be lost. Therefore, in order to keep the image data of the obtained target object clear, it is necessary to fuse the target data in the initial image data with the first image data to supplement the lost target data.

[0077] Among them, when enlarging the reduced image data, processable redundant data is filled in the positions of the enlarged non-target data, and these redundant data will not change the authenticity of the image; the way of fusing the first image data with the initial image data can be to intercept the picture of the target object included in the initial image data and then fill it into the corresponding position of the first image data, or to intercept and fill the image coding of the target data in the initial image data into the corresponding position of the first image data, or to perform fusion by other means.

[0078] For example, the operations of reducing by x times proportionally and enlarging by y times proportionally can be completed according to the set scaling ratio coefficient to obtain the first image data with the downsampling effect, where x can be equal to y or not equal; then, the target data in the initial image data is moved to the first image data by means of copying such as memcpy (memory copy function) or DMA (Direct Memory Access, direct memory access).

[0079] In an alternative embodiment, according to the target filtering method, filtering the initial image data, and obtaining the image data of the target object based on the processing result includes:

[0080] Step S20666, in the case where it is determined that the target filtering method is filtering processing, filtering the initial image data according to the target filtering algorithm to obtain the second image data;

[0081] Step S20668, performing target fusion processing on the second image data and the initial image data to obtain the image data of the target object.

[0082] In this embodiment, filtering the initial image data according to the filtering algorithm is to filter the noise included in the initial image data, thereby reducing the size of the image data.

[0083] Among them, the noise to be filtered can (but is not limited to) be Gaussian noise, salt-and-pepper noise, etc., or other types of noise; the algorithm for filtering the noise can (but is not limited to) filter the noise according to the filtering pixel radius, and the filtering process can be to filter one type of noise or multiple types of noise, and here it can be selected and adjusted according to specific requirements.

[0084] For example, when Gaussian noise needs to be filtered, the mean filtering algorithm can be selected for filtering; when salt-and-pepper noise needs to be filtered, the median filtering algorithm can be selected for filtering.

[0085] In an alternative embodiment, before filtering the initial image data according to the target filtering algorithm, the method further includes:

[0086] Step S20660, perform image detection on the initial image data;

[0087] Step S20661, determine the target filtering method according to the detection result of the image detection.

[0088] In this embodiment, performing image detection on the initial image data is to detect information such as noise and non-target data contained in the initial image, so as to be able to determine the target filtering method in combination with the frame rate control strategy.

[0089] Among them, the method of performing image detection on the initial image data can be to perform detection through a neural network of deep learning, or to perform detection through a preset detection algorithm, or to perform detection through other methods.

[0090] In an alternative embodiment, parsing the initial image data to determine whether the initial image data contains target data includes:

[0091] Step S2042, obtain reference data, where the reference data is used to indicate information of an object of the same category as the target object;

[0092] Step S2044, perform frame rate synchronization operation on the initial image data according to the reference data, so that the image frame rate of the initial image data is the same as the image frame rate of the reference data;

[0093] Step S2046, match the initial image data after the frame rate synchronization operation with the reference data to determine whether the initial image data contains target data.

[0094] In this embodiment, when performing the frame rate synchronization operation on the initial image data according to the reference data, it is to enable the initial image data to be quickly recognized and processed, thereby improving the image processing efficiency.

[0095] Among them, the reference data may (but is not limited to) include information such as the target area contained in the target data, information of the target object, and image frame rate. The information of the target area includes position information and area size of the target area. The information of the target object includes type, size, temperature, etc. of the target object. For example, motor vehicles, male pedestrians, etc.; the synchronization operation on the initial image can be implemented through a preset frame rate synchronization algorithm, or through other methods.

[0096] In an alternative embodiment, after obtaining the image data of the target object based on the processing result, the method further includes:

[0097] Step S208, perform encoding processing on the image data of the target object to obtain the target image data.

[0098] In an optional embodiment, the image data of the target object is encoded so that the image data of the target object can be recognized and thus can be used normally.

[0099] Among them, the method of encoding the image data of the target object can be (but is not limited to) RGB (Red-Green-Blue, color encoding) encoding, or YUV encoding, or other encoding methods such as predictive encoding, transform encoding, and hybrid encoding; the device for performing image data encoding can be an image encoder, for example, a convolutional autoencoder, a fractal encoder, etc., or other image data encoding devices.

[0100] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

[0101] In this embodiment, a picture processing device is further provided. This device is used to implement the above embodiments and preferred embodiments, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0102] Figure 3 is a structural block diagram of a picture processing device according to an embodiment of the present invention, as Figure 3 shown, the device includes:

[0103] An initial image acquisition module 32, configured to acquire initial image data;

[0104] An image analysis module 34, configured to analyze the initial image data to determine whether the initial image data contains target data, where the target data is used to indicate information about a target object that meets a preset condition included in the initial image data;

[0105] A filtering module 36, configured to perform a filtering process on the initial image data when the initial image data contains the target data, and obtain the image data of the target object based on the processing result.

[0106] In an alternative embodiment, the filtering module 36 includes:

[0107] A ratio determination unit 362 for determining the ratio of the amount of data of the target data in the initial image data;

[0108] A filtering method selection unit 364 for determining the target filtering method according to a pre-set frame rate control strategy when it is determined that the data amount ratio is less than a preset value;

[0109] A filtering execution unit 366 for filtering the initial image according to the target filtering method and obtaining the image data of the target object based on the processing result.

[0110] In an alternative embodiment, the filtering execution unit 366 includes:

[0111] A scaling execution subunit 3662 for, when it is determined that the target filtering method is scaling processing, sequentially reducing and enlarging the initial image data proportionally according to a preset scaling ratio coefficient to obtain first image data;

[0112] A first fusion subunit 3664 for performing target fusion processing on the first image data and the initial image data to obtain the image data of the target object.

[0113] In an alternative embodiment, the filtering execution unit 366 further includes:

[0114] A filtering execution subunit 3666 for, when it is determined that the target filtering method is filtering processing, filtering the initial image data according to the target filtering algorithm to obtain second image data;

[0115] A second fusion subunit 3668 for performing target fusion processing on the second image data and the initial image data to obtain the image data of the target object.

[0116] In an alternative embodiment, the filtering execution unit 366 further includes:

[0117] An image detection subunit 3660 for performing image detection on the initial image data;

[0118] A filtering method selection subunit 3661 for determining the target filtering method according to the detection result of the image detection.

[0119] In an alternative embodiment, the image parsing module 34 includes:

[0120] A reference data acquisition unit 342 for acquiring reference data, where the reference data is used to indicate information of an object of the same category as the target object;

[0121] A synchronization unit 344, configured to perform a frame rate synchronization operation on the initial image data according to reference data, so that the image frame rate of the initial image data is the same as that of the reference data;

[0122] A matching unit 346, configured to match the initial image data after the frame rate synchronization operation with the reference data to determine whether the target data is included in the initial image data.

[0123] In an optional embodiment, the apparatus further includes:

[0124] An encoding module 38, configured to perform encoding processing on the image data of the target object to obtain target image data.

[0125] It should be noted that the above-mentioned various modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited thereto: all the above-mentioned modules are located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.

[0126] The present invention will be described below with reference to specific embodiments.

[0127] As Figure 4 shown, the steps of obtaining the intelligent ROI information are as follows:

[0128] Step S401, the generation process is started;

[0129] Step S402, according to the scene preset interested content or the interested content configured by the user, such as a motor vehicle;

[0130] Step S403, determine the frame rate control strategy according to the configured interested content (different interested contents correspond to different algorithm processing cycles). If the set interested content is not supported, directly transfer to step S407);

[0131] Step S404, obtain a frame of YUV (color encoding) data;

[0132] Step S405, send it to the intelligent algorithm for processing;

[0133] Step S406, the algorithm outputs the ROI information content, including but not limited to the number of regions, region coordinates, target object information, etc.;

[0134] Step S407, end the single processing process.

[0135] As Figure 5 shown, the steps of obtaining the processed image data are as follows:

[0136] Step S501, the processing process is started;

[0137] Step S502, initialize the parameters related to image encoding processing, such as the threshold of the proportion of the ROI area in the screen, the scaling ratio coefficient, the frame rate control strategy, the filtering algorithm, the filtering pixel radius, etc.;

[0138] Step S503, obtain a frame of original YUV data and record it as data1;

[0139] Step S504, frame rate synchronization (matching with the intelligent output result), confirm whether the current YUV data has ROI information: if there is ROI information, execute Step S506); if there is no ROI information, execute Step S514);

[0140] Step S506, calculate the size of the intelligent ROI information in the YUV data after synchronization in the total screen;

[0141] Step S507, if it is less than the set threshold, execute Step S508; if it is greater than the set threshold, send the data1 data into the device image encoder for encoding, and then execute Step S514;

[0142] Step S508, select the actual processing strategy according to the set frame rate control strategy. If it is Strategy 1, execute Step S509; if it is Strategy 2, execute Step S510 and Step 11;

[0143] Step S509, perform the equal-proportion reduction by x times and equal-proportion enlargement by y times on the data1 data according to the set scaling ratio coefficient, where x can be equal to y, to obtain the data2 data with the downsampling effect completed;

[0144] Step S510, select the corresponding filtering algorithm according to the pre-set filtering algorithm, where the filtering algorithm is based on the image detection result, such as mean filtering for Gaussian noise and median filtering for salt-and-pepper noise, etc.;

[0145] Step S511, based on the filtering algorithm, combined with the set filtering pixel radius, complete the filtering process to obtain the data2 data;

[0146] Step S512, move the data in data1 to data2 according to the intelligent ROI information, where the moving method is implemented by copy methods such as memcpy or DMA transfer;

[0147] Step S513, send the data2 data into the device image encoder for encoding;

[0148] Step S514, image encoder encoding processing;

[0149] Step S515, output the finally generated picture;

[0150] Step S516, the processing flow ends.

[0151] An embodiment of the present invention also provides a storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0152] In an exemplary embodiment, the above storage medium may include but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks or optical discs that can store computer programs.

[0153] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0154] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0155] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0156] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0157] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for image processing, characterized in that, it includes: Obtain initial image data; Analyze the initial image data to determine whether the initial image data contains target data, where the target data is used to indicate information about target objects that meet preset conditions included in the initial image data; When the initial image data contains the target data, perform filtering processing on the initial image data, and obtain the image data of the target object based on the processing result; Wherein, when the initial image data contains the target data, performing filtering processing on the initial image data and obtaining the image data of the target object based on the processing result includes: determining the ratio of the data amount occupied by the target data in the initial image data; when determining that the data amount ratio is less than a preset value, determining a target filtering method according to a pre-set frame rate control strategy; when determining that the target filtering method is scaling processing, sequentially perform equal-proportion reduction and equal-proportion enlargement on the initial image data according to a preset scaling ratio coefficient to obtain first image data; perform target fusion processing on the first image data and the initial image data to obtain the image data of the target object.

2. The method according to claim 1, characterized in that, According to the target filtering method, performing filtering processing on the initial image data and obtaining the image data of the target object based on the processing result includes: When determining that the target filtering method is filtering processing, perform filtering processing on the initial image data according to a target filtering algorithm to obtain second image data; Perform target fusion processing on the second image data and the initial image data to obtain the image data of the target object.

3. The method according to claim 2, characterized in that, Before performing filtering processing on the initial image data according to the target filtering algorithm, the method further includes: Perform image detection on the initial image data; Determine the target filtering method according to the detection result of the image detection.

4. The method according to claim 1, characterized in that, The analyzing the initial image data to determine whether the initial image data contains target data includes: Obtain reference data, where the reference data is used to indicate information about objects of the same category as the target object; According to the reference data, perform frame rate synchronization operation on the initial image data to make the image frame rate of the initial image data the same as the image frame rate of the reference data; Match the initial image data after the frame rate synchronization operation with the reference data to determine whether the initial image data contains the target data.

5. The method according to claim 1, characterized in that, After obtaining the image data of the target object based on the processing result, the method further includes: Perform encoding processing on the image data of the target object to obtain target image data.

6. An image processing device, characterized in that, it includes: An initial image acquisition module for obtaining initial image data; An image analysis module, configured to analyze the initial image data to determine whether the target data is included in the initial image data, where the target data is used to indicate information of a target object that meets a preset condition in the initial image data; A filtering module, configured to perform a filtering process on the initial image data when the target data is included in the initial image data, and obtain the image data of the target object based on a processing result; Wherein, the filtering module is configured to obtain the image data of the target object in the following manner: determine a data volume ratio of the target data in the initial image data; when determining that the data volume ratio is less than a preset value, determine a target filtering method according to a preset frame rate control strategy; when determining that the target filtering method is a scaling process, sequentially perform equal-proportion reduction and equal-proportion enlargement on the initial image data according to a preset scaling ratio coefficient to obtain first image data; perform a target fusion process on the first image data and the initial image data to obtain the image data of the target object.

7. A storage medium, characterized in that, a computer program is stored in the storage medium, wherein the computer program is configured to execute the method described in any one of claims 1 to 5 when running.

8. An electronic device, comprising a memory and a processor, characterized in that, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image recognition method and device, electronic equipment and storage medium

    CN111950520A

  • Image processing method, device and system, and computer storage medium

    CN112087590A