Image processing method and device
Automatic occlusion processing of video frame sequences is performed through the target detection and tracking network, which solves the problem of low manual processing efficiency and achieves efficient image occlusion processing.
Patent Information
- Application Number
- CN202210666525.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-06-13
AI Technical Summary
When the number of video frames or image identifiers is manually processed, the occlusion processing efficiency is low and it is difficult to meet the demand for fast processing.
The target detection network and target tracking network are used to locate and block the target objects in the target image frame sequence, automatically identify and process image areas, and reduce manual intervention.
It improves the efficiency of occlusion processing, reduces manpower consumption, and realizes automated image processing.
Smart Images

Figure CN114882425B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method and device. Background Art
[0002] With the development of computer science and technology, image processing technology continues to improve.
[0003] Based on various requirements such as publicity and management safety, brand promotion and advertising rights, it is necessary to block certain image logos (such as image logos used for advertising purposes) in video frames when playing videos. Currently, the blocking process is mainly completed manually using video editing software.
[0004] However, when the number of image frames or image identifiers to be processed is large, the processing efficiency of the manual processing method is low. Summary of the invention
[0005] In view of the above problems, the present invention provides an image processing method and device that overcomes the above problems or at least partially solves the above problems. The technical solution is as follows:
[0006] An image processing method, comprising:
[0007] Determine a target object to be occluded in a target image frame sequence;
[0008] Selecting a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection;
[0009] Inputting the image of the target object and the first portion of the image frame sequence into a trained target detection network to obtain first positioning information output by the target detection network, wherein the first positioning information includes position information of an image region where the target object is located in each image of the first portion of the image frame sequence;
[0010] Inputting the first positioning information and the second partial image frame sequence into a trained target tracking network to obtain second positioning information output by the target tracking network; wherein the second partial image frame sequence is composed of each frame image in the target image frame sequence except the first partial image frame sequence, and the second positioning information includes position information of an image region where the target object is located in each image in the second partial image frame sequence;
[0011] Based on the first positioning information and the second positioning information, occlusion processing is performed on the image area where the target object is located in each frame image of the target image frame sequence.
[0012] Optionally, the target detection network extracts target image features from the image of the target object, and for any frame image in the first partial image frame sequence: extracts image features of the frame image, performs correlation calculation on the image features of the frame image and the target image features, determines a local image feature in the frame image that has the greatest correlation with the target image feature, determines an image region in the frame image corresponding to the local image feature as a target region, and determines the position information of the target region as the position information of the image region where the target object is located in the frame image.
[0013] Optionally, when the target object includes multiple objects to be occluded of the same category, the target tracking network, for the position information of any object to be occluded in the first positioning information, associates the position information of the object to be occluded in the first positioning information with the position information of the image area where the object to be occluded is located in each frame image of the second partial image frame sequence.
[0014] Optionally, associating the position information of the object to be blocked in the first positioning information with the position information of the image region where the object to be blocked is located in each frame image of the second partial image frame sequence, includes:
[0015] Determine a frame image in the second part of the image frame sequence as the current target frame image, detect all similar objects of the object to be occluded in the current target frame image, determine the target similar object that matches the object to be occluded from all similar objects, determine the position information of the image area where the target similar object is located in the current target frame image as the position information of the image area where the object to be occluded is located in the current target frame image, associate the currently determined position information of the image area where the object to be occluded is located in each frame image, and return to execute the step of determining a frame image in the second part of the image frame sequence as the current target frame image until the position information of the image area where the object to be occluded is located in each frame image of the target image frame sequence is associated.
[0016] Optionally, the performing occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information respectively includes:
[0017] Based on the position information of the image regions where the associated objects to be occluded are located in each frame image of the target image frame sequence, occlusion processing is performed on the image regions where the objects to be occluded are located in the target image frame sequence.
[0018] Optionally, the target detection network uses a detection frame to identify the located target object in each frame image of the target image frame sequence; after obtaining the second positioning information output by the target tracking network, the image processing method further includes:
[0019] Determine, based on the first positioning information and the second positioning information, a motion trajectory of each of the detection boxes that have identified the target object in the target image frame sequence;
[0020] The motion trajectory is smoothed by using a mean filter processing method to eliminate the jitter of each detection frame that has identified the target object.
[0021] Optionally, the performing occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information respectively includes:
[0022] Based on the first positioning information and the second positioning information, background completion is performed on the image region where the target object is located in each frame image of the target image frame sequence to obtain an image frame sequence after background completion.
[0023] Optionally, performing background completion on an image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information to obtain an image frame sequence after background completion includes:
[0024] The first positioning information, the second positioning information and each frame image of the target image frame sequence are input into a spatiotemporal joint-based video restoration network STTN to obtain an image frame sequence after background completion output by the STTN.
[0025] An image processing device comprises: a first determining unit, a second determining unit, a first input unit, a first obtaining unit, a second input unit, a second obtaining unit and a first processing unit; wherein:
[0026] The first determining unit is used to determine the target object to be occluded in the target image frame sequence;
[0027] The second determining unit is used to select a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection;
[0028] The first input unit is used to input the image of the target object and the first partial image frame sequence into a trained target detection network;
[0029] The first obtaining unit is used to obtain first positioning information output by the target detection network, wherein the first positioning information includes position information of an image region where the target object is located in each image of the first partial image frame sequence;
[0030] The second input unit is used to input the first positioning information and the second part of the image frame sequence into the trained target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence;
[0031] The second obtaining unit is used to obtain second positioning information output by the target tracking network; the second positioning information includes position information of an image region where the target object is located in each image of the second partial image frame sequence;
[0032] The first processing unit is used to perform occlusion processing on the image area where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information.
[0033] Optionally, the target detection network extracts target image features from the image of the target object, and for any frame image in the first partial image frame sequence: extracts image features of the frame image, performs correlation calculation on the image features of the frame image and the target image features, determines a local image feature in the frame image that has the greatest correlation with the target image feature, determines an image region in the frame image corresponding to the local image feature as a target region, and determines the position information of the target region as the position information of the image region where the target object is located in the frame image.
[0034] Optionally, when the target object includes multiple objects to be occluded of the same category, the target tracking network, for the position information of any object to be occluded in the first positioning information, associates the position information of the object to be occluded in the first positioning information with the position information of the image area where the object to be occluded is located in each frame image of the second partial image frame sequence.
[0035] Optionally, the associating the position information of the object to be blocked in the first positioning information with the position information of the image region where the object to be blocked is located in each frame image of the second partial image frame sequence is set as follows:
[0036] Determine a frame image in the second part of the image frame sequence as the current target frame image, detect all similar objects of the object to be occluded in the current target frame image, determine the target similar object that matches the object to be occluded from all similar objects, determine the position information of the image area where the target similar object is located in the current target frame image as the position information of the image area where the object to be occluded is located in the current target frame image, associate the currently determined position information of the image area where the object to be occluded is located in each frame image, and return to execute the step of determining a frame image in the second part of the image frame sequence as the current target frame image until the position information of the image area where the object to be occluded is located in each frame image of the target image frame sequence is associated.
[0037] Optionally, the first processing unit is used to perform occlusion processing on the image area where each of the objects to be occluded is located in the target image frame sequence based on the position information of the image area where each of the associated objects to be occluded is located in each frame image of the target image frame sequence.
[0038] Optionally, the target detection network uses a detection frame to identify the located target object in each frame image of the target image frame sequence; the image processing device further includes: a third determination unit and a smoothing processing unit;
[0039] The third determining unit is configured to determine, after obtaining the second positioning information output by the target tracking network, a motion trajectory of each of the detection boxes that have identified the target object in the target image frame sequence based on the first positioning information and the second positioning information;
[0040] The smoothing processing unit is used to adopt a mean filter processing method to smooth the motion trajectory so as to eliminate the jitter of each detection frame that has marked the target object.
[0041] Optionally, the first processing unit is used to perform background completion on the image area where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information, so as to obtain an image frame sequence after background completion.
[0042] Optionally, the first processing unit is used to input the first positioning information, the second positioning information and each frame image of the target image frame sequence into a spatiotemporal joint-based video restoration network STTN to obtain an image frame sequence after background completion output by the STTN.
[0043] The image processing method and device proposed by the present invention can determine the target object to be occluded in the target image frame sequence; select part of the images from the target image frame sequence to be determined as the first part of the image frame sequence to be detected; input the image of the target object and the first part of the image frame sequence into the trained target detection network to obtain the first positioning information output by the target detection network, the first positioning information includes the position information of the image area where the target object is located in each image of the first part of the image frame sequence; input the first positioning information and the second part of the image frame sequence into the trained target tracking network to obtain the second positioning information output by the target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence, and the second positioning information includes the position information of the image area where the target object is located in each image of the second part of the image frame sequence; based on the first positioning information and the second positioning information, the image area where the target object is located in each frame image of the target image frame sequence is occluded. The present invention can use the target detection network and the target tracking network to perform occlusion processing on the target object of the target image frame sequence without using manual processing to perform occlusion processing, which can effectively reduce manpower consumption and effectively improve the efficiency of occlusion processing.
[0044] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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 embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0046] Figure 1 A flowchart of a first image processing method provided by an embodiment of the present invention is shown;
[0047] Figure 2 A flow chart of a second image processing method provided by an embodiment of the present invention is shown;
[0048] Figure 3 A flowchart of a third image processing method provided by an embodiment of the present invention is shown;
[0049] Figure 4 A schematic structural diagram of an image processing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0050] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0051] like Figure 1 As shown, this embodiment proposes a first image processing method, which may include the following steps:
[0052] S101, determining a target object to be occluded in a target image frame sequence;
[0053] The target image frame sequence may be an image frame sequence of a target video, and the target video may be a video that needs to perform occlusion processing on certain image contents.
[0054] The target object may be an object that needs to be occluded in the target image frame sequence. It should be noted that the target object may be a face, an object, an advertising logo or text, etc. The present invention does not limit the specific type of the target object.
[0055] Optionally, the target object may include only one object.
[0056] Optionally, the target object may include multiple objects of the same category, such as multiple beverage bottles of the same brand.
[0057] Optionally, the target object may include multiple objects of different categories, such as beverage bottles and mineral water bottles.
[0058] Specifically, the present invention can obtain an image of the target object after determining the target object. The present invention can use a camera to shoot the target object to obtain the image of the target object, or can cut out the image of the target object from a certain frame image in the target image frame sequence.
[0059] S102, selecting a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection;
[0060] Specifically, the present invention can select one or more image frames from the target image frame sequence as the first partial image frame sequence.
[0061] Optionally, when selecting multiple frames of images from the target image frame sequence as the first part of the image frame sequence, the present invention can perform frame skipping selection according to the order of images, for example, selecting one frame of image every three frames, and using all the frame images selected by frame skipping as the first part of the image frame sequence.
[0062] Optionally, the present invention may also randomly select multiple frames of images from the target image frame sequence as the first part of the image frame sequence.
[0063] S103, inputting the image of the target object and the first part of the image frame sequence into a trained target detection network;
[0064] The target detection network may be a neural network used to detect a specified object in an image.
[0065] Specifically, the present invention can input both the image of the target object and the first part of the image frame sequence into the target detection network after obtaining the image of the target object and the first part of the image frame sequence.
[0066] Specifically, after obtaining the image of the target object and the first portion of the image frame sequence, the target detection network can detect the image region where the target object is located in each image of the first portion of the image frame sequence.
[0067] Optionally, the object detection network can use a detection box to identify the image region where the detected target object is located.
[0068] Optionally, when the target object includes multiple objects, the present invention can input the images of the multiple objects and the first part of the image frame sequence into the target detection network. In this case, the target detection network can detect the image area where each object is located in each image of the first part of the image frame sequence based on the image of each object. For example, when the target object includes a first object and a second object, the target detection network can detect the image area where the first object is located in each image of the first part of the image frame sequence based on the first object, and then can detect the image area where the second object is located in each image of the first part of the image frame sequence based on the second object.
[0069] Optionally, in other image processing methods proposed in this embodiment, the target detection network extracts target image features from the image of the target object, and for any frame image in the first part of the image frame sequence: extracts the image features of the frame image, performs correlation calculation on the image features of the frame image and the target image features, determines the local image features in the image features of the frame image that have the greatest correlation with the target image features, determines the image area in the frame image corresponding to the local image features as the target area, and determines the position information of the target area as the position information of the image area where the target object is located in the frame image.
[0070] Specifically, the target detection network can be a target detection network based on feature matching.
[0071] The target image feature may be an image feature of a target object.
[0072] Specifically, when calculating the correlation between the image features of the target object and the image features of a frame image in the first part of the image frame sequence, the target detection network can use correlation filtering to calculate a response map, and in the calculated response map, determine the area with larger values as the area with higher probability, that is, determine it as the image area where the target object is located in the frame image.
[0073] Specifically, when performing correlation calculation, the present invention can obtain a correlation graph c. The greater the correlation, the more similar the region is to the target template.
[0074]
[0075] Wherein, h is the image of the target object, f is a frame image in the first part of the image frame sequence, n, m, i and j are all pixel indexes; the symbol <> represents matrix dot multiplication, and || represents the absolute value of the matrix.
[0076] S104, obtaining first positioning information output by the target detection network, where the first positioning information includes position information of an image region where the target object is located in each image of the first part of the image frame sequence;
[0077] Specifically, when the target object includes only one object, the present invention can obtain the position information of the image area where the target object output by the target detection network is located in each image of the first part of the image frame sequence.
[0078] Specifically, when the target object includes multiple objects, the present invention can obtain the position information of the image area where each object is located in each image of the first part of the image frame sequence output by the target detection network. For example, when the target object includes a first object and a second object, the present invention can obtain the position information of the image area where the first object is located in various images of the first part of the image frame sequence output by the target detection network, and can obtain the position information of the image area where the second object is located in various images of the first part of the image frame sequence output by the target detection network.
[0079] S105, inputting the first positioning information and the second part of the image frame sequence into a trained target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence.
[0080] The second part of the image frame sequence is composed of images in the target image frame sequence except the first part of the image frame sequence, which are arranged in order. It can be understood that the second part of the image frame sequence may include only one frame of image or multiple frames of image.
[0081] The target tracking network may be a neural network used to track the target object in the second part of the image frame sequence according to the detection result of the target detection network.
[0082] Specifically, after obtaining the first positioning information, the present invention can input the first positioning information and the second part of the image frame sequence into the target tracking network.
[0083] Specifically, the target tracking network can detect and track the target object in the second portion of the image frame sequence based on the first positioning information, and determine the position information of the image area where the target object is located in each image of the second portion of the image frame sequence.
[0084] S106, obtaining second positioning information output by the target tracking network; the second positioning information includes position information of an image region where the target object is located in each image of the second part of the image frame sequence;
[0085] Specifically, when the target object includes multiple objects, and the first positioning information includes the position information of the image regions where the multiple objects are located in each image of the first part of the image frame sequence, the target tracking network can track each object in the second part of the image frame sequence based on the position information of the image region where each object is located in each image of the first part of the image frame sequence. For example, when the target object includes the first object and the second object, and the first positioning information includes the position information of the image region where the first object and the second object are located in each image of the first part of the image frame sequence, the target tracking network can first detect and track in each image of the second part of the image frame sequence based on the position information of the image region where the first object is located in each image of the first part of the image frame sequence, and determine the position information of the image region where the first object is located in each image of the second part of the image frame sequence, and then can detect and track in each image of the second part of the image frame sequence based on the position information of the image region where the second object is located in each image of the first part of the image frame sequence, and determine the position information of the image region where the second object is located in each image of the second part of the image frame sequence.
[0086] It should be noted that, when the present invention adopts the frame skipping selection method to select the first part of the image frame sequence, the tracking accuracy and tracking efficiency of the target tracking network can be effectively improved.
[0087] S107 . Based on the first positioning information and the second positioning information, perform occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence.
[0088] Specifically, after obtaining the first positioning information and the second positioning information, the present invention can perform occlusion processing on the image area corresponding to the first positioning information and the second positioning information in the target image frame sequence.
[0089] Optionally, the present invention can implement occlusion processing of image processing by performing mosaic processing on the image area.
[0090] Optional, such as Figure 2 As shown, in the second image processing method proposed in this embodiment, step S107 may be step S201. Wherein:
[0091] S201 . Based on the first positioning information and the second positioning information, background completion is performed on an image region where a target object is located in each frame image of a target image frame sequence to obtain an image frame sequence after background completion.
[0092] Specifically, the present invention can implement occlusion processing on the image area by performing background completion on the image area.
[0093] Optional, such as Figure 3 As shown, in the third image processing method proposed in this embodiment, the above step S201 can be specifically S301. Wherein:
[0094] S301, inputting the first positioning information, the second positioning information and each frame image of the target image frame sequence into a spatial-temporal transformer network (STTN) based on a spatiotemporal joint video restoration network to obtain an image frame sequence after background completion output by the STTN.
[0095] Specifically, after obtaining the first positioning information and the second positioning information, the present invention can send the first positioning information, the second positioning information and the target image frame sequence to the STTN, and the STTN performs background completion on the image area where the target object is located.
[0096] It should be noted that the present invention can utilize the target detection network and the target tracking network to perform occlusion processing on the target object in the target image frame sequence without using manual processing methods, which can effectively reduce manpower consumption and effectively improve the occlusion processing efficiency.
[0097] The image processing method proposed in this embodiment can determine the target object to be occluded in the target image frame sequence; select a part of the image from the target image frame sequence to be determined as the first part of the image frame sequence to be detected; input the image of the target object and the first part of the image frame sequence into the trained target detection network to obtain the first positioning information output by the target detection network, the first positioning information includes the position information of the image area where the target object is located in each image of the first part of the image frame sequence; input the first positioning information and the second part of the image frame sequence into the trained target tracking network to obtain the second positioning information output by the target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence, and the second positioning information includes the position information of the image area where the target object is located in each image of the second part of the image frame sequence; based on the first positioning information and the second positioning information, the image area where the target object is located in each frame image of the target image frame sequence is occluded. The present invention can use the target detection network and the target tracking network to perform occlusion processing on the target object of the target image frame sequence without using manual processing to perform occlusion processing, which can effectively reduce manpower consumption and effectively improve the efficiency of occlusion processing.
[0098] based on Figure 1 This embodiment proposes a fourth image processing method. In this method, when the target object includes multiple objects to be occluded of the same category, the target tracking network associates the position information of any object to be occluded in the first positioning information with the position information of the image region where the object to be occluded is located in each frame image of the second partial image frame sequence.
[0099] The position information of a certain object to be blocked in the first positioning information includes the position information of the image region where the object to be blocked is located in each frame image of the first partial image frame sequence.
[0100] Specifically, the target tracking network can determine the position information of the image region where the object to be occluded is located in each frame image of the second partial image frame sequence based on the position information of a certain object to be occluded in the first positioning information. Afterwards, the target tracking network can associate the position information of the image region where the object to be occluded is located in each frame image of the first partial image frame sequence and the second partial image frame sequence, that is, associate the position information of the image region where the object to be occluded is located in each frame image of the target image frame sequence.
[0101] Optionally, the above step S107 may include:
[0102] Based on the position information of the image regions where the associated objects to be occluded are located in each frame image of the target image frame sequence, occlusion processing is performed on the image regions where the objects to be occluded are located in the target image frame sequence.
[0103] Specifically, the present invention can respectively associate the position information of the image area where each object to be occluded is located in each frame image of the target image frame sequence. At this time, when the present invention subsequently performs occlusion processing on the target object in each frame image of the target image frame sequence, it can respectively perform occlusion processing on each object to be occluded according to the associated position information of each object to be occluded. For example, when the target object includes a first object and a second object, the present invention can first perform occlusion processing on the first object in each frame image of the target image frame sequence according to the associated position information of the first object, and then perform occlusion processing on the second object in each frame image of the target image frame sequence according to the associated position information of the second object.
[0104] It should be noted that when there are similarities between multiple objects to be occluded, there may be confusion in the occlusion processing of the target object, which in turn leads to a reduction in the processing efficiency of the occlusion processing. The present invention first associates the position information of the occluded object in each frame image of the target image frame sequence, and then performs occlusion processing on the occluded object according to the associated position information of the occluded object, which can effectively avoid confusion that may exist in the occlusion processing of multiple objects to be occluded, and ensure processing efficiency.
[0105] Optionally, associating the position information of the object to be blocked in the first positioning information with the position information of the image region where the object to be blocked is located in each frame image of the second partial image frame sequence may include:
[0106] Determine a frame image in the second part of the image frame sequence as the current target frame image, detect all similar objects of the object to be occluded in the current target frame image, determine the target similar object that matches the object to be occluded from all similar objects, determine the position information of the image area where the target similar object is located in the current target frame image as the position information of the image area where the object to be occluded is located in the current target frame image, associate the position information of the image area where the currently determined object to be occluded is located in each frame image, and return to execute the step of determining a frame image in the second part of the image frame sequence as the current target frame image, until the position information of the image area where the object to be occluded is located in each frame image of the target image frame sequence is associated.
[0107] Specifically, in the process of associating the position information of the image area of a certain object to be occluded in each frame image of the target image frame sequence, the present invention can first associate the position information of the object to be occluded in the first positioning information, and then associate the associated position information with the position information of the object to be occluded in each image of the second part of the image frame sequence one by one. For example, first associate the position information of the object to be occluded in the first frame image of the second part of the image frame sequence, and then associate all the currently associated position information of the object to be occluded with the position information of the object in the second frame image of the second part of the image frame sequence.
[0108] Specifically, when associating the position information of an object to be occluded, the present invention can also first determine the position information of the image area where the object to be occluded is located in each frame image of the second part of the image frame sequence, and then associate the position information of the image area where the object to be occluded is located in each frame image of the first part of the image frame sequence and the second part of the image frame sequence.
[0109] The image processing method proposed in this embodiment can effectively avoid possible confusion in the process of occlusion processing of multiple objects to be occluded, thereby ensuring processing efficiency.
[0110] based on Figure 1 This embodiment proposes a fifth image processing method. In this method, the target detection network uses a detection frame to identify the located target object in each frame image of the target image frame sequence; after step S106, the method may further include the following steps:
[0111] Determine, based on the first positioning information and the second positioning information, a motion trajectory of each detection frame of the identified target object in the target image frame sequence;
[0112] The motion trajectory is smoothed by using mean filtering to eliminate the jitter of each detection frame of the identified target object.
[0113] Specifically, after obtaining the first positioning information and the second positioning information of the target object, the present invention can associate all the position information of the target object in the target image frame sequence to obtain the spatiotemporal positioning information and motion trajectory of the target object, that is, the spatiotemporal positioning information and motion trajectory of the detection frame can be obtained; thereafter, the present invention can use mean filtering to smooth the motion trajectory of the detection frame to eliminate possible jitter of the detection frame.
[0114] The image processing method proposed in this embodiment can eliminate possible jitters in the detection frame.
[0115] and Figure 1 The method shown corresponds to Figure 4As shown, this embodiment provides an image processing device, which may include: a first determining unit 101, a second determining unit 102, a first input unit 103, a first obtaining unit 104, a second input unit 105, a second obtaining unit 106 and a first processing unit 107; wherein:
[0116] A first determining unit 101 is used to determine a target object to be occluded in a target image frame sequence;
[0117] A second determining unit 102 is used to select a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection;
[0118] A first input unit 103 is used to input the image of the target object and the first part of the image frame sequence into the trained target detection network;
[0119] A first obtaining unit 104 is used to obtain first positioning information output by the target detection network, where the first positioning information includes position information of an image region where the target object is located in each image of the first part of the image frame sequence;
[0120] The second input unit 105 is used to input the first positioning information and the second part of the image frame sequence into the trained target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence;
[0121] The second obtaining unit 106 is used to obtain second positioning information output by the target tracking network; the second positioning information includes position information of an image region where the target object is located in each image of the second part of the image frame sequence;
[0122] The first processing unit 107 is configured to perform occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information.
[0123] It should be noted that the specific processing of the first determining unit 101, the second determining unit 102, the first input unit 103, the first obtaining unit 104, the second input unit 105, the second obtaining unit 106 and the first processing unit 107 and the technical effects thereof can refer to the specific processing of the first determining unit 101, the second determining unit 102, the first input unit 103, the first obtaining unit 104, the second input unit 105, the second obtaining unit 106 and the first processing unit 107. Figure 1 The relevant descriptions of steps S101, S102, S103, S104, S105, S106 and S107 are not repeated here.
[0124] Optionally, the target detection network extracts target image features from the image of the target object, and for any frame image in the first part of the image frame sequence: extracts the image features of the frame image, performs correlation calculation on the image features of the frame image and the target image features, determines the local image features in the frame image that have the greatest correlation with the target image features, determines the image area in the frame image corresponding to the local image features as the target area, and determines the position information of the target area as the position information of the image area where the target object is located in the frame image.
[0125] Optionally, when the target object includes multiple objects to be occluded of the same category, the target tracking network, for the position information of any object to be occluded in the first positioning information, associates the position information of the object to be occluded in the first positioning information with the position information of the image area where the object to be occluded is located in each frame image of the second part of the image frame sequence.
[0126] Optionally, the position information of the object to be blocked in the first positioning information is associated with the position information of the image region where the object to be blocked is located in each frame image of the second partial image frame sequence, and is set as:
[0127] Determine a frame image in the second part of the image frame sequence as the current target frame image, detect all similar objects of the object to be occluded in the current target frame image, determine the target similar object that matches the object to be occluded from all similar objects, determine the position information of the image area where the target similar object is located in the current target frame image as the position information of the image area where the object to be occluded is located in the current target frame image, associate the position information of the image area where the currently determined object to be occluded is located in each frame image, and return to execute the step of determining a frame image in the second part of the image frame sequence as the current target frame image, until the position information of the image area where the object to be occluded is located in each frame image of the target image frame sequence is associated.
[0128] Optionally, the first processing unit 107 is used to perform occlusion processing on the image area where each object to be occluded is located in the target image frame sequence based on the position information of the image area where each associated object to be occluded is located in each frame image of the target image frame sequence.
[0129] Optionally, the target detection network uses a detection frame to identify the located target object in each frame image of the target image frame sequence; the image processing device further includes: a third determination unit and a smoothing processing unit;
[0130] A third determination unit is used to determine, after obtaining the second positioning information output by the target tracking network, the motion trajectory of each detection frame of the identified target object in the target image frame sequence based on the first positioning information and the second positioning information;
[0131] The smoothing processing unit is used to use a mean filter processing method to smooth the motion trajectory to eliminate the jitter of each detection frame of the marked target object.
[0132] Optionally, the first processing unit 107 is used to perform background completion on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information, so as to obtain an image frame sequence after background completion.
[0133] Optionally, the first processing unit 107 is used to input the first positioning information, the second positioning information and each frame image of the target image frame sequence into a spatiotemporal joint-based video restoration network STTN to obtain an image frame sequence after background completion output by the STTN.
[0134] The image processing device proposed in this embodiment can determine the target object to be occluded in the target image frame sequence; select a part of the images from the target image frame sequence to be determined as the first part of the image frame sequence to be detected; input the image of the target object and the first part of the image frame sequence into the trained target detection network to obtain the first positioning information output by the target detection network, the first positioning information includes the position information of the image area where the target object is located in each image of the first part of the image frame sequence; input the first positioning information and the second part of the image frame sequence into the trained target tracking network to obtain the second positioning information output by the target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence, and the second positioning information includes the position information of the image area where the target object is located in each image of the second part of the image frame sequence; based on the first positioning information and the second positioning information, the image area where the target object is located in each frame image of the target image frame sequence is occluded. The present invention can use the target detection network and the target tracking network to perform occlusion processing on the target object of the target image frame sequence without using manual processing to perform occlusion processing, which can effectively reduce manpower consumption and effectively improve the efficiency of occlusion processing.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An image processing method, characterized in that: include: Determine a target object to be occluded in a target image frame sequence; Selecting a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection; Inputting the image of the target object and the first portion of the image frame sequence into a trained target detection network to obtain first positioning information output by the target detection network, wherein the first positioning information includes position information of an image region where the target object is located in each image of the first portion of the image frame sequence; Inputting the first positioning information and the second partial image frame sequence into a trained target tracking network to obtain second positioning information output by the target tracking network; wherein the second partial image frame sequence is composed of each frame image in the target image frame sequence except the first partial image frame sequence, and the second positioning information includes position information of an image region where the target object is located in each image in the second partial image frame sequence; Based on the first positioning information and the second positioning information, occlusion processing is performed on the image area where the target object is located in each frame image of the target image frame sequence.
2. The image processing method according to claim 1, characterized in that: The target detection network extracts target image features from the image of the target object, and for any frame image in the first partial image frame sequence: extracts image features of the frame image, performs correlation calculation between the image features of the frame image and the target image features, determines the local image features with the greatest correlation with the target image features among the image features of the frame image, determines the image area in the frame image corresponding to the local image features as the target area, and determines the position information of the target area as the position information of the image area where the target object is located in the frame image.
3. The image processing method according to claim 1, characterized in that: When the target object includes multiple objects to be occluded of the same category, the target tracking network, for the position information of any object to be occluded in the first positioning information, associates the position information of the object to be occluded in the first positioning information with the position information of the image area where the object to be occluded is located in each frame image of the second partial image frame sequence.
4. The image processing method according to claim 3, characterized in that: The associating the position information of the object to be blocked in the first positioning information with the position information of the image region where the object to be blocked is located in each frame image of the second partial image frame sequence, comprises: Determine a frame image in the second part of the image frame sequence as the current target frame image, detect all similar objects of the object to be occluded in the current target frame image, determine the target similar object that matches the object to be occluded from all similar objects, determine the position information of the image area where the target similar object is located in the current target frame image as the position information of the image area where the object to be occluded is located in the current target frame image, associate the currently determined position information of the image area where the object to be occluded is located in each frame image, and return to execute the step of determining a frame image in the second part of the image frame sequence as the current target frame image until the position information of the image area where the object to be occluded is located in each frame image of the target image frame sequence is associated.
5. The image processing method according to claim 3 or 4, characterized in that: The performing occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information respectively includes: Based on the position information of the image regions where the associated objects to be occluded are located in each frame image of the target image frame sequence, occlusion processing is performed on the image regions where the objects to be occluded are located in the target image frame sequence.
6. The image processing method according to claim 1, characterized in that: The target detection network identifies the located target object using a detection frame in each frame image of the target image frame sequence; After obtaining the second positioning information output by the target tracking network, the image processing method further includes: Determine, based on the first positioning information and the second positioning information, a motion trajectory of each of the detection boxes that have identified the target object in the target image frame sequence; The motion trajectory is smoothed by using a mean filter processing method to eliminate the jitter of each detection frame that has identified the target object.
7. The image processing method according to claim 1, characterized in that: The performing occlusion processing on the image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information respectively includes: Based on the first positioning information and the second positioning information, background completion is performed on the image region where the target object is located in each frame image of the target image frame sequence to obtain an image frame sequence after background completion.
8. The image processing method according to claim 7, characterized in that: The method of performing background completion on an image region where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information to obtain an image frame sequence after background completion includes: The first positioning information, the second positioning information and each frame image of the target image frame sequence are input into a spatiotemporal joint-based video restoration network STTN to obtain an image frame sequence after background completion output by the STTN.
9. An image processing device, characterized in that: include: A first determining unit, a second determining unit, a first input unit, a first obtaining unit, a second input unit, a second obtaining unit and a first processing unit; wherein: The first determining unit is used to determine the target object to be occluded in the target image frame sequence; The second determining unit is used to select a portion of images from the target image frame sequence to be determined as a first portion of the image frame sequence to be subjected to target detection; The first input unit is used to input the image of the target object and the first partial image frame sequence into a trained target detection network; The first obtaining unit is used to obtain first positioning information output by the target detection network, wherein the first positioning information includes position information of an image region where the target object is located in each image of the first partial image frame sequence; The second input unit is used to input the first positioning information and the second part of the image frame sequence into the trained target tracking network; wherein the second part of the image frame sequence is composed of each frame image in the target image frame sequence except the first part of the image frame sequence; The second obtaining unit is used to obtain second positioning information output by the target tracking network; the second positioning information includes position information of an image region where the target object is located in each image of the second partial image frame sequence; The first processing unit is used to perform occlusion processing on the image area where the target object is located in each frame image of the target image frame sequence based on the first positioning information and the second positioning information.
10. The image processing device according to claim 9, characterized in that: The target detection network extracts target image features from the image of the target object, and for any frame image in the first partial image frame sequence: extracts image features of the frame image, performs correlation calculation between the image features of the frame image and the target image features, determines the local image features with the greatest correlation with the target image features among the image features of the frame image, determines the image area in the frame image corresponding to the local image features as the target area, and determines the position information of the target area as the position information of the image area where the target object is located in the frame image.
