WO2022040988A1 - Image processing method and apparatus, and movable platform - Google Patents
Image processing method and apparatus, and movable platform Download PDFInfo
- Publication number
- WO2022040988A1 WO2022040988A1 PCT/CN2020/111450 CN2020111450W WO2022040988A1 WO 2022040988 A1 WO2022040988 A1 WO 2022040988A1 CN 2020111450 W CN2020111450 W CN 2020111450W WO 2022040988 A1 WO2022040988 A1 WO 2022040988A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- pixel block
- pixel
- camera
- pose
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 28
- 238000000034 method Methods 0.000 claims abstract description 75
- 238000012545 processing Methods 0.000 claims abstract description 37
- 230000003068 static effect Effects 0.000 claims description 82
- 230000003287 optical effect Effects 0.000 claims description 32
- 230000033001 locomotion Effects 0.000 claims description 27
- 238000013507 mapping Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 13
- 230000008569 process Effects 0.000 claims description 10
- 230000011218 segmentation Effects 0.000 claims description 8
- 230000008859 change Effects 0.000 claims description 7
- 230000002093 peripheral effect Effects 0.000 claims description 7
- 230000003993 interaction Effects 0.000 claims description 4
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 24
- 239000013598 vector Substances 0.000 description 20
- 238000004422 calculation algorithm Methods 0.000 description 16
- 238000001914 filtration Methods 0.000 description 16
- 239000011159 matrix material Substances 0.000 description 15
- 230000000694 effects Effects 0.000 description 10
- 238000006073 displacement reaction Methods 0.000 description 7
- 238000000605 extraction Methods 0.000 description 5
- 230000002452 interceptive effect Effects 0.000 description 5
- 239000010813 municipal solid waste Substances 0.000 description 5
- 238000001514 detection method Methods 0.000 description 4
- 230000036544 posture Effects 0.000 description 4
- 230000000295 complement effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000002187 spin decoupling employing ultra-broadband-inversion sequences generated via simulated annealing Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
- G06T7/55—Depth or shape recovery from multiple images
- G06T7/593—Depth or shape recovery from multiple images from stereo images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
- H04N23/951—Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10052—Images from lightfield camera
Definitions
- the present application relates to the technical field of image processing, and in particular, to an image processing method, device and movable platform.
- non-target subjects In the process of shooting images or videos, users are usually faced with a scene where non-target subjects appear within the shooting angle of view, and these non-target subjects are also captured in the final image or video, which affects the final shooting effect. For example, assuming that the user is photographing a building, there may be some non-target subjects such as passers-by, vehicles, trash cans or telephone poles next to the building. These non-target subjects will block the photographed building, or appear in the In the captured image, it affects the display effect of the image. In order to improve the shooting effect of images or videos to better meet the shooting needs of users, it is necessary to propose a solution for removing non-target shooting objects in images.
- the present application provides an image processing method, device and movable platform.
- an image processing method comprising:
- the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
- the first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
- an image processing method comprising:
- the pixel block of the corresponding pixel position is the third image of the static area
- the first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
- an image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
- the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
- the first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
- an image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
- the first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
- a movable platform is provided, where the movable platform includes a camera device and any one of the image processing devices in the embodiments of the present application.
- the second image including the target object occluded by the object to be filtered is used to complete the occluded target object in the first image, so as to eliminate the first image.
- the objects to be filtered out in the image are not only suitable for filtering out dynamic objects, but also for filtering out static objects.
- the purpose of automatically filtering out the non-shooting target objects in the image can be realized according to the user's needs, which can improve the quality of the image. Display effect and user experience.
- FIG. 1 is a schematic diagram of filtering out non-shooting target objects in an image according to an embodiment of the present application.
- FIG. 2 is a flowchart of an image processing method according to an embodiment of the present application.
- FIG. 3 is a schematic diagram of determining a first pixel block corresponding to an object to be filtered out according to an embodiment of the present application.
- FIG. 4 is a schematic diagram of a prompting interface for prompting a user to adjust to a second pose according to an embodiment of the present application.
- FIG. 5 is a schematic diagram of adjusting a camera device to a second pose according to an embodiment of the present application.
- FIG. 6 is a schematic diagram of determining a second pose according to an embodiment of the present application.
- Fig. 7 is a schematic diagram of determining corresponding pixel regions of an object to be filtered and a target object according to an embodiment of the present application.
- FIG. 8 is a schematic diagram of determining a second orientation according to an embodiment of the present application.
- FIG. 9 is a schematic diagram of determining whether an image captured by a camera device can be used as a second image according to an embodiment of the present application.
- FIG. 10 is a schematic diagram of determining whether an image captured by a camera device can be used as a second image according to an embodiment of the present application.
- FIG. 11( a ) is a schematic diagram of filtering out dynamic objects according to an embodiment of the present application.
- FIG. 11( b ) is a schematic diagram of determining a third image according to an embodiment of the present application.
- FIG. 12 is a flowchart of an image processing method according to an embodiment of the present application.
- FIG. 13 is a schematic diagram of an application scenario of an embodiment of the present application.
- FIG. 14 is a schematic diagram of filtering out dynamic objects according to an embodiment of the present application.
- FIG. 15 is a schematic diagram of a frame selection of an object to be filtered out and an occluded background area according to an embodiment of the present application.
- FIG. 16 is a schematic diagram of filtering out static objects according to an embodiment of the present application.
- FIG. 17 is a schematic diagram of a logical structure of an image processing apparatus according to an embodiment of the present application.
- non-shooting target objects within the shooting angle of view, and these non-shooting target objects are also captured in the image, which affects the display effect of the image.
- These non-target objects may be dynamic, such as walking passers-by, vehicles, etc., or static, such as trash cans, telephone poles, buildings, etc.
- the user wants to photograph the house 11 and its surrounding scenery, but the trash can 12 and passers-by in front of the house are also photographed in the image 13, which seriously affects the visual effect of the image. Therefore, it is necessary to remove these non-shooting target objects in the image, as shown in (b) in FIG. 1 , so that the image has a better shooting effect and improves the user experience.
- the embodiment of the present application provides an image processing method.
- the second image is collected from the second pose of the target object occluded by the object to be filtered, so as to use the second image to complement the target object occluded by the object to be filtered in the first image, so as to achieve the purpose of removing the object to be filtered.
- Figure 2 the flow chart of the method is shown in Figure 2, which includes the following steps:
- S204 Acquire a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the target object in the first image that is to be filtered Except for objects occluded by objects;
- the image processing method in this embodiment of the present application may be performed by a camera device that captures the first image and the second image, and the camera device may be any device with an image or video capture function.
- the camera device may be a camera, or a device Terminals such as cameras, mobile phones, tablets, laptops, and smart wearable devices with cameras can also be mobile platforms such as drones, unmanned vehicles, and handheld PTZs with cameras.
- the image processing methods of the embodiments of the present application may also be performed by other devices that are communicatively connected to the camera, for example, a cloud server, and the camera will send the first image and the second image after collecting the first image and the second image.
- the cloud server of course, if the camera device is a movable platform, the image processing method in this embodiment of the present application may also be executed by a control terminal communicatively connected to the mobile platform, which is not limited in this application.
- the object to be filtered out in this embodiment of the present application refers to an object that the user wishes to remove from the first image.
- the object to be filtered out may be a dynamic object or a static object, and there may be one or more objects to be filtered out.
- the target object in this embodiment of the present application refers to an object in the first image that is occluded by the object to be filtered out, and there may be one or more target objects.
- the first pixel block corresponding to the object to be filtered out can be determined in the first image, and then a second image containing the target object occluded by the object to be filtered out is acquired, and the second image is used
- the second pixel block corresponding to the target object in the first image performs replacement processing on the first pixel block in the first image, so that the object to be filtered out in the first image can be eliminated.
- the target object in another image is complemented by the image including the target object occluded by the object to be filtered, so as to eliminate the object to be filtered out in the other image by acquiring the images collected by the camera in different poses.
- This method can automatically filter out the non-shooting target objects of the image according to user needs, which can improve the display effect and user experience of the image.
- the device can automatically identify the object to be filtered from the first image. For example, some identification rules for the object to be filtered can be preset, and then the object to be filtered can be identified according to these rules. For example, the object to be filtered can be automatically identified. Objects such as trash cans, utility poles, and walking vehicles are identified from the first image as objects to be filtered out, and objects located at the edge of the image can also be identified as objects to be filtered out.
- the identified object to be filtered out can also be displayed to the user, for example, an image of the object to be filtered out is displayed in a frame on the user interface, and subsequent steps are performed after the user confirms.
- the object to be filtered out may be determined in the first image according to the user's instruction, for example, the user may click or frame the object to be filtered out in the image.
- the first pixel block may be a pixel block that only includes the object to be filtered out, or a pixel block that includes the object to be filtered out and its surrounding part of the background.
- the first pixel block may be a human-shaped outline area 31 including only the person to be filtered out, or may be a rectangular area 32 including the person to be filtered out and its surrounding background area.
- the user instruction for determining the object to be filtered may include a check box input by the user through a human-computer interaction interface, where the check box is used to frame the object to be filtered out.
- the user can directly draw a selection frame on the user interface to select the objects to be filtered out.
- the selection frame drawn by the user can be a rectangular selection frame, a circular selection frame or an irregular shaped selection frame, which can be set according to actual needs.
- the image area selected by the user through the selection frame may be used as the first pixel block corresponding to the object to be filtered out. Since the selection frame drawn by the user may not be accurate enough, there may be some edge areas of the object to be filtered out that are not The frame is selected, but some background areas are frame-selected instead, and when the first pixel block is replaced, there may be incompletely replaced objects to be filtered out in the replaced image, which causes the image to appear after the image is replaced. In order to avoid this phenomenon, after the user inputs the marquee to select the object to be filtered out, the first image can be subjected to superpixel segmentation processing to obtain multiple image areas, and then the marquee selection is performed according to the multiple image areas. pixel block to adjust.
- the principle of superpixel segmentation processing is to group pixels, and group adjacent pixels with similar texture, color, brightness and other characteristics into a group as an image area, so that the image can be divided into multiple image areas. Then, the pixel blocks framed in the marquee can be adjusted according to the multiple image areas.
- it can be implemented by using a currently common algorithm, and details are not described herein again.
- the ratio of the portion of each image region that falls into the marquee to the image region can be adjusted. to adjust the pixel block selected by the marquee. For example, you can first determine the proportion of the part of each image area that falls into the marquee to the image area. If the proportion is greater than a preset proportion, such as greater than 50%, it is considered that the image area is selected by the marquee, and the image area is selected. If it is smaller than the marquee, it is considered that the image area is not selected by the marquee, and the image area is placed outside the marquee to adjust the pixel block selected by the marquee.
- a preset proportion such as greater than 50%
- the selection frame in order to ensure that the first pixel block corresponding to the object to be filtered is within the selection frame as much as possible, after adjusting the pixel block selected by the selection frame in the above-mentioned manner, the selection frame can also be enlarged. Expand the pixel block selected by the marquee to serve as the first pixel block.
- the camera device can be mounted on a movable platform, and the camera device can be controlled by controlling the movement of the movable platform The movement is adjusted so that the second pose occluded by the object to be filtered can be observed and a second image is acquired.
- the movable platform can be any electronic device that includes a power component that can drive the movable platform to move.
- the movable platform can be any one of drones, unmanned vehicles, unmanned ships, or intelligent robots.
- the camera device can also be mounted on the movable platform through the pan-tilt.
- the movable platform can be provided with a pan-tilt, and the camera device can be fixed on the pan-tilt, and the camera can be controlled by controlling the movement of the movable platform.
- the movement of the device can also be controlled to make the camera device and the movable platform move relative to each other by controlling the movement of the PTZ, so as to control the movement of the camera device to adjust to the second pose.
- the second pose may include a second position and a second orientation.
- the movable platform In a scene where the camera device is mounted on the movable platform through the gimbal, when the camera device is controlled to move, the movable platform can be controlled to move so as to make the camera move.
- the camera device is located at the second position, and the orientation of the camera device can be adjusted to the second orientation by controlling the rotation of the pan/tilt.
- a gimbal can be set on the UAV, and a camera device can be installed on the gimbal.
- the UAV can be controlled to fly to the second position to reach the first position.
- the pan/tilt can be controlled to rotate, so that the orientation of the camera device is adjusted to the second orientation.
- a variety of ways can be used in acquiring the second image. For example, it is possible to first determine the second pose where the target object can be observed, and then directly control the camera to adjust to the second pose to collect the second image.
- the pose of the camera can also be changed continuously to obtain the Multiple frames of images collected in different poses, and then each time a frame of image is collected, it is determined whether the image includes a complete target object, until an image including the complete target object is obtained, which is taken as the second image.
- the camera device in order to capture the target object that is occluded by the object to be filtered out, it may be automatically determined that the camera can observe the second pose of the target object, and then the camera is controlled to move to adjust to the second pose. pose to acquire the second image.
- the camera device can be mounted on movable platforms such as drones and unmanned vehicles. Therefore, the position and attitude of the camera device can be automatically calculated to observe the complete target object, and then automatically control the drone, The unmanned vehicle moves to the corresponding position and collects the second image.
- the drone can capture the second pose of the target object, and then a prompt message indicating the second pose is sent to the user, so that the user can control the movement of the camera to adjust to the A second pose and a second image is acquired.
- the second pose can be automatically calculated first, and then a prompt message indicating the second pose is sent to the user through the interactive interface.
- the prompt message can be: Text information can also be image information.
- prompt information such as "move 100 meters from the current position to the east” and “move to the right from the current position 50 meters” can be displayed on the interactive interface, so that the user can control the camera according to the prompt information.
- the device is moved to the corresponding position before shooting.
- the user uses the movable platform to shoot, the user can control the control terminal corresponding to the movable platform according to the prompt information, and control the movable platform to move to the corresponding position through the control terminal.
- the second pose includes a second position and a second orientation
- the prompt information can also be image information.
- an image that identifies the second position in the second pose can be displayed to the user on the interactive interface, wherein, The second position where the target object can be observed can be an area, so this area can be framed in the image, as shown in FIG. 4 .
- the rotation angle information corresponding to the second orientation adjusted to the second pose can also be displayed to the user, so that the user can adjust the camera device to capture the second image according to the displayed position information and angle information.
- the position of the target object that can be photographed is related to the relative position of the object to be filtered and the target object, for example, when the distance between the object to be filtered and the target object is far, moving a small distance can collect the complete target object.
- the distance between the object to be filtered and the target object is relatively short, it may be necessary to move a long distance to collect an image including the complete target object. Therefore, in some embodiments, when determining the second pose, the location information of the object to be filtered and the location information of the target object may be determined first, and then the location information of the object to be filtered and the location information of the target object may be determined. second pose.
- the size of the object to be filtered also affects the position where the target object can be completely photographed. For example, if the size of the object to be filtered is large, the target object may have to be moved to a farther position to be completely photographed. Small in size, it may be possible to fully capture the target object by moving a small distance. Therefore, in some embodiments, when the second pose is determined according to the position information of the object to be filtered and the position information of the target object, the size of the object to be filtered may be determined, and then the size of the object to be filtered, the size of the object to be filtered and the size of the object to be filtered may be determined. The second pose is determined by dividing the position information of the object and the position information of the target object.
- the trash can 51 in the figure is the object to be filtered out
- the house 52 is the target object to be occluded
- the black dot in the figure represents the position of the camera device.
- the camera can Bypass the object 51 to be filtered (for example, go behind the object to be filtered, as shown in "Position 2") to capture the complete target object 52, of course, you can also move a distance along the current shooting position to reach "Position 3" so that the target object 52 can fall within the field of view of the camera.
- the first pose includes a first position and a first orientation
- the second pose includes a second position and a second orientation
- the second position passes through the first position and is parallel to a plane where the object to be filtered is located
- the second orientation points to the position of the object to be filtered, that is, you can translate a distance along the current first position of the camera device to reach the second position, and then adjust the orientation of the camera device to point to the object to be filtered. remove objects.
- the moving distance when determining the second position, may be determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered, and then the moving distance may be determined according to the first position and the size of the object to be filtered.
- the moving distance determines the second position. For example, as shown in FIG. 6, the small cuboid 61 in the figure is the object to be filtered, the width of the object to be filtered is L, the distance between the object to be filtered and the camera is d1, and the large cuboid 62 is blocked.
- the target object, the distance between the target object and the camera device is d2, and the object to be filtered and the target object are converted to a view from a top-down perspective.
- the object to be filtered is shown as 65 in the figure
- the area of the target object that is occluded by the object to be filtered is shown as 64 in the figure
- the "position A" in the figure is the first position
- the schematic diagram of the image plane 66 is the camera
- the image plane schematic diagram 67 is a schematic diagram of the image collected by the camera at "position B", where "position B" is the position where the camera device can just observe the left edge of the occluded area of the target object.
- position, "position B” can be reached by translation distance D from the first position, and it can be seen from Figure 6 that the moving distance D can be solved by formula (1):
- the distance d1 between the object to be filtered and the camera device and the distance d2 between the target object and the camera device may be determined by using multiple images collected by the camera device in different poses.
- the width L of the object to be filtered out can be determined according to the distance between the object to be filtered out and the camera device and the imaging size of the object to be filtered out.
- the second location can be any location in this area.
- the three-dimensional space coordinates of "position B" can be determined according to the current three-dimensional space coordinates of the first position and the moving distance D, the three-dimensional space coordinates corresponding to the second position can be further determined, and the camera is controlled to move to the second position. Location.
- an area including the object to be filtered out is determined, for example, as shown in FIG. 7 , an area 71 including the object to be filtered out 70 is determined, and then an annular area 72 surrounding the area 71 is determined.
- a plurality of feature points can be extracted from the area 71 first, and the feature point extraction can be performed by using an existing feature point extraction algorithm, which will not be repeated here.
- the matching points of the extracted feature points in the remaining multi-frame images can be determined, and then the optical flow vector of each feature point can be determined according to the matching points of these feature points in the remaining images, and the optical flow vector of the feature points can be fitted according to the optical flow vector of the feature points to be filtered.
- the center of the object that is, the area 71
- the center of the object is relative to the optical flow vector of each image, so that the matching points of the center of the object to be filtered (that is, the area 71) in the remaining multi-frame images can be determined, according to the center of the object to be filtered out.
- the BA (Bundle Adjustment) algorithm can be used to determine the internal and external parameters of the camera, and the depth distance from the center of the object to be filtered is determined according to the internal and external parameters of the camera, which is the distance between the object to be filtered and the camera.
- distance d1 For the distance d2 between the target object and the camera device, feature points can be extracted from the annular region 72, and then a similar method is used to determine the distance d2 between the target object and the camera device, which will not be repeated here.
- the second orientation when the second orientation is determined, the second orientation may be determined according to the first position and the position of the object to be filtered out in the image frame captured by the camera. For example, during the moving process of the camera device, it can detect the position of the object to be filtered out in the captured image in real time, and can continuously adjust the orientation of the camera device to keep the object to be filtered out in the center of the image screen, so that when the camera device When moving to the second position, the second orientation can also be determined.
- the center of the object to be filtered out in the first image on the image screen and the pose parameters corresponding to the first pose, it can be determined that when the camera moves to the second position, the center of the object to be filtered out should be located at the center of the screen at the second position.
- the second orientation corresponds to the attitude angle, thereby determining the second orientation.
- the second orientation when determining the second orientation, may also be determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object. For example, as shown in FIG. 8 , which side of the first position the second position is located on can be determined according to the three-dimensional coordinates of the first position and the second position, and when the second position is located on the right side of the first position, it can be determined according to the three-dimensional coordinates of the first position and the second position.
- the left endpoint A of the object to be filtered and the right endpoint D of the target object determine a connecting line AD
- the second orientation is to point to the object to be filtered along the connecting line AD.
- the attitude angle corresponding to the line connecting the two endpoints can also be solved.
- a connecting line BC can be determined according to the left endpoint B of the object to be filtered and the right endpoint C of the target object, and the second orientation is along the connecting line BC pointing to the object to be filtered. Filter out objects.
- the attitude angle corresponding to the connection line BC can be determined according to the three-dimensional coordinates of the left endpoint B of the object to be filtered and the right endpoint C of the target object.
- the second image may also be acquired by continuously adjusting the pose of the camera to acquire the image and then judging whether the acquired image can be used as the second image.
- the pose of the camera can also be continuously changed to obtain multiple frames of images collected by the camera at different poses. Each time the camera collects a frame of image, it can determine whether the image includes the corresponding image of the target object.
- the second pixel block of if included, the image is regarded as the second image.
- the determination of whether the image includes the second pixel block may be determined by the user, or may be determined automatically by the device executing the image processing method. Taking the camera device mounted on a mobile platform such as a drone as an example, the user can adjust the posture of the drone and collect images in different postures, and then the drone can send the collected images back to the control terminal, and the user can determine the image. When the target object is included in the , you can click on the image to use it as a second image. Of course, it is also possible to automatically determine whether the collected image can be used as the second image by performing certain processing and identification on the collected image.
- a plurality of first feature points may be extracted from the first pixel block, and A plurality of second feature points are extracted from the surrounding area of the first pixel block, and for each frame of image collected after the camera device changes the pose, the first matching point and the second feature of the first feature point in the image can be determined point the second matching point in the image, and then determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point in the image.
- the first feature point may be a feature point located within the first side of the first pixel block
- the second feature point may be a feature point located outside the second side of the first pixel block
- the first side is the opposite side of the second side. For example, the first side is the left side of the first pixel block, the second side is the right side of the first pixel block, and the first side is the first side.
- FIG. 9 is a schematic diagram of the first image 90 , the first pixel block 91 can be determined from the first image 90 , and the first pixel block 91 is on the first side of the first pixel block 91 .
- a plurality of first feature points 92 are extracted within (ie, the left side), and a plurality of second feature points 93 are extracted outside the second side (ie, the right side) of the first pixel block.
- FIG. (b) is a schematic diagram of the image 94
- the first feature point is at the first matching point 95 of the image 94 and the second feature point is at the second matching point 96 of the image 94
- the second matching point 96 is located on the first side (left side) of the first matching point 95, and it is considered that the target object is not at this time. is blocked by the object to be filtered out, so it can be determined that the image includes the second pixel block corresponding to the target object.
- the plurality of second feature points may be located in a ring-shaped pixel block surrounding the first pixel area, at positions according to the first matching point and the second matching point
- the preset number may be determined according to actual requirements, for example, 90% of the second matching points may be located on one side of the first matching point. As shown in FIG.
- (a) is a schematic diagram of the first image 100
- the first pixel block 101 can be determined from the first image 100
- a plurality of first feature points 102 can be extracted from the first pixel block 101 , extract a plurality of second feature points 104 in the annular pixel block 103 around the first pixel block 101, when the camera changes the pose to collect a frame of image
- (b) is a schematic diagram of the image 105
- the first feature point 102 is at the first matching point 106 of the image 105
- the second feature point 104 is at the second matching point 107 of the image 105
- the positional relationship between the first matching point 106 and the second matching point 107 can be determined , as shown in the figure, when more than a certain number of second matching points 107 (for example, more than 90% of the total number of second matching points) are located on one side of the first matching point 106 , it is considered that the target object has not been filtered at this time.
- a certain number of second matching points 107 for
- the target object occluded by the object to be filtered may not be completely captured.
- the A complete target object is captured by adjusting the pose of the camera device to complement the target object occluded by the object to be filtered out in the first image.
- prompt information may be sent to the user to prompt the user that the object to be filtered out in the first image cannot be filtered out in the current scene.
- a prompt message indicating that the object to be filtered cannot be filtered is sent to the user, wherein the prompt message can be displayed in the form of a pop-up window, for example, it can be displayed in the user
- the interactive interface displays pop-up information, prompting the user that the currently selected object to be filtered cannot be filtered out.
- the first preset condition may be at least one of the following: the first distance between the object to be filtered and the target object is less than a first preset threshold, or the second distance between the target object and the camera is less than the first distance Two preset thresholds, or the distance relationship between the first distance and the second distance does not satisfy the preset second condition.
- the first preset threshold, the second preset threshold and the second condition can be flexibly set according to the actual scene. For example, if the distance between the object to be filtered and the target object is less than 1 meter, the complete target object cannot be photographed.
- the first preset threshold is set to 1 meter.
- the second preset threshold and the second preset condition may be set by similar means, and details are not described herein again.
- the second pixel block before performing the replacement process on the first pixel block of the first image with the second pixel block in the second image, the second pixel block may be determined in the collected second image first.
- the distance between the pixel points of the first image and the pixel points of the second image may be determined first.
- the mapping area of the first pixel block in the second image is determined as the second pixel block, and then the second pixel block is used to replace the first pixel block in the first image.
- a third feature point may be extracted from the peripheral area of the first pixel block in the first image, and A third matching point of the third feature point is determined in the second image, and then the mapping relationship is determined according to the third feature point and the third matching point.
- the mapping relationship between the pixels of the first image and the pixels of the second image can be represented by a homography matrix. For example, assuming that the pixel coordinates of the pixels on the first image are P1, The pixel coordinate of the pixel point is P2, and the homography matrix is H, then the pixel point of the first image and the pixel point of the second image satisfy the formula (2):
- the homography matrix H Since the homography matrix H has 8 unknowns, it needs at least 4 pairs of feature points and matching points to solve. Therefore, at least 4 third feature points can be extracted from the surrounding area of the first pixel block in the first image (such as the area surrounding the first pixel block), and then it is determined that these at least 4 pixel points are in the second image. The third matching point of , solve H according to the third feature point and the third matching point.
- the RANSAC Random sample consensus
- the RANSAC Random sample consensus algorithm
- the mapping area of the first pixel block in the first image in the second image can be determined according to H, and then the mapping area is used as the second pixel block to replace the first pixel area in the first image block to complement the target object in the first image that is occluded by the object to be filtered out.
- a ring-shaped pixel block surrounding the first pixel block can also be determined in the first image, and then determined in the second image.
- a matching ring-shaped block matched with the ring-shaped pixel block, and then the pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
- the first image can be an image with a better shooting effect.
- the camera device may collect multiple images in the first pose, and then select the first image from the multiple images, wherein the first image may be selected by the user, or the image processing method may be executed by the user. The device is automatically selected according to the image clarity, brightness, picture composition and other information.
- the category information of the object to be filtered out may be determined first, and the category information is used for The object to be filtered is identified as a dynamic object or a static object, and a corresponding processing method is adopted to eliminate the object to be filtered according to the category information of the object to be filtered.
- determining whether the object to be filtered out is a dynamic object or a static object may be determined according to a plurality of images collected by the camera device in the first pose.
- each pixel of the object to be filtered out in the first image may be relative to the plurality of images
- the object to be filtered out is a static object
- the first pixel block corresponding to the object to be filtered out is determined in the first image, and the image captured by the camera in the second pose including the second pixel is obtained.
- the second image of the block, and the second pixel block is used to replace the first pixel block in the first image, so as to generate a step of replacing the processed first image.
- the third pixel block corresponding to the object to be filtered out in the first image may be determined, and then the third pixel block corresponding to the object to be filtered out in the first image may be determined, and then the third pixel block acquired by the camera in the first pose is determined.
- the fourth pixel block located at the pixel position corresponding to the pixel position of the third pixel block in other images other than one image it is determined from the other images that the fourth pixel block is the third image of the static area (that is, the third image The corresponding area of the three-pixel block is not blocked), and the fourth pixel block in the third image is used to replace the third pixel block in the first image.
- the third pixel block 110 corresponding to the object to be filtered can be determined in the first image, and then it is determined that the pixel position of the third pixel block 110 is located in another image (such as image 1 in the figure) , image 2, image 3) in the fourth pixel block (111 in the figure) corresponding to the pixel position, then it can be determined whether the fourth pixel block 111 is a static area, if so, then this image is used as the third image
- the fourth pixel block 111 in the image 1 is a static area
- the image 1 is regarded as the third image
- the fourth pixel block 111 in the image 1 is used to replace the third pixel block 110 in the first image.
- the dynamic area in the other images may be determined first, and then the first image is determined for the first image.
- the pixel block whose pixel position of the third pixel block is located in the corresponding pixel position in the other images can be determined according to the order of acquisition of the other images and the first image from near to far, until The pixel block corresponding to the pixel position does not overlap with the dynamic area (ie, is not blocked), and the other image is regarded as the third image.
- the first image is the Kth frame image collected by the camera
- the other images are the K+1th frame, the K+2th frame, and the K+th frame collected by the camera respectively.
- 3 frames, etc. you can first determine the dynamic area in the K+1th frame, the K+2th frame, and the K+3th frame.
- the optical flow vector of multiple frames of images If the modulo length of the optical flow vector of a pixel point is greater than a certain threshold, the pixel point is considered to be moving, and then the pixels determined to be moving are clustered to obtain multiple pixel point sets.
- the area where the number of pixels in the set is greater than a certain value is considered as a motion area.
- the rectangular area and the circular area in the image are dynamic areas, and the remaining areas are static areas, determine the third pixel block 121 corresponding to the object to be filtered in the first image, and the pixel position 121 where the third pixel block is located is in the K+th
- the pixel block of the corresponding pixel position in the 1st frame, the K+2th frame, and the K+3th frame is the area 122 framed by the dotted line.
- the pixel block 122 corresponding to the pixel position of the third pixel block 121 in a frame of image overlaps with the dynamic region in the K+1th frame, and if so, then determine the Kth Whether the pixel block 122 corresponding to the pixel position of the third pixel block 121 in the +2 frames overlaps with the dynamic area, when it is determined that the K+2th frame meets the requirements, the K+2th frame is used as the third image, The third pixel block of the first image is replaced with the pixel block corresponding to the pixel position in this frame.
- the camera device When the camera device collects images in the first attitude, it usually collects multiple frames of images continuously to form an image sequence. The position of the image does not change much, so it is not suitable to use adjacent frames to filter out the dynamic objects of the first image. If these image frames are judged one by one, it is more resource-intensive. Therefore, when acquiring multiple images collected by the camera, some images that can reflect the changes of dynamic objects can be selected from the image sequence collected by the camera, so that these images can be used more efficiently to filter out dynamic objects. Therefore, in some embodiments, other images in the plurality of images except the first image may be images whose differences from the first image exceed a preset threshold, or images that are separated from the first image by a specified frame. For example, the first image can be used as a reference.
- the image is acquired as one of the above-mentioned multiple images. For example, if the first image is the 5th frame of the image sequence, the other images are the 10th, 15th, 20th, and 25th frames in sequence. Wait.
- the dynamic objects in the image when the static objects in the image are filtered out by collecting images of different poses, the dynamic objects in the image will interfere with the filtering out of the static objects to a certain extent, resulting in an inability to filter out the static objects well.
- Static objects therefore, in some embodiments, before using the above method to filter out static objects, dynamic objects in the image may be filtered out first.
- the present application also provides an image processing method, which can be used to automatically remove dynamic objects in an image.
- the method is shown in FIG. 12 and includes the following steps:
- the image processing method in this embodiment of the present application may be performed by a camera device that collects the first image and the second image
- the camera device may be any device with an image acquisition function.
- the camera device may be a camera, or a camera equipped with a camera.
- Terminals such as cameras, mobile phones, tablets, laptops, smart wearable devices, etc., can also be mobile platforms such as drones and unmanned vehicles with cameras.
- the image processing method of the present application can also be executed by other devices that are communicatively connected to the camera, for example, a cloud server, and the camera collects the first image and the second image and sends them to the cloud Server processing, of course, if the camera device is a movable platform, the image processing method of the present application can also be executed by a control terminal communicatively connected to the movable platform, which is not limited in the present application.
- the dynamic objects to be filtered out in the embodiments of the present application are objects that the user wishes to remove from the image.
- the dynamic objects to be filtered out may be determined by the user or selected by the user, and there may be one or more dynamic objects to be filtered out.
- the first image can be selected from the image sequence continuously collected by the camera in a certain fixed pose, wherein the first image can be selected by the user, or can be automatically selected by the device executing the image processing method, such as automatically selecting from the image sequence. Select an image with better clarity, composition or shooting angle as the first image.
- the first image After determining the first image, it is possible to determine the first pixel block corresponding to the dynamic object to be filtered out in the first image, then determine multiple frames of second images from the image sequence, and determine the first pixel block from the second image
- the pixel block corresponding to the pixel position at the pixel position is the third image of the static area (that is, the image in which the pixel block corresponding to the pixel position is not occluded), and then the corresponding pixel position of the first pixel block in the third image is used.
- the pixel block replaces the first pixel block in the first image to remove dynamic objects.
- the adjacent frames of the first image may not be used to filter out the dynamic object to be filtered out.
- some images that are quite different from the first image can be selected from the image sequence as
- the second image for example, the second image may be an image whose difference from the first image exceeds a preset threshold, or an image that is spaced apart from the first image by a specified frame.
- the first image can be used as a reference.
- the image is acquired as the second image, It is also possible to acquire images with a specified frame interval from the first image. For example, if the first image is the 5th frame of the image sequence, the second image is the 10th frame, the 15th frame, the 20th frame, and the 25th frame in sequence.
- the following operations may be performed for each frame of the second image: calculating the light intensity of each pixel of the first image relative to the second image
- the flow vector is determined from each pixel point of the first image, and the target pixel point whose modulo length of the optical flow vector is greater than the preset threshold is subjected to clustering processing to obtain the first pixel block corresponding to the dynamic object.
- the optical flow vector of each pixel of the first image and its adjacent one or more frames of images can be calculated.
- the modulo length of the optical flow vector of the pixel is greater than a certain threshold, it is considered that the pixel is moving, and then it is determined as The moving pixels are clustered to obtain multiple sets of pixels, and the area where the number of pixels in the set is greater than a certain value (the number may be too small and the noise can be ignored) is considered to be a dynamic object.
- the dynamic regions in the plurality of second images can be determined, and for each For the first pixel block, the corresponding third image can be determined in the following manner, and the pixel position of the dynamic object of the first image can be determined in the second image in the order of the second image and the first image acquisition sequence from near to far. until the pixel block corresponding to the pixel position does not overlap the dynamic area, the second image is regarded as the third image.
- a reference image (ie, the first image) can be determined from multiple frames of images collected by the camera in the same pose, and then the first image corresponding to the dynamic object to be filtered can be determined from the reference image.
- Pixel block by determining whether the pixel block corresponding to the pixel position of the first pixel block in other images is a static area, the pixel area corresponding to the pixel position of the first pixel block can be quickly screened out. block the unoccluded image, and then replace the first pixel block in the first image with the pixel block corresponding to the pixel position of the image, which can quickly and efficiently remove the dynamic object in the first image.
- the user can use the control terminal 132 to control the camera device 133 mounted on the drone 131 to collect images, and the drone 131 can capture images.
- the images collected by the camera 133 are sent back to the control terminal so as to be displayed to the user. Filtering out the objects in the image can be performed by the control terminal.
- the following describes the filtering methods of dynamic objects and static objects respectively. Since dynamic objects will cause certain interference to the filtering of static objects, the dynamic objects can be filtered out first, and then the dynamic objects can be filtered out. Filter out static objects.
- the camera can be controlled to collect a series of image sequences at a certain fixed pose, and then the user selects a reference image I0 from the image sequence, or the control terminal automatically selects the reference image I0 from the image sequence.
- the key frame is an image frame with a large difference from the reference image I0, for example, the angle or displacement of an object may be different from the angle or displacement of the object in the reference image I0
- the reference image I0 is the Kth frame
- the key frame can be an image frame with an interval of 5, 10, 15, and 20 from the Kth frame.
- the remaining key frames also calculate the optical flow vector with the two frames (or multiple frames) before and after itself, respectively, and determine the dynamic area and the static area of each key frame.
- each dynamic object of the k0th frame is a static area in the corresponding area of the frame.
- the triangle, square and circular areas in the figure represent dynamic areas, and the rest of the areas are static areas.
- the corresponding area of such as the circular dotted area in the figure, is a static area, so the k-1th frame can be used to fill the circular dynamic area of the k0th frame.
- the remaining triangular dynamic areas and square dynamic areas need to be filled by the k-5th frame and the k7th frame respectively.
- each dynamic object can be used to replace the dynamic object of the k0 frame in the corresponding area of the key frame, so as to achieve the purpose of filtering out the dynamic object.
- the static object to be filtered out can be determined in the reference image I0, which can be automatically recognized by the control terminal, or can be determined by the user by frame selection on the interactive interface. As shown in Figure 15, the user can select the static object to be filtered out in the reference image I0 (as shown in Figure (1)). Since the frame selected by the user is not very accurate, the selection frame can be adjusted automatically, such as The benchmark image I0 is subjected to superpixel segmentation to obtain multiple image areas, and then the ratio of the part of each area that falls into the selected frame to the image area is determined. outside the box. The frame adjusted by the above method is shown in Figure (2).
- feature points can be extracted, and feature point tracking and matching between multiple frames of images, as well as feature point tracking and matching of the previous and subsequent frames, can be used to determine the static object. and the depth distance of the background area. details as follows:
- feature point extraction is performed on the corresponding area of the static object on the reference image.
- the feature point extraction can use a general algorithm, such as Harris algorithm, SIFT algorithm, SURF algorithm, ORB algorithm, etc.
- the sparse method can be used to first extract the feature points of the image.
- the corner points can be selected as the feature points.
- the optional corner detection algorithms Corner Detection Algorithm are: FAST (features from accelerated segment test ), SUSAN, and Harris operator, etc. The following is an example of using the Harris Corner Detection Algorithms algorithm:
- matrix A as a construction tensor, such as formula (3)
- Ix and Iy are the gradient information of a certain point on the image in the x and y directions, respectively, and the function Mc can be defined as the following formula (4):
- det(A) is the determinant of matrix A
- trace(A) is the trace of matrix A
- ⁇ is the parameter to adjust the sensitivity
- the set threshold is Mth.
- the displacement h of the feature point before and after the image frame can be obtained through the iteration of formula (5),
- the feature points can be updated continuously.
- the center of static objects does not necessarily have feature points. Therefore, for the center of the static object, it is necessary to use the fitted optical flow vector to determine the position of the center of the static object in each image, so that the BA algorithm can be used to obtain the three-dimensional coordinates of the center of the static object.
- the center point of the static object can be estimated from the optical flow vectors of other feature points within the corresponding region of the static object framed in the image. Specifically as formula (6):
- x i is the optical flow vector of the feature points in the frame
- w i is the weight, which can be determined according to the 2D image position of the feature point and the center point, as shown in formula (7):
- ⁇ is adjusted according to experience and is an adjustable parameter
- d i represents the distance from the feature point i to the midline point (u i , v i ) represents the 2D image pixel coordinates of the feature point i
- (u 0 , v 0 ) represents the 2D image pixel coordinates of the center point of the target frame.
- the disparity and optical flow of the center of the static object can be calculated, and the three-dimensional depth information of the center of the static object can be obtained.
- the 3D depth information of the background region can be calculated.
- d1 and d2 are the depth distance of the static object obtained in one step and the depth distance of the background area.
- the maximum width L of the static object can be determined according to the size of the static object in the image and the depth distance of the static object.
- Figure 6 shows that the drone is flying to the right, so the limit position where all the occluded background areas can be seen is that the left edge of the occluded background area is just observed. Of course, the drone can also fly to the left, and the corresponding limit viewing angle is to just see the right edge of the occluded background area.
- the camera orientation can be adjusted at the same time, and the right edge of the pixel area corresponding to the object to be filtered can be centered. Through the above method, the adjustment of the camera pose can be completed, and the purpose of adjusting the viewing angle is achieved.
- the pose where the occluded background area can be observed is determined, and the drone can be automatically controlled to adjust to the pose, and the image In can be obtained by shooting at this pose.
- Feature points can be extracted from the pixel region corresponding to the background region in the reference image I0, and feature point matching can be performed in the image In to obtain a matching point queue.
- the H matrix represents the mapping relationship between two matched pixels on two images collected by the camera at different poses, as shown in formula (8):
- x 0 is a feature point on the background region of image I0
- x n is the point in image In that matches x 0 .
- H matrix to represent the mapping relationship between two points actually requires these pixels to be on the same plane in space.
- the background area can be treated as a plane. Therefore, when d1 is relatively small (for example, less than 100m), the user should also be reminded that the filtering effect is poor or cannot be filtered.
- the tolerance parameter that is, the maximum degree of unevenness used in fitting the plane can be selected according to the depth of the background. (such as removing 2% of the background depth), if the plane cannot be fitted, the user will be prompted that the filtering effect is poor or cannot be filtered.
- the H matrix has 8 unknowns and requires at least 4 pairs of points to calculate.
- the RANSAC (Random sample consensus) algorithm can be used to effectively filter out feature points and matching points with poor matching degree, further improve the effectiveness of the results, and obtain a more accurate H matrix.
- the image In can be all projected onto the camera pose (camera pose) of the camera corresponding to the image I0 according to the H matrix to obtain the image In', and then the The pixel area corresponding to the object to be filtered out in the image In' is replaced by the area corresponding to the coverage image I0, and the static object can be removed.
- the present application also provides an image processing apparatus.
- the image processing apparatus includes a processor 171 , a memory 172 , and a computer program stored in the memory 172 and executable by the processor 171 .
- the processor executes the computer program, the following steps are implemented:
- the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
- the first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
- the processor when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
- the camera is controlled to move to adjust to the second pose and capture the second image.
- the processor when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
- the processor when the processor is configured to determine the second pose, it is specifically configured to:
- the second pose is determined according to the position information of the object to be filtered and the position information of the target object.
- the processor is configured to determine the second pose according to the position information of the object to be filtered and the position information of the target object, and is specifically configured to:
- the second pose is determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered.
- the first pose includes a first position and a first orientation
- the second pose includes a second position and a second orientation
- the second position is located on a straight line passing through the first position and parallel to the plane where the object to be filtered is located, and the second orientation points to the position where the object to be filtered is located.
- the second location is determined by:
- the second position is determined according to the first position and the moving distance.
- the second orientation is determined by:
- the second orientation is determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object.
- the second posture includes a second position and a second orientation
- the processor is configured to send prompt information indicating the second posture to the user, when, specifically:
- the image marked with the second position is displayed to the user, and the rotation angle information corresponding to the second orientation is displayed.
- the processor when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
- An image including the second pixel block is used as the second image.
- the processor when the processor is configured to determine whether the image includes the second pixel block, it is specifically configured to:
- Whether the image includes the second pixel block is determined according to the positional relationship between the first matching point and the second matching point in the image.
- the first feature point is located within a first side of the first pixel block, and the second feature point is located outside a second side of the first pixel block, wherein the the first side is the opposite side of the second side;
- the processor When the processor is used to determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point, it is specifically used for:
- a plurality of the second feature points are located in a ring-shaped pixel block surrounding the first pixel area, and the processor is configured to determine the first matching point and the second matching point according to the first matching point and the second matching point.
- the processor is specifically used for:
- the camera device is mounted on a movable platform, and the processor is used to control the movement of the camera device, specifically:
- Movement of the movable platform is controlled to control movement of the camera.
- the camera device is mounted on a movable platform through a pan/tilt
- the processor is used to control the movement of the camera device, specifically:
- the movable platform is controlled to move, and/or the pan/tilt is controlled to generate relative motion between the camera and the movable platform, so as to control the camera to move.
- the camera device is mounted on the movable platform through a pan/tilt head
- the second pose includes a second position and a second orientation
- the processor is configured to control the camera device to move so as to make the camera device move.
- the camera device is adjusted to the second pose, it is specifically used for:
- the movable platform is controlled to move so that the camera is located at the second position; and the pan-tilt is controlled to rotate so that the orientation of the camera is adjusted to the second orientation.
- the movable platform includes any one of an unmanned aerial vehicle, an unmanned vehicle, and an unmanned boat.
- the processor when the processor is configured to determine the first pixel block corresponding to the object to be filtered out in the first image, it is specifically configured to:
- the first pixel block corresponding to the object to be filtered out is determined from the first image.
- the instruction includes a check box input by the user through a human-computer interaction interface, and the check box is used to frame the static target object.
- the first pixel block is a pixel block selected by the marquee, and the device is further configured to:
- the processor when the processor adjusts the pixel blocks selected by the frame based on the plurality of image regions, the processor is specifically configured to:
- the pixel block selected by the frame is adjusted according to the ratio of the portion of each image area that falls within the frame and each image area in the plurality of image areas.
- the apparatus is also used to:
- the preset first condition includes one or more of the following:
- the first distance between the object to be filtered and the target object is less than a first preset threshold
- the distance magnitude relationship between the first distance and the second distance does not satisfy a preset second condition.
- the apparatus is also used to:
- the second pixel block is determined in the second image.
- the processor when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:
- the mapping area of the first pixel block in the second image is determined according to the mapping relationship as the second pixel block.
- the processor when the processor is configured to determine the mapping relationship between the pixels of the first image and the pixels of the second image, it is specifically configured to:
- the mapping relationship is determined based on the third feature point and the third matching point.
- the processor when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:
- a pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
- the processor when the processor is configured to acquire the first image captured by the camera in the first pose, the processor is specifically configured to:
- the first image is determined among the plurality of images.
- the processor before the processor is configured to determine the first pixel block corresponding to the object to be filtered out in the first image, the processor is further configured to:
- the determining of the first pixel block corresponding to the object to be filtered out in the first image is performed, and the acquisition of the image data collected by the camera in the second pose including the second pixel block is performed.
- the second image of the pixel block, and the step of replacing the first pixel block in the first image with the second pixel block to generate the replaced first image is performed.
- the apparatus is also used to:
- the object to be filtered is a dynamic object, perform the following steps:
- the third pixel block in the first image is replaced with the fourth pixel block in the third image.
- the processor when the processor is configured to determine the category of the object to be filtered out from the plurality of images, the processor is specifically configured to:
- the category information of the object to be filtered out is determined according to the optical flow of each pixel of the object to be filtered out relative to other images in the plurality of images except the first image.
- the processor when the processor is configured to determine from the other images that the fourth pixel block is the third image of the static area, the processor is specifically configured to:
- the pixel block of the corresponding pixel position in the other image where the pixel position of the third pixel block is located determines the pixel block of the corresponding pixel position in the other image where the pixel position of the third pixel block is located, until the corresponding pixel position If the pixel block of the pixel position does not overlap with the dynamic area, the other image is used as the third image.
- the other difference from the first image exceeds a preset threshold
- the other images are images spaced apart from the first image by a specified frame.
- the present application also provides another image processing apparatus, the image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
- the first pixel block in the first image is replaced with a pixel block at the corresponding pixel position in the third image.
- the processor when used to determine the first pixel block corresponding to the dynamic object in the first image, it is specifically used to:
- the target pixel points are clustered to obtain the first pixel block corresponding to the dynamic object.
- the processor is configured to determine from the plurality of second images that the pixel block corresponding to the pixel position is the third image of the static area; specifically:
- the second image and the first image acquisition sequence from near to far determine the pixel block where the pixel position of the first pixel block is located in the corresponding pixel position in the second image, until If the pixel block corresponding to the pixel position does not overlap with the dynamic area, the second image is used as the third image.
- the difference between the second image and the first image exceeds a preset threshold
- the second image is an image spaced apart from the first image by a specified frame.
- the present application also provides a movable platform, and the movable platform can be any device such as an unmanned aerial vehicle, an unmanned vehicle, an unmanned ship, an intelligent robot, and a handheld PTZ.
- the movable platform includes a camera device and an image processing device.
- the image processing device can implement any of the image processing methods in the embodiments of the present application. For specific implementation details, refer to the descriptions of the embodiments in the above image processing methods. No longer.
- an embodiment of the present specification further provides a computer storage medium, where a program is stored in the storage medium, and when the program is executed by a processor, the image processing method in any of the foregoing embodiments is implemented.
- Embodiments of the present specification may take the form of a computer program product embodied on one or more storage media having program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
- Computer-usable storage media includes permanent and non-permanent, removable and non-removable media, and storage of information can be accomplished by any method or technology.
- Information may be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
- PRAM phase-change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- ROM read only memory
- EEPROM Electrically Erasable Programmable Read Only Memory
- Flash Memory or other memory technology
- CD-ROM Compact Disc Read Only Memory
- CD-ROM Compact Disc Read Only Memory
- DVD Digital Versatile Disc
- Magnetic tape cassettes magnetic tape magnetic disk storage or other magnetic storage devices or any other non-
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
An image processing method and apparatus, and a movable platform. The method comprises: acquiring a first image collected by a photographic apparatus in a first pose, and determining, in the first image, a first pixel block corresponding to an object to be filtered out; acquiring a second image collected by the photographic apparatus in a second pose, wherein the second image comprises a second pixel block corresponding to a target object, and the target object is an object, which is obscured by the object to be filtered out, in the first image; and performing replacement processing on the first pixel block in the first image by means of the second pixel block, so as to generate a first image which has been subjected to replacement processing.
Description
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、装置及可移动平台。The present application relates to the technical field of image processing, and in particular, to an image processing method, device and movable platform.
用户在拍摄图像或者视频的过程中,通常会面临拍摄视角范围内出现非目标拍摄对象的场景,这些非目标拍摄对象也被拍摄到最终的图像或视频中,影响最终的拍摄效果。举个例子,假设用户在拍摄某个建筑,可能建筑旁边会出现一些路人、车辆、垃圾桶或者电线杆一类的非目标拍摄对象,这些非目标拍摄对象会遮挡被拍摄的建筑,或者出现在拍摄的图像中,影响图像的显示效果。为了提升图像或者视频的拍摄效果,以更加符合用户拍摄需求,有必要提出一种去除图像中的非目标拍摄对象的方案。In the process of shooting images or videos, users are usually faced with a scene where non-target subjects appear within the shooting angle of view, and these non-target subjects are also captured in the final image or video, which affects the final shooting effect. For example, assuming that the user is photographing a building, there may be some non-target subjects such as passers-by, vehicles, trash cans or telephone poles next to the building. These non-target subjects will block the photographed building, or appear in the In the captured image, it affects the display effect of the image. In order to improve the shooting effect of images or videos to better meet the shooting needs of users, it is necessary to propose a solution for removing non-target shooting objects in images.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请提供一种图像处理方法、装置及可移动平台。In view of this, the present application provides an image processing method, device and movable platform.
根据本申请的第一方面,提供一种图像处理方法,所述方法包括:According to a first aspect of the present application, an image processing method is provided, the method comprising:
获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;
获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤除对象遮挡的对象;Obtain a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。The first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
根据本申请的第二方面,提供一种图像处理方法,其特征在于,所述 方法包括:According to a second aspect of the present application, an image processing method is provided, wherein the method comprises:
确定第一图像中的动态对象对应的第一像素区块;Determine the first pixel block corresponding to the dynamic object in the first image;
确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;Determine the pixel block of the pixel position of the first pixel block corresponding to the pixel position in a plurality of second images, and the plurality of second images and the first image are collected in the same pose by a camera;
从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;From the plurality of second images, it is determined that the pixel block of the corresponding pixel position is the third image of the static area;
利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。The first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
根据本申请的第三方面,提供一种图像处理装置,所述图像处理装置包括处理器、存储器、存储于所述存储器所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:According to a third aspect of the present application, an image processing apparatus is provided, the image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;
获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤除对象遮挡的对象;Obtain a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。The first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
根据本申请的第四方面,提供一种图像处理装置,所述图像处理装置包括处理器、存储器、存储于所述存储器所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:According to a fourth aspect of the present application, an image processing apparatus is provided, the image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
确定第一图像中的动态对象对应的第一像素区块;Determine the first pixel block corresponding to the dynamic object in the first image;
确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;Determine the pixel block of the pixel position of the first pixel block corresponding to the pixel position in a plurality of second images, and the plurality of second images and the first image are collected in the same pose by a camera;
从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域 的第三图像;From the plurality of second images, determine that the pixel block of the corresponding pixel position is the third image of the static area;
利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。The first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
根据本申请的第五方面,提供一种可移动平台,所述可移动平台包括摄像装置以及本申请实施例中任一项图像处理装置。According to a fifth aspect of the present application, a movable platform is provided, where the movable platform includes a camera device and any one of the image processing devices in the embodiments of the present application.
应用本申请提供的方案,通过获取摄像装置在不同位姿采集的图像,利用包括被待滤除对象遮挡的目标对象的第二图像补全第一图像中被遮挡的目标对象,以消除第一图像中的待滤除对象,不仅适用于滤除动态对象,同时,也适用于滤除静态对象,通过该方法可以实现根据用户需求自动滤除图像的非拍摄目标对象的目的,可以提升图像的显示效果和用户体验。By applying the solution provided by the present application, by acquiring images collected by the camera device in different poses, the second image including the target object occluded by the object to be filtered is used to complete the occluded target object in the first image, so as to eliminate the first image. The objects to be filtered out in the image are not only suitable for filtering out dynamic objects, but also for filtering out static objects. Through this method, the purpose of automatically filtering out the non-shooting target objects in the image can be realized according to the user's needs, which can improve the quality of the image. Display effect and user experience.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.
图1是本申请一个实施例的一种滤除图像中的非拍摄目标对象的示意图。FIG. 1 is a schematic diagram of filtering out non-shooting target objects in an image according to an embodiment of the present application.
图2是本申请一个实施例的图像处理方法流程图。FIG. 2 is a flowchart of an image processing method according to an embodiment of the present application.
图3是本申请一个实施例的确定待滤除对象对应的第一像素区块的示意图。FIG. 3 is a schematic diagram of determining a first pixel block corresponding to an object to be filtered out according to an embodiment of the present application.
图4是本申请一个实施例的提示用户调整至第二位姿的提示界面的示意图。FIG. 4 is a schematic diagram of a prompting interface for prompting a user to adjust to a second pose according to an embodiment of the present application.
图5是本申请一个实施例的一种调整摄像装置至第二位姿的示意图。FIG. 5 is a schematic diagram of adjusting a camera device to a second pose according to an embodiment of the present application.
图6是本申请一个实施例的一种确定第二位姿示意图。FIG. 6 is a schematic diagram of determining a second pose according to an embodiment of the present application.
图7是本申请一个实施例的一种确定待滤除对象和目标对象的对应像 素区域的示意图。Fig. 7 is a schematic diagram of determining corresponding pixel regions of an object to be filtered and a target object according to an embodiment of the present application.
图8是本申请一个实施例的一种确定第二朝向的示意图。FIG. 8 is a schematic diagram of determining a second orientation according to an embodiment of the present application.
图9是本申请一个实施例的一种确定摄像装置采集的图像是否可以作为第二图像的示意图。FIG. 9 is a schematic diagram of determining whether an image captured by a camera device can be used as a second image according to an embodiment of the present application.
图10是本申请一个实施例的一种确定摄像装置采集的图像是否可以作为第二图像的示意图。FIG. 10 is a schematic diagram of determining whether an image captured by a camera device can be used as a second image according to an embodiment of the present application.
图11(a)是本申请一个实施例的一种滤除动态对象的示意图。FIG. 11( a ) is a schematic diagram of filtering out dynamic objects according to an embodiment of the present application.
图11(b)是本申请一个实施例的一种确定第三图像的示意图。FIG. 11( b ) is a schematic diagram of determining a third image according to an embodiment of the present application.
图12是本申请一个实施例的一种图像处理方法的流程图。FIG. 12 is a flowchart of an image processing method according to an embodiment of the present application.
图13是本申请一个实施例的一种应用场景示意图。FIG. 13 is a schematic diagram of an application scenario of an embodiment of the present application.
图14是本申请一个实施例的一种滤除动态对象的示意图。FIG. 14 is a schematic diagram of filtering out dynamic objects according to an embodiment of the present application.
图15是本申请一个实施例的一种框选待滤除对象以及被遮挡的背景区域的示意图。FIG. 15 is a schematic diagram of a frame selection of an object to be filtered out and an occluded background area according to an embodiment of the present application.
图16是本申请一个实施例的滤除静态对象的示意图FIG. 16 is a schematic diagram of filtering out static objects according to an embodiment of the present application
图17是本申请一个实施例的一种图像处理装置的逻辑结构示意图。FIG. 17 is a schematic diagram of a logical structure of an image processing apparatus according to an embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
用户在拍摄视频或图像的过程中,拍摄视角范围内可能存在一些非拍摄目标对象,这些非拍摄目标对象也被拍摄到图像中,影响图像的显示效果。这些非拍摄目标对象可能是动态的,比如行走的路人、车辆等,也可能是静态的,比如垃圾桶、电线杆、建筑等。如图1中(a)所示,用户想拍摄房子11及其周围的风景,但是房子前面的垃圾桶12和路人也被拍摄 到图像13中,严重影响图像的视觉效果。因此,有必要去除图像中的这些非拍摄目标对象,如图1中(b)所示,使图像具有更好的拍摄效果,提升用户体验。During the process of shooting a video or an image, there may be some non-shooting target objects within the shooting angle of view, and these non-shooting target objects are also captured in the image, which affects the display effect of the image. These non-target objects may be dynamic, such as walking passers-by, vehicles, etc., or static, such as trash cans, telephone poles, buildings, etc. As shown in Fig. 1(a), the user wants to photograph the house 11 and its surrounding scenery, but the trash can 12 and passers-by in front of the house are also photographed in the image 13, which seriously affects the visual effect of the image. Therefore, it is necessary to remove these non-shooting target objects in the image, as shown in (b) in FIG. 1 , so that the image has a better shooting effect and improves the user experience.
为了去除图像中的非拍摄目标对象(以下称为待滤除对象),本申请实施例提供了一种图像处理方法,在第一位姿采集第一图像,然后在可以观测到第一图像中被待滤除对象遮挡的目标对象的第二位姿采集第二图像,以利用第二图像补全第一图像中被待滤除对象遮挡的目标对象,从而达到去除待滤除对象的目的。In order to remove the non-shooting target object (hereinafter referred to as the object to be filtered) in the image, the embodiment of the present application provides an image processing method. The second image is collected from the second pose of the target object occluded by the object to be filtered, so as to use the second image to complement the target object occluded by the object to be filtered in the first image, so as to achieve the purpose of removing the object to be filtered.
具体的,所述方法的流程图如图2所示,包括以下步骤:Specifically, the flow chart of the method is shown in Figure 2, which includes the following steps:
S202、获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;S202, acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;
S204、获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤除对象遮挡的对象;S204: Acquire a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the target object in the first image that is to be filtered Except for objects occluded by objects;
S206、通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。S206 , performing replacement processing on the first pixel block in the first image by using the second pixel block to generate a replaced first image.
本申请实施例的图像处理方法可以由采集第一图像和第二图像的摄像装置执行,该摄像装置可以是任一具有图像或视频采集功能的设备,比如该摄像装置可以是摄像头,或者是设有摄像头的相机、手机、平板、笔记本电脑、智能穿戴设备等终端,也可以是设有摄像头的无人机、无人车、手持云台等可移动平台。当然,在某些实施例中,本申请实施例的图像处理方法也可以由与摄像装置通信连接的其他设备执行,比如,可以是云端服务器,摄像装置采集到第一图像和第二图像后发送给云端服务器处理,当然,如果摄像装置为可移动平台,本申请实施例的图像处理方法也可以由与该可移动平台通信连接的控制终端执行,本申请不做限制。The image processing method in this embodiment of the present application may be performed by a camera device that captures the first image and the second image, and the camera device may be any device with an image or video capture function. For example, the camera device may be a camera, or a device Terminals such as cameras, mobile phones, tablets, laptops, and smart wearable devices with cameras can also be mobile platforms such as drones, unmanned vehicles, and handheld PTZs with cameras. Of course, in some embodiments, the image processing methods of the embodiments of the present application may also be performed by other devices that are communicatively connected to the camera, for example, a cloud server, and the camera will send the first image and the second image after collecting the first image and the second image. For processing by the cloud server, of course, if the camera device is a movable platform, the image processing method in this embodiment of the present application may also be executed by a control terminal communicatively connected to the mobile platform, which is not limited in this application.
本申请实施例中的待滤除对象是指用户期望从第一图像中去除的对象,该待滤除对象可以是动态对象,也可以是静态对象,待滤除对象可以 是一个或者多个。The object to be filtered out in this embodiment of the present application refers to an object that the user wishes to remove from the first image. The object to be filtered out may be a dynamic object or a static object, and there may be one or more objects to be filtered out.
本申请实施例中的目标对象是指第一图像中被待滤除对象遮挡的对象,目标对像可以是一个或者多个。The target object in this embodiment of the present application refers to an object in the first image that is occluded by the object to be filtered out, and there may be one or more target objects.
获取摄像装置采集的第一图像后,可以在第一图像中确定待滤除对象对应的第一像素区块,然后获取包含被待滤除对象遮挡的目标对象的第二图像,利用第二图像中目标对象对应的第二像素区块对第一图像中的第一像素区块做替换处理,从而可以消除第一图像中的待滤除对象。After acquiring the first image captured by the camera, the first pixel block corresponding to the object to be filtered out can be determined in the first image, and then a second image containing the target object occluded by the object to be filtered out is acquired, and the second image is used The second pixel block corresponding to the target object in the first image performs replacement processing on the first pixel block in the first image, so that the object to be filtered out in the first image can be eliminated.
本申请通过获取摄像装置在不同位姿采集的图像,利用包括被待滤除对象遮挡的目标对象的图像补全另一张图像中的目标对象,以消除另一张图像中的待滤除对象,不仅适用于滤除动态对象,同时,也可以滤除静态对象,通过该方法可以实现根据用户需求自动滤除图像的非拍摄目标对象,可以提升图像的显示效果和用户体验。In the present application, the target object in another image is complemented by the image including the target object occluded by the object to be filtered, so as to eliminate the object to be filtered out in the other image by acquiring the images collected by the camera in different poses. , which is not only suitable for filtering out dynamic objects, but also can filter out static objects. This method can automatically filter out the non-shooting target objects of the image according to user needs, which can improve the display effect and user experience of the image.
确定第一图像中的待滤除对象可以由用户自行选择,也可以由设备自动识别。在某些实施例中,设备可以自动从第一图像中识别待滤除对象,比如,可以预先设置待滤除对像的一些识别规则,然后根据这些规则识别待滤除对象,比如,可以自动从第一图像中识别垃圾桶、电线杆、行走的车辆等一类对象作为待滤除对象,也可以将位于图像边缘位置的对象识别为待滤除对象。当然,在自动识别出待滤除对象后,也可以先向用户展示所识别待滤除对象,比如在用户界面显示框选待滤除对象的图像,待用户确认后再执行后续步骤。It is determined that the object to be filtered out in the first image can be selected by the user, or can be automatically recognized by the device. In some embodiments, the device can automatically identify the object to be filtered from the first image. For example, some identification rules for the object to be filtered can be preset, and then the object to be filtered can be identified according to these rules. For example, the object to be filtered can be automatically identified. Objects such as trash cans, utility poles, and walking vehicles are identified from the first image as objects to be filtered out, and objects located at the edge of the image can also be identified as objects to be filtered out. Of course, after the object to be filtered out is automatically identified, the identified object to be filtered out can also be displayed to the user, for example, an image of the object to be filtered out is displayed in a frame on the user interface, and subsequent steps are performed after the user confirms.
在某些实施例中,可以根据用户的指令在第一图像中确定待滤除对象,比如,用户可以在图像点击或者框选期望滤除的对象。其中,第一像素区块,可以是只包括待滤除对象的像素区块,也可以是包括待滤除对象及其周边部分背景的像素区块。比如,如图3所示,第一像素区块可以是只包括待滤除人物的人形轮廓区域31,也可以是包括待滤除人物及其周边背景区域的矩形区域32。In some embodiments, the object to be filtered out may be determined in the first image according to the user's instruction, for example, the user may click or frame the object to be filtered out in the image. The first pixel block may be a pixel block that only includes the object to be filtered out, or a pixel block that includes the object to be filtered out and its surrounding part of the background. For example, as shown in FIG. 3 , the first pixel block may be a human-shaped outline area 31 including only the person to be filtered out, or may be a rectangular area 32 including the person to be filtered out and its surrounding background area.
在某些实施例中,确定待滤除对象的用户指令可以包括用户通过人机 交互界面输入的选框,所述选框用于框选待滤除对象。比如,用户可以直接在用户界面绘制选框框选待滤除对象,其中,用户绘制的选框可以是矩形选框,圆形选框或者是不规则形状的选框,具体可以根据实际需求设置。In some embodiments, the user instruction for determining the object to be filtered may include a check box input by the user through a human-computer interaction interface, where the check box is used to frame the object to be filtered out. For example, the user can directly draw a selection frame on the user interface to select the objects to be filtered out. The selection frame drawn by the user can be a rectangular selection frame, a circular selection frame or an irregular shaped selection frame, which can be set according to actual needs.
在某实施例中,可以将用户通过选框框选的图像区域作为待滤除对象对应的第一像素区块,由于用户绘制的选框可能不够精准,可能存在待滤除对象的部分边缘区域未框选到,但是一些背景区域反而框选进来的场景,进而在对第一像素区块进行替换处理时,替换处理后的图像中可能存在未替换完全的待滤除对象,导致图像替换后出现瑕疵,为了避免这一现象,在用户输入选框框选待滤除对象后,可以先对第一图像进行超像素分割处理,得到多个图像区域,然后根据这多个图像区域对选框框选的像素区块进行调整。其中,超像素分割处理的原理是对像素进行分组处理,将具有相似纹理、颜色、亮度等特征的相邻像素分为一组,作为一个图像区域,从而可以将图像划分为多个图像区域,然后可以根据这多个图像区域调整选框中框选的像素区块。对第一图像进行超像素分割处理时,可以采用目前通用的算法实现,在此不再赘述。In a certain embodiment, the image area selected by the user through the selection frame may be used as the first pixel block corresponding to the object to be filtered out. Since the selection frame drawn by the user may not be accurate enough, there may be some edge areas of the object to be filtered out that are not The frame is selected, but some background areas are frame-selected instead, and when the first pixel block is replaced, there may be incompletely replaced objects to be filtered out in the replaced image, which causes the image to appear after the image is replaced. In order to avoid this phenomenon, after the user inputs the marquee to select the object to be filtered out, the first image can be subjected to superpixel segmentation processing to obtain multiple image areas, and then the marquee selection is performed according to the multiple image areas. pixel block to adjust. Among them, the principle of superpixel segmentation processing is to group pixels, and group adjacent pixels with similar texture, color, brightness and other characteristics into a group as an image area, so that the image can be divided into multiple image areas. Then, the pixel blocks framed in the marquee can be adjusted according to the multiple image areas. When performing superpixel segmentation processing on the first image, it can be implemented by using a currently common algorithm, and details are not described herein again.
在某些实施例中,在根据超像素分割处理得到的多个图像区域来调整选框中框选的像素区块时,可以根据各图像区域落入选框的部分与该图像区域的占比来调整选框框选的像素区块。比如,可以先确定每个图像区域落入选框的部分与该图像区域的占比,如果占比大于预设比例,比如大于50%,认为该图像区域被选框选中,则将该图像区域置于选框内,如果小于,认为该图像区域未被选框选中,则将图像区域置于选框外,从而调整选框框选的像素区块。当然,在某些实施例,为了尽可能保证待滤除对象对应的第一像素区块在选框内,通过上述方式调整选框框选的像素区块后,还可以对选框进行扩大处理,扩大选框框选的像素区块,以作为第一像素区块。In some embodiments, when adjusting the pixel blocks selected in the marquee according to the multiple image regions obtained by the superpixel segmentation process, the ratio of the portion of each image region that falls into the marquee to the image region can be adjusted. to adjust the pixel block selected by the marquee. For example, you can first determine the proportion of the part of each image area that falls into the marquee to the image area. If the proportion is greater than a preset proportion, such as greater than 50%, it is considered that the image area is selected by the marquee, and the image area is selected. If it is smaller than the marquee, it is considered that the image area is not selected by the marquee, and the image area is placed outside the marquee to adjust the pixel block selected by the marquee. Of course, in some embodiments, in order to ensure that the first pixel block corresponding to the object to be filtered is within the selection frame as much as possible, after adjusting the pixel block selected by the selection frame in the above-mentioned manner, the selection frame can also be enlarged. Expand the pixel block selected by the marquee to serve as the first pixel block.
通过对图像进行超像素处理后,再对用户输入选框进行微调,调整选框框选的内容,这样用户在框选待滤除对象时,无需用户进行精准地框选, 也可以比较准确地确定出用户想要选中的图像区域,从而准确确定待滤除对象对应的第一像素区块,方便了用户的操作。After performing superpixel processing on the image, fine-tune the user's input box to adjust the content of the box, so that when the user selects the object to be filtered out, the user does not need to make an accurate box selection, and can also more accurately determine. The image area that the user wants to select is selected, so as to accurately determine the first pixel block corresponding to the object to be filtered out, which facilitates the user's operation.
为了可以方便将控制摄像装置调整到不同的位姿,以在不同位姿采集图像,在某些实施例中,摄像装置可以搭载于可移动平台上,可以通过控制可移动平台运动以控制摄像装置运动,以调整到可以观测到被待滤除对象遮挡的第二位姿并采集得到第二图像。In order to conveniently adjust the control camera device to different poses to capture images in different poses, in some embodiments, the camera device can be mounted on a movable platform, and the camera device can be controlled by controlling the movement of the movable platform The movement is adjusted so that the second pose occluded by the object to be filtered can be observed and a second image is acquired.
在某些实施例中,可移动平台可以是任一包括动力部件且该动力部件可以驱使可移动平台运动的电子设备。比如,可移动平台可以是无人机、无人车、无人船或者是智能机器人等任一种。In some embodiments, the movable platform can be any electronic device that includes a power component that can drive the movable platform to move. For example, the movable platform can be any one of drones, unmanned vehicles, unmanned ships, or intelligent robots.
在某些实施例中,摄像装置也可以通过云台搭载于可移动平台,比如,可移动平台可以设有云台,摄像装置可以固定在云台上,既可以通过控制可移动平台运动控制摄像装置运动,也可以通过控制云台运动使得摄像装置与可移动平台产生相对运动,从而控制摄像装置运动,以调整到第二位姿。In some embodiments, the camera device can also be mounted on the movable platform through the pan-tilt. For example, the movable platform can be provided with a pan-tilt, and the camera device can be fixed on the pan-tilt, and the camera can be controlled by controlling the movement of the movable platform. The movement of the device can also be controlled to make the camera device and the movable platform move relative to each other by controlling the movement of the PTZ, so as to control the movement of the camera device to adjust to the second pose.
在某些实施例中,第二位姿可以包括第二位置和第二朝向,在摄像装置通过云台搭载于可移动平台的场景,控制摄像装置运动时,可以通过控制可移动平台运动,使摄像装置位于第二位置,可以通过控制云台转动,使摄像装置的朝向调整至第二朝向。以可移动平台为无人机为例,无人机上可以设置云台,摄像装置可以安装于云台上,在确定第二位姿后,可以通过控制无人机飞到第二位置,到达第二位置后,可以控制云台转动,使摄像装置的朝向调整到第二朝向。In some embodiments, the second pose may include a second position and a second orientation. In a scene where the camera device is mounted on the movable platform through the gimbal, when the camera device is controlled to move, the movable platform can be controlled to move so as to make the camera move. The camera device is located at the second position, and the orientation of the camera device can be adjusted to the second orientation by controlling the rotation of the pan/tilt. Take the mobile platform as an example of a UAV, a gimbal can be set on the UAV, and a camera device can be installed on the gimbal. After the second pose is determined, the UAV can be controlled to fly to the second position to reach the first position. After the second position, the pan/tilt can be controlled to rotate, so that the orientation of the camera device is adjusted to the second orientation.
在获取第二图像时可以采用多种方式。比如,既可以先确定可以观测到目标对象的第二位姿,然后直接控制摄像装置调整至第二位姿采集得到第二图像,当然,也可以不断改变摄像装置的位姿以得到摄像装置在不同位姿采集的多帧图像,然后每采集一帧图像,判断该图像是否包括完整的目标对象,直至获取到包括完整目标对象的图像,则作为第二图像。A variety of ways can be used in acquiring the second image. For example, it is possible to first determine the second pose where the target object can be observed, and then directly control the camera to adjust to the second pose to collect the second image. Of course, the pose of the camera can also be changed continuously to obtain the Multiple frames of images collected in different poses, and then each time a frame of image is collected, it is determined whether the image includes a complete target object, until an image including the complete target object is obtained, which is taken as the second image.
在某些实施例中,为了采集到包括被待滤除对象遮挡的目标对象,可 以先自动确定摄像装置可以观测到目标对象的第二位姿,然后控制摄像装置运动以调整到所述第二位姿,以采集第二图像。比如,摄像装置可以搭载在无人机、无人车等可移动平台中,因此,可以自动计算摄像装置该处于哪个位置和姿态,才可以观测到完整的目标对象,然后自动控制无人机、无人车移动到对应位置,并采集得到第二图像。In some embodiments, in order to capture the target object that is occluded by the object to be filtered out, it may be automatically determined that the camera can observe the second pose of the target object, and then the camera is controlled to move to adjust to the second pose. pose to acquire the second image. For example, the camera device can be mounted on movable platforms such as drones and unmanned vehicles. Therefore, the position and attitude of the camera device can be automatically calculated to observe the complete target object, and then automatically control the drone, The unmanned vehicle moves to the corresponding position and collects the second image.
在某些实施例中,也可以先自动确定无人机可以采集到目标对象的第二位姿,然后向用户发出指示第二位姿的提示信息,以便用户控制所述摄像装置运动以调整至第二位姿并采集第二图像。举个例子,以用户使用手机、相机等摄像装置进行拍摄的场景为例,可以先自动计算出第二位姿,然后通过交互界面向用户发出指示第二位姿的提示信息,提示信息可以是文字信息,也可以是图像信息,比如,可以在交互界面显示“从当前位置向东移动100米”,“从当前位置向右移动50米”等提示信息,这样用户便可以根据提示信息控制摄像装置移动到对应位置再进行拍摄。当然,如果用户使用可移动平台进行拍摄,则用户可以根据提示信息操控可移动平台对应的控制终端,通过控制终端控制可移动平台移动到对应位置。In some embodiments, it can also be automatically determined that the drone can capture the second pose of the target object, and then a prompt message indicating the second pose is sent to the user, so that the user can control the movement of the camera to adjust to the A second pose and a second image is acquired. For example, taking a scene where a user uses a mobile phone, a camera, and other camera devices to shoot as an example, the second pose can be automatically calculated first, and then a prompt message indicating the second pose is sent to the user through the interactive interface. The prompt message can be: Text information can also be image information. For example, prompt information such as "move 100 meters from the current position to the east" and "move to the right from the current position 50 meters" can be displayed on the interactive interface, so that the user can control the camera according to the prompt information. The device is moved to the corresponding position before shooting. Of course, if the user uses the movable platform to shoot, the user can control the control terminal corresponding to the movable platform according to the prompt information, and control the movable platform to move to the corresponding position through the control terminal.
当然,在某些实施例中,第二位姿包括第二位置和第二朝向,向用户发出指示第二位姿的提示信息时,可以向用户展示标识有第二位置的图像,以及展示调整至第二朝向对应的旋转角度信息。为了让提示信息更加直观,便于用户快速定位到第二位姿,提示信息也可以是图像信息,比如,可以在交互界面向用户展示标识有第二位姿中的第二位置的图像,其中,可以观测到目标对象的第二位置可以是一片区域,因此,可以在图像中框选出这片区域,如图4所示。同时,还可以向用户展示调整至第二位姿中的第二朝向对应的旋转角度信息,以便用户根据展示的位置信息和角度信息调整摄像装置以采集第二图像。Of course, in some embodiments, the second pose includes a second position and a second orientation, and when the prompt information indicating the second pose is sent to the user, the user may be shown an image marked with the second position and adjusted to the rotation angle information corresponding to the second orientation. In order to make the prompt information more intuitive and facilitate the user to quickly locate the second pose, the prompt information can also be image information. For example, an image that identifies the second position in the second pose can be displayed to the user on the interactive interface, wherein, The second position where the target object can be observed can be an area, so this area can be framed in the image, as shown in FIG. 4 . At the same time, the rotation angle information corresponding to the second orientation adjusted to the second pose can also be displayed to the user, so that the user can adjust the camera device to capture the second image according to the displayed position information and angle information.
由于可以拍摄到目标对象的位置与待滤除对象和目标对象的相对位置有关,比如,待滤除对象与目标对象的距离较远时,移动较小的距离即可以采集到包含完整目标对象的图像,待滤除对象与目标对象的距离较近时, 可能需要移动较远的距离才可采集到包含完整的目标对象的图像。因此,在某些实施例中,在确定第二位姿时,可以先确定待滤除对象的位置信息和目标对象的位置信息,然后根据待滤除对象的位置信息和目标对象的位置信息确定第二位姿。Since the position of the target object that can be photographed is related to the relative position of the object to be filtered and the target object, for example, when the distance between the object to be filtered and the target object is far, moving a small distance can collect the complete target object. When the distance between the object to be filtered and the target object is relatively short, it may be necessary to move a long distance to collect an image including the complete target object. Therefore, in some embodiments, when determining the second pose, the location information of the object to be filtered and the location information of the target object may be determined first, and then the location information of the object to be filtered and the location information of the target object may be determined. second pose.
当然,待滤除对象的尺寸对可以完整拍摄到目标对象的位置也有影响,比如待滤除对象尺寸较大,可能得移动到较远的位置才可完整拍摄到目标对象,而待滤除对象尺寸较小,可能只需移动较小的距离即可完整拍摄到目标对象。因此,在某些实施例中,根据待滤除对象的位置信息和目标对象的位置信息确定第二位姿时,可以确定待滤除对象的尺寸,然后根据待滤除对象的尺寸、待滤除对象的位置信息以及目标对象的位置信息确定第二位姿。Of course, the size of the object to be filtered also affects the position where the target object can be completely photographed. For example, if the size of the object to be filtered is large, the target object may have to be moved to a farther position to be completely photographed. Small in size, it may be possible to fully capture the target object by moving a small distance. Therefore, in some embodiments, when the second pose is determined according to the position information of the object to be filtered and the position information of the target object, the size of the object to be filtered may be determined, and then the size of the object to be filtered, the size of the object to be filtered and the size of the object to be filtered may be determined. The second pose is determined by dividing the position information of the object and the position information of the target object.
如图5所示,图中垃圾桶51为待滤除对象,房子52为被遮挡的目标对象,图中的黑点表示摄像装置所在的位置。假设当前摄像装置在“位置1”拍摄到第一图像,第一图像中目标对象52被待滤除对象51遮挡,在确定可以完整拍摄到目标对象52的第二位姿时,可以让摄像装置绕过待滤除对象51(比如绕到待滤除对象后面,如图中的“位置2”),以拍摄到完整的目标对象52,当然,也可以沿着当前拍摄位置移动一段距离,到达“位置3”,以便目标对象52可以落入摄像装置的视角范围。在某些实施例中,第一位姿包括第一位置和第一朝向,第二位姿包括第二位置和第二朝向,第二位置位于经过第一位置且与待滤除对象所在平面平行的直线上,第二朝向指向所述待滤除对象所在的位置,即可以沿着摄像装置当前所在的第一位置平移一段距离,到达第二位置,再将摄像装置的朝向调整成指向待滤除对象。As shown in FIG. 5 , the trash can 51 in the figure is the object to be filtered out, the house 52 is the target object to be occluded, and the black dot in the figure represents the position of the camera device. Assuming that the current camera captures the first image at "Position 1", and the target object 52 in the first image is blocked by the object 51 to be filtered out, when it is determined that the second pose of the target object 52 can be completely captured, the camera can Bypass the object 51 to be filtered (for example, go behind the object to be filtered, as shown in "Position 2") to capture the complete target object 52, of course, you can also move a distance along the current shooting position to reach "Position 3" so that the target object 52 can fall within the field of view of the camera. In some embodiments, the first pose includes a first position and a first orientation, the second pose includes a second position and a second orientation, and the second position passes through the first position and is parallel to a plane where the object to be filtered is located On the straight line, the second orientation points to the position of the object to be filtered, that is, you can translate a distance along the current first position of the camera device to reach the second position, and then adjust the orientation of the camera device to point to the object to be filtered. remove objects.
在某些实施例中,在确定第二位置时,可以根据待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定移动距离,然后根据第一位置和移动距离确定第二位置。举个例子,如图6所示,图中的小长方体61为待滤除对象,待滤除对象的宽度为L,待滤除对象与摄 像装置的距离为d1,大长方体62为被遮挡的目标对象,目标对象与摄像装置的距离为d2,将待滤除对像和目标对象转为俯视视角下的视图,其中,俯视视角下的目标对象如图中的63所示,俯视视角下的待滤除对像如图中的65所示,目标对象中被待滤除对象遮挡的区域如图中的64所示,图中的“位置A”为第一位置,像平面示意图66为摄像装置在第一位置采集的图像的示意图,像平面示意图67为摄像装置在“位置B”采集的图像的示意图,其中,“位置B”为摄像装置刚好可以观测到目标对象被遮挡区域左边缘的位置,“位置B”可以从第一位置平移距离D到达,从图6中可知,移动的距离D可以通过公式(1)求解:In some embodiments, when determining the second position, the moving distance may be determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered, and then the moving distance may be determined according to the first position and the size of the object to be filtered. The moving distance determines the second position. For example, as shown in FIG. 6, the small cuboid 61 in the figure is the object to be filtered, the width of the object to be filtered is L, the distance between the object to be filtered and the camera is d1, and the large cuboid 62 is blocked. The target object, the distance between the target object and the camera device is d2, and the object to be filtered and the target object are converted to a view from a top-down perspective. The object to be filtered is shown as 65 in the figure, the area of the target object that is occluded by the object to be filtered is shown as 64 in the figure, the "position A" in the figure is the first position, and the schematic diagram of the image plane 66 is the camera The schematic diagram of the image collected by the device at the first position, the image plane schematic diagram 67 is a schematic diagram of the image collected by the camera at "position B", where "position B" is the position where the camera device can just observe the left edge of the occluded area of the target object. position, "position B" can be reached by translation distance D from the first position, and it can be seen from Figure 6 that the moving distance D can be solved by formula (1):
其中,待滤除对象与摄像装置的距离d1以及目标对象与摄像装置的距离d2可以通过摄像装置在不同位姿采集的多张图像确定。待滤除对象的宽度L可以根据待滤除对象与摄像装置的距离以及待滤除对象的成像尺寸确定。The distance d1 between the object to be filtered and the camera device and the distance d2 between the target object and the camera device may be determined by using multiple images collected by the camera device in different poses. The width L of the object to be filtered out can be determined according to the distance between the object to be filtered out and the camera device and the imaging size of the object to be filtered out.
从图6中可知,“位置B”与待滤除对象右边缘连线右侧的区域都可以观测到被遮挡区域,因而,第二位置可以是该区域内的任一位置。在确定移动距离D后,可以根据第一位置当前的三维空间坐标以及移动距离D确定“位置B”的三维空间坐标,进一步确定第二位置对应的三维空间坐标,并控制摄像装置移动至第二位置。It can be seen from FIG. 6 that the occluded area can be observed in the area on the right side of the line connecting “Location B” and the right edge of the object to be filtered. Therefore, the second location can be any location in this area. After the moving distance D is determined, the three-dimensional space coordinates of "position B" can be determined according to the current three-dimensional space coordinates of the first position and the moving distance D, the three-dimensional space coordinates corresponding to the second position can be further determined, and the camera is controlled to move to the second position. Location.
在某些实施例中,在确定待滤除对象与摄像装置的距离d1以及目标对象与摄像装置的距离d2时,可以获取摄像装置在不同位姿采集的多帧图像,从其中一帧图像中确定一个包括待滤除对象的区域,比如,如图7所示,确定一个包括待滤除对象70的区域71,然后在确定一环绕区域71点的环状区域72。在确定待滤除对象与摄像装置的距离d1时,可以先从区域71提取多个特征点,特征点的提取可以采用现有的特征点提取算法,在此不再赘述。然后可以确定提取的特征点在其余的多帧图像中的匹配点,然后根据这些特征点在其余各图像的匹配点确定各特征点的光流向量,根 据特征点的光流向量拟合待滤除对象(即区域71)的中心相对于各图像的光流向量,从而可以确定待滤除对象(即区域71)的中心在其余多帧图像中的匹配点,根据待滤除对象的中心的特征点和匹配点,可以采用BA(Bundle Adjustment)算法确定出摄像装置的内外参数,并根据摄像装置的内外参确定待滤除对象的中心的深度距离,即为待滤除对象与摄像装置的距离d1。对于目标对象与摄像装置的距离d2,则可以从环状区域72中提取特征点,然后采用类似的手段确定目标对象与摄像装置的距离d2,在此不再赘述。In some embodiments, when determining the distance d1 between the object to be filtered and the camera device and the distance d2 between the target object and the camera device, multiple frames of images collected by the camera device in different poses may be acquired, and one frame of the image An area including the object to be filtered out is determined, for example, as shown in FIG. 7 , an area 71 including the object to be filtered out 70 is determined, and then an annular area 72 surrounding the area 71 is determined. When determining the distance d1 between the object to be filtered and the camera device, a plurality of feature points can be extracted from the area 71 first, and the feature point extraction can be performed by using an existing feature point extraction algorithm, which will not be repeated here. Then, the matching points of the extracted feature points in the remaining multi-frame images can be determined, and then the optical flow vector of each feature point can be determined according to the matching points of these feature points in the remaining images, and the optical flow vector of the feature points can be fitted according to the optical flow vector of the feature points to be filtered. The center of the object (that is, the area 71) is relative to the optical flow vector of each image, so that the matching points of the center of the object to be filtered (that is, the area 71) in the remaining multi-frame images can be determined, according to the center of the object to be filtered out. For feature points and matching points, the BA (Bundle Adjustment) algorithm can be used to determine the internal and external parameters of the camera, and the depth distance from the center of the object to be filtered is determined according to the internal and external parameters of the camera, which is the distance between the object to be filtered and the camera. distance d1. For the distance d2 between the target object and the camera device, feature points can be extracted from the annular region 72, and then a similar method is used to determine the distance d2 between the target object and the camera device, which will not be repeated here.
在某些实施例中,在确定第二朝向时,可以根据第一位置以及待滤除对象在摄像装置采集的图像画面中的位置确定第二朝向。比如,摄像装置在移动的过程中,可以实时检测待滤除对象在采集的图像画面中的位置,可以不断调整摄像装置的朝向,以保持待滤除对象在图像画面的中心,从而当摄像装置移动到第二位置时,第二朝向也可以确定。比如,可以根据第一图像中待滤除对象的中心在图像画面的位置以及第一位姿对应的位姿参数确定摄像装置移动至第二位置时,待滤除对象的中心要位于画面中心第二朝向对应的姿态角,从而确定第二朝向。In some embodiments, when the second orientation is determined, the second orientation may be determined according to the first position and the position of the object to be filtered out in the image frame captured by the camera. For example, during the moving process of the camera device, it can detect the position of the object to be filtered out in the captured image in real time, and can continuously adjust the orientation of the camera device to keep the object to be filtered out in the center of the image screen, so that when the camera device When moving to the second position, the second orientation can also be determined. For example, according to the position of the center of the object to be filtered out in the first image on the image screen and the pose parameters corresponding to the first pose, it can be determined that when the camera moves to the second position, the center of the object to be filtered out should be located at the center of the screen at the second position. The second orientation corresponds to the attitude angle, thereby determining the second orientation.
在某些实施例中,在确定第二朝向时,也可以根据第一位置、待滤除对象左右端点的位置以及目标对象左右端点的位置确定第二朝向。举个例子,如图8所示,可以先根据第一位置和第二位置的三维坐标确定第二位置位于第一位置的哪一侧,当第二位置位于第一位置右侧时,可以根据待滤除对象的左端点A、目标对象的右端点D确定一连线AD,第二朝向为沿着该连线AD指向待滤除对像。由于待滤除对象的左端点A、目标对象的右端点D的三维坐标可以确定,因而两个端点连线对应的姿态角也可以求解出来。当然,当第二位置位于第一位置左侧时,可以根据待滤除对象的左端点B、目标对象的右端点C,确定一连线BC,第二朝向为沿着该连线BC指向待滤除对象。同样的,可以根据待滤除对象的左端点B、目标对象的右端点C的三维坐标确定连线BC对应的姿态角。In some embodiments, when determining the second orientation, the second orientation may also be determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object. For example, as shown in FIG. 8 , which side of the first position the second position is located on can be determined according to the three-dimensional coordinates of the first position and the second position, and when the second position is located on the right side of the first position, it can be determined according to the three-dimensional coordinates of the first position and the second position. The left endpoint A of the object to be filtered and the right endpoint D of the target object determine a connecting line AD, and the second orientation is to point to the object to be filtered along the connecting line AD. Since the three-dimensional coordinates of the left endpoint A of the object to be filtered and the right endpoint D of the target object can be determined, the attitude angle corresponding to the line connecting the two endpoints can also be solved. Of course, when the second position is located on the left side of the first position, a connecting line BC can be determined according to the left endpoint B of the object to be filtered and the right endpoint C of the target object, and the second orientation is along the connecting line BC pointing to the object to be filtered. Filter out objects. Similarly, the attitude angle corresponding to the connection line BC can be determined according to the three-dimensional coordinates of the left endpoint B of the object to be filtered and the right endpoint C of the target object.
当然,在获取第二图像时,也可以采用不断调整摄像装置的位姿采集图像然后判断采集的图像是否可以作为第二图像的方式获取第二图像。比如,在某些实施例中,也可以不断改变摄像装置的位姿,以得到摄像装置在不同位姿采集的多帧图像,摄像装置每采集一帧图像,可以判断该图像是否包括目标对象对应的第二像素区块,如果包括,则将该图像作为第二图像。Of course, when acquiring the second image, the second image may also be acquired by continuously adjusting the pose of the camera to acquire the image and then judging whether the acquired image can be used as the second image. For example, in some embodiments, the pose of the camera can also be continuously changed to obtain multiple frames of images collected by the camera at different poses. Each time the camera collects a frame of image, it can determine whether the image includes the corresponding image of the target object. The second pixel block of , if included, the image is regarded as the second image.
其中,判断图像中是否包括第二像素区块可以由用户自行判定,也可以由执行该图像处理方法的设备自动判定。以摄像装置搭载于无人机等可移动平台为例,用户可以调整无人机的位姿,在不同位姿采集图像,然后无人机可以将采集的图像回传至控制终端,用户判定图像中包括目标对象时,即可以点击该图像,将其作为第二图像。当然,也可以通过对采集的图像进行一定处理和识别,自动判定采集的图像是否可以作为第二图像。比如,在某些实施例中,在采集到第一图像并从第一图像确定待滤除对象对应的第一像素区块后,可以在第一像素区块提取多个第一特征点,并且在第一像素区块的周边区域提取多个第二特征点,针对摄像装置改变位姿后采集的每一帧图像,可以确定第一特征点在该图像中的第一匹配点以及第二特征点在该图像中的第二匹配点,然后根据第一匹配点和第二匹配点的在图像中的位置关系确定该图像是否包括第二像素区块。The determination of whether the image includes the second pixel block may be determined by the user, or may be determined automatically by the device executing the image processing method. Taking the camera device mounted on a mobile platform such as a drone as an example, the user can adjust the posture of the drone and collect images in different postures, and then the drone can send the collected images back to the control terminal, and the user can determine the image. When the target object is included in the , you can click on the image to use it as a second image. Of course, it is also possible to automatically determine whether the collected image can be used as the second image by performing certain processing and identification on the collected image. For example, in some embodiments, after the first image is collected and the first pixel block corresponding to the object to be filtered is determined from the first image, a plurality of first feature points may be extracted from the first pixel block, and A plurality of second feature points are extracted from the surrounding area of the first pixel block, and for each frame of image collected after the camera device changes the pose, the first matching point and the second feature of the first feature point in the image can be determined point the second matching point in the image, and then determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point in the image.
在某些实施例中,第一特征点可以是位于第一像素区块第一侧之内的特征点,第二特征点可以是位于第一像素区块第二侧之外的特征点,在根据第一匹配点和第二匹配点的位置关系确定图像是否包括第二像素区块时,可以判定第二匹配点是否位于第一匹配点的第一侧,如果是,则判定该图像包括第二像素区块。其中,所述第一侧为所述第二侧的对侧,比如第一侧为第一像素区块的左侧,则第二侧为第一像素区块的右侧,第一侧为第一像素区块的上侧,则第二侧为第一像素区块的下侧。举个例子,如图9所示,图9中(a)为第一图像90的示意图,可以从第一图像90中确定第一像素区块91,在第一像素区块91的第一侧(即左侧)之内提取多 个第一特征点92,以及在第一像素区块的第二侧(即右侧)之外提取多个第二特征点93,当摄像装置改变位姿采集一帧图像后,如图中(b)为该图像94的示意图,可以确定第一特征点在该图像94的第一匹配点95以及第二特征点在该图像94的第二匹配点96,然后判定第一匹配点95和第二匹配点96的位置关系,如图所示,第二匹配点96位于第一匹配点95的第一侧(左侧),则认为此时目标对象并未被待滤除对象遮挡,因而可以确定该图像中包括目标对象对应的第二像素区块。In some embodiments, the first feature point may be a feature point located within the first side of the first pixel block, the second feature point may be a feature point located outside the second side of the first pixel block, and the When determining whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point, it can be determined whether the second matching point is located on the first side of the first matching point, and if so, it is determined that the image includes the first matching point. Two pixel blocks. The first side is the opposite side of the second side. For example, the first side is the left side of the first pixel block, the second side is the right side of the first pixel block, and the first side is the first side. The upper side of a pixel block, the second side is the lower side of the first pixel block. For example, as shown in FIG. 9 , (a) in FIG. 9 is a schematic diagram of the first image 90 , the first pixel block 91 can be determined from the first image 90 , and the first pixel block 91 is on the first side of the first pixel block 91 . A plurality of first feature points 92 are extracted within (ie, the left side), and a plurality of second feature points 93 are extracted outside the second side (ie, the right side) of the first pixel block. When the camera device changes the pose to capture After one frame of image, as shown in (b) is a schematic diagram of the image 94, it can be determined that the first feature point is at the first matching point 95 of the image 94 and the second feature point is at the second matching point 96 of the image 94, Then determine the positional relationship between the first matching point 95 and the second matching point 96. As shown in the figure, the second matching point 96 is located on the first side (left side) of the first matching point 95, and it is considered that the target object is not at this time. is blocked by the object to be filtered out, so it can be determined that the image includes the second pixel block corresponding to the target object.
在某些实施例中,第二特征点为多个,这多个第二特征点可以位于环绕第一像素区域的环状像素区块中,在根据第一匹配点和第二匹配点的位置关系确定图像是否包括第二像素区块时,当判定第二匹配点中预设数量的第二匹配点位于所述第一匹配点的一侧时,则判定第二图像中包括第二像素区块。其中,预设数量可以根据实际需求确定,比如,可以是90%的第二匹配点都位于第一匹配点一侧。如图10所示,图中(a)为第一图像100的示意图,可以从第一图像100中确定第一像素区块101,在第一像素区块101内提取多个第一特征点102,在第一像素区块101周围的环状像素区块103提取多个第二特征点104,当摄像装置改变位姿采集一帧图像后,如图中(b)为该图像105的示意图,可以确定第一特征点102在该图像105的第一匹配点106以及第二特征点104在该图像105的第二匹配点107,然后判定第一匹配点106和第二匹配点107的位置关系,如图所示,当超过一定数量的第二匹配点107(比如超过第二匹配点总数量的90%)位于第一匹配点106的一侧,则认为此时目标对象并未被待滤除对象遮挡,因而可以确定该图像中包括目标对象对应的第二像素区块。In some embodiments, there are a plurality of second feature points, and the plurality of second feature points may be located in a ring-shaped pixel block surrounding the first pixel area, at positions according to the first matching point and the second matching point When determining whether the image includes the second pixel block, when it is determined that a preset number of second matching points in the second matching point is located on one side of the first matching point, then it is determined that the second image includes the second pixel region. Piece. The preset number may be determined according to actual requirements, for example, 90% of the second matching points may be located on one side of the first matching point. As shown in FIG. 10 , (a) is a schematic diagram of the first image 100 , the first pixel block 101 can be determined from the first image 100 , and a plurality of first feature points 102 can be extracted from the first pixel block 101 , extract a plurality of second feature points 104 in the annular pixel block 103 around the first pixel block 101, when the camera changes the pose to collect a frame of image, as shown in (b) is a schematic diagram of the image 105, It can be determined that the first feature point 102 is at the first matching point 106 of the image 105 and the second feature point 104 is at the second matching point 107 of the image 105, and then the positional relationship between the first matching point 106 and the second matching point 107 can be determined , as shown in the figure, when more than a certain number of second matching points 107 (for example, more than 90% of the total number of second matching points) are located on one side of the first matching point 106 , it is considered that the target object has not been filtered at this time. Except for the occlusion of the object, it can be determined that the image includes the second pixel block corresponding to the target object.
由于在某些场景,可能即便调整摄像装置的位姿,也无法完整拍摄到被待滤除对象遮挡的目标对象,比如,当待滤除对象与目标对象之间的距离非常近时,则无法通过调整摄像装置的位姿拍摄到完整的目标对象,以补全第一图像中被待滤除对象遮挡的目标对象。这种场景下,可以向用户发出提示信息,提示用户当前场景无法滤除第一图像中的待滤除对象。所 以,在某些实施例中,当预设的第一条件触发后,则向用户发出无法滤除待滤除对象的提示信息,其中,提示信息可以以弹窗的形式显示,比如可以在用户交互界面显示弹窗信息,提示用户无法滤除当前选择的待滤除对象。Because in some scenes, even if the pose of the camera device is adjusted, the target object occluded by the object to be filtered may not be completely captured. For example, when the distance between the object to be filtered and the target object is very close, the A complete target object is captured by adjusting the pose of the camera device to complement the target object occluded by the object to be filtered out in the first image. In such a scenario, prompt information may be sent to the user to prompt the user that the object to be filtered out in the first image cannot be filtered out in the current scene. Therefore, in some embodiments, when the preset first condition is triggered, a prompt message indicating that the object to be filtered cannot be filtered is sent to the user, wherein the prompt message can be displayed in the form of a pop-up window, for example, it can be displayed in the user The interactive interface displays pop-up information, prompting the user that the currently selected object to be filtered cannot be filtered out.
在某些实施例中,第一预设条件可以是以下至少一种:待滤除对象与目标对象的第一距离小于第一预设阈值,或目标对象的与摄像装置的第二距离小于第二预设阈值,或第一距离与第二距离之间的距离大小关系不满足预设第二条件。当然,第一预设阈值、第二预设阈值和第二条件可以根据实际场景灵活设置,比如待滤处对象与目标对象的距离小于1米,则无法拍摄到完整的目标对象,则可以将第一预设阈值设置为1米。第二预设阈值和第二预设条件可以通过类似的手段设置,在此不再赘述。In some embodiments, the first preset condition may be at least one of the following: the first distance between the object to be filtered and the target object is less than a first preset threshold, or the second distance between the target object and the camera is less than the first distance Two preset thresholds, or the distance relationship between the first distance and the second distance does not satisfy the preset second condition. Of course, the first preset threshold, the second preset threshold and the second condition can be flexibly set according to the actual scene. For example, if the distance between the object to be filtered and the target object is less than 1 meter, the complete target object cannot be photographed. The first preset threshold is set to 1 meter. The second preset threshold and the second preset condition may be set by similar means, and details are not described herein again.
在某些实施例中,利用第二图像中的第二像素区块对第一图像的第一像素区块做替换处理之前,可以先在采集的第二图像中确定第二像素区块。其中,确定第二像素区域的方式比较多,在某些实施例中,在第二图像中确定第二像素区块时,可以先确定第一图像的像素点与第二图像的像素点之间的映射关系,根据该映射关系确定第一像素区块在第二图像的映射区域,作为所述第二像素区块,然后利用第二像素区块替换第一图像中的第一像素区块。In some embodiments, before performing the replacement process on the first pixel block of the first image with the second pixel block in the second image, the second pixel block may be determined in the collected second image first. Among them, there are many ways to determine the second pixel area. In some embodiments, when determining the second pixel area in the second image, the distance between the pixel points of the first image and the pixel points of the second image may be determined first. According to the mapping relationship, the mapping area of the first pixel block in the second image is determined as the second pixel block, and then the second pixel block is used to replace the first pixel block in the first image.
在某些实施中,在确定第一图像的像素点与第二图像的像素点之间的映射关系时,可以先在第一图像中第一像素区块的周边区域提取第三特征点,并在第二图像中确定第三特征点的第三匹配点,然后根据第三特征点和第三匹配点确定该映射关系。其中,第一图像的像素点与第二图像的像素点之间的映射关系可以通过单应性矩阵表征,举个例子,假设第一图像上的像素点的像素坐标为P1,第二图像上的像素点的像素坐标为P2,单应性矩阵为H,则第一图像的像素点和第二图像的像素点满足合公式(2):In some implementations, when determining the mapping relationship between the pixels of the first image and the pixels of the second image, a third feature point may be extracted from the peripheral area of the first pixel block in the first image, and A third matching point of the third feature point is determined in the second image, and then the mapping relationship is determined according to the third feature point and the third matching point. The mapping relationship between the pixels of the first image and the pixels of the second image can be represented by a homography matrix. For example, assuming that the pixel coordinates of the pixels on the first image are P1, The pixel coordinate of the pixel point is P2, and the homography matrix is H, then the pixel point of the first image and the pixel point of the second image satisfy the formula (2):
P2=HP1 公式(2)P2=HP1 Formula (2)
由于单应性矩阵H有8个未知数,因此至少需要4对特征点和匹配点 才能求解。所以可以从第一图像中第一像素区块的周边区域(比如环绕第一像素区块周围一圈的区域)提取至少4个第三特征点,然后确定这至少4个像素点在第二图像的第三匹配点,根据第三特征点和第三匹配点求解出H。Since the homography matrix H has 8 unknowns, it needs at least 4 pairs of feature points and matching points to solve. Therefore, at least 4 third feature points can be extracted from the surrounding area of the first pixel block in the first image (such as the area surrounding the first pixel block), and then it is determined that these at least 4 pixel points are in the second image. The third matching point of , solve H according to the third feature point and the third matching point.
当然,在某些实施例中,为了求解得到的单应性矩阵H更加准确,可以利用RANSAC(Random sample consensus,随机抽样一致)算法,去除第三特征点和第三匹配点中匹配度较差的点,通过筛选出的匹配度较准确的第三特征点和第三匹配点来求解H,以得到更加准的H,保证结果的有效性。Of course, in some embodiments, in order to solve the obtained homography matrix H more accurately, the RANSAC (Random sample consensus) algorithm can be used to remove the poor matching degree between the third feature point and the third matching point H is obtained by filtering out the third feature point and the third matching point with a more accurate matching degree, so as to obtain a more accurate H and ensure the validity of the result.
在确定H后,即可以根据H确定第一图像中的第一像素区块在第二图像的映射区域,然后将该映射区域作为第二像素区块,替换第一图像中的第一像素区块,以补全第一图像中被待滤除对象遮挡的目标对象。After H is determined, the mapping area of the first pixel block in the first image in the second image can be determined according to H, and then the mapping area is used as the second pixel block to replace the first pixel area in the first image block to complement the target object in the first image that is occluded by the object to be filtered out.
在某些实施例中,在第二图像中确定第二像素区块时,也可以先在第一图像中确定一环绕第一像素区块的环状像素区块,然后在第二图像中确定与该环状像素区块相匹配的匹配环状区块,然后将第二图像中该匹配环状区块包围的像素区块作为第二像素区块。In some embodiments, when the second pixel block is determined in the second image, a ring-shaped pixel block surrounding the first pixel block can also be determined in the first image, and then determined in the second image. A matching ring-shaped block matched with the ring-shaped pixel block, and then the pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
由于去除待滤除对象的图像通常为用户用于后续使用的图像,因而,第一图像可以选取拍摄效果比较好图像,比如,可以是被拍摄目标比较清晰、且比较全面图像,所以,在某些实施例中,摄像装置可以在第一位姿采集多张图像,然后从这多张图像中选出第一图像,其中,第一图像可以由用户自行选择,也可以由执行该图像处理方法的设备根据图像的清晰度、亮度、画面构图等信息自动选择。Since the image from which the object to be filtered is removed is usually an image used by the user for subsequent use, the first image can be an image with a better shooting effect. In some embodiments, the camera device may collect multiple images in the first pose, and then select the first image from the multiple images, wherein the first image may be selected by the user, or the image processing method may be executed by the user. The device is automatically selected according to the image clarity, brightness, picture composition and other information.
当然,针对动态对象,由于对象自身会移动,因而比较适合通过摄像装置在同一位姿采集的多张图像进行消除,可以无需移动摄像装置。针对静态对象,由于对象自身不会移动,则可以通过移动摄像装置以采集摄像装置在不同位姿的图像消除静态对象。所以,在某些实施中,用户确定第一图像后,在第一图像中确定待滤除对象对应的第一像素区块之前,可以 先确定待滤除对象的类别信息,该类别信息用于标识待滤除对象为动态对象或静态对象,根据待滤除对象的类别信息,采用对应的处理方式对待滤除对象进行消除处理。其中,确定待滤除对象是动态对象还是静态对象可以根据摄像装置在第一位姿采集的多张图像确定。Of course, for a dynamic object, since the object itself will move, it is more suitable to eliminate multiple images collected by the camera device at the same pose, and it is not necessary to move the camera device. For a static object, since the object itself does not move, the static object can be eliminated by moving the camera to capture images of the camera in different poses. Therefore, in some implementations, after the user determines the first image, before determining the first pixel block corresponding to the object to be filtered out in the first image, the category information of the object to be filtered out may be determined first, and the category information is used for The object to be filtered is identified as a dynamic object or a static object, and a corresponding processing method is adopted to eliminate the object to be filtered according to the category information of the object to be filtered. Wherein, determining whether the object to be filtered out is a dynamic object or a static object may be determined according to a plurality of images collected by the camera device in the first pose.
在某些实施例中,通过摄像装置在第一位姿采集的多张图像确定待滤除对象的类别时,可以根据第一图像中的待滤除对象的各像素点相对于这多张图像中的其他图像的光流向量确定待滤除对象的类别信息。比如,可以统计待滤除对象的各像素点相对于其他图像的光流向量,如果光流向量的模长大于预设阈值,则认为该滤除对象为动态对象。In some embodiments, when the category of the object to be filtered out is determined by using the plurality of images collected by the camera in the first pose, each pixel of the object to be filtered out in the first image may be relative to the plurality of images The optical flow vectors of other images in determine the category information of the object to be filtered out. For example, the optical flow vector of each pixel of the object to be filtered out relative to other images can be counted, and if the modulo length of the optical flow vector is greater than a preset threshold, the filtered object is considered to be a dynamic object.
在某些实施例中,若待滤除对象为静态对象,则执行在第一图像中确定待滤除对象对应的第一像素区块,获取摄像装置在第二位姿采集的包括第二像素区块的第二图像,并通过第二像素区块对第一图像中第一像素区块做替换处理,以生成替换处理后的第一图像的步骤。In some embodiments, if the object to be filtered out is a static object, then the first pixel block corresponding to the object to be filtered out is determined in the first image, and the image captured by the camera in the second pose including the second pixel is obtained. The second image of the block, and the second pixel block is used to replace the first pixel block in the first image, so as to generate a step of replacing the processed first image.
在某些实施例中,如果确定待滤除对象为动态对象,则可以确定待滤除对象在第一图像中对应的第三像素区块,然后确定摄像装置在第一位姿采集的除第一图像以外的其他图像中位于该第三像素区块所在像素位置的对应像素位置上的第四像素区块,从其他图像中确定该第四像素区块为静态区域的第三图像(即第三像素区块的对应区域未被遮挡的图像),利用第三图像中的第四像素区块替换第一图像中的第三像素区块。如图11(a)所示,可以在第一图像中确定待滤除对象对应的第三像素区块110,然后确定第三像素区块110所在像素位置在其他图像(比如图中的图像1、图像2、图像3)中对应像素位置的第四像素区块(如图中的111),然后可以判定第四像素区块111是否为静态区域,如果是,则将该图像作为第三图像,比如图像1中的第四像素区块111为静态区域,则将图像1作为第三图像,并用图像1中的第四像素区块111替换第一图像中的第三像素区块110。In some embodiments, if it is determined that the object to be filtered out is a dynamic object, the third pixel block corresponding to the object to be filtered out in the first image may be determined, and then the third pixel block corresponding to the object to be filtered out in the first image may be determined, and then the third pixel block acquired by the camera in the first pose is determined. For the fourth pixel block located at the pixel position corresponding to the pixel position of the third pixel block in other images other than one image, it is determined from the other images that the fourth pixel block is the third image of the static area (that is, the third image The corresponding area of the three-pixel block is not blocked), and the fourth pixel block in the third image is used to replace the third pixel block in the first image. As shown in FIG. 11( a ), the third pixel block 110 corresponding to the object to be filtered can be determined in the first image, and then it is determined that the pixel position of the third pixel block 110 is located in another image (such as image 1 in the figure) , image 2, image 3) in the fourth pixel block (111 in the figure) corresponding to the pixel position, then it can be determined whether the fourth pixel block 111 is a static area, if so, then this image is used as the third image For example, the fourth pixel block 111 in the image 1 is a static area, the image 1 is regarded as the third image, and the fourth pixel block 111 in the image 1 is used to replace the third pixel block 110 in the first image.
在某些实施例中,在这多张图像中除第一图像以外的其他图像确定第 四像素区块为静态区域的第三图像时,可以先确定其他图像中的动态区域,然后针对第一图像中的每个待滤除对象,可以按照其他图像与第一图像采集顺序由近及远的顺序,确定第三像素区块所在像素位置在其他图像中的对应像素位置的像素区块,直至该对应像素位置的像素区块与动态区域不重叠(即未被遮挡),则将该其他图像作为第三图像。举个例子,如图11(b)所示,假设第一图像为摄像装置采集的第K帧图像,其他图像分别为摄像装置采集的第K+1帧、第K+2帧、第K+3帧等,可以先确定第K+1帧、第K+2帧、第K+3帧中的动态区域,确定每一帧的动态区域时,可以计算当前帧各像素点与其邻近的一帧或多帧图像的光流向量,若像素点的光流向量模长大于一定阈值,则认为这个像素点是运动的,然后对判定为运动的像素点进行聚类处理,得到多个像素点集合,集合中像素点数量大于一定值的(数量太少可能是噪声可以忽略)区域则认为是运动区域。假设图像中矩形区域和圆形区域为动态区域,其余区域为静态区域,确定第一图像中待滤除对象对应的第三像素区块121,第三像素区块所在像素位置121在第K+1帧、第K+2帧、第K+3帧中的对应像素位置的像素区块为虚线框框选的区域122,在确定第三图像时,可以首先判断第一图像的前一帧或者后一帧图像(比如第K+1帧)中第三像素区块121所在像素位置的对应像素位置的像素区块122是否与第K+1帧中的动态区域重叠,如果重叠,则判断第K+2帧中第三像素区块121所在像素位置的对应像素位置的像素区块122是否与动态区域重叠,当判定第K+2帧符合需求,则将第K+2帧作为第三图像,用这一帧中对应像素位置的像素区块替换第一图像的第三像素区块。In some embodiments, when other images in the plurality of images except the first image determine that the fourth pixel block is the third image of the static area, the dynamic area in the other images may be determined first, and then the first image is determined for the first image. For each object to be filtered out in the image, the pixel block whose pixel position of the third pixel block is located in the corresponding pixel position in the other images can be determined according to the order of acquisition of the other images and the first image from near to far, until The pixel block corresponding to the pixel position does not overlap with the dynamic area (ie, is not blocked), and the other image is regarded as the third image. For example, as shown in Figure 11(b), it is assumed that the first image is the Kth frame image collected by the camera, and the other images are the K+1th frame, the K+2th frame, and the K+th frame collected by the camera respectively. 3 frames, etc., you can first determine the dynamic area in the K+1th frame, the K+2th frame, and the K+3th frame. When determining the dynamic area of each frame, you can calculate each pixel of the current frame and its adjacent frame. Or the optical flow vector of multiple frames of images. If the modulo length of the optical flow vector of a pixel point is greater than a certain threshold, the pixel point is considered to be moving, and then the pixels determined to be moving are clustered to obtain multiple pixel point sets. , and the area where the number of pixels in the set is greater than a certain value (the number is too small may be that the noise can be ignored) is considered as a motion area. Assuming that the rectangular area and the circular area in the image are dynamic areas, and the remaining areas are static areas, determine the third pixel block 121 corresponding to the object to be filtered in the first image, and the pixel position 121 where the third pixel block is located is in the K+th The pixel block of the corresponding pixel position in the 1st frame, the K+2th frame, and the K+3th frame is the area 122 framed by the dotted line. Whether the pixel block 122 corresponding to the pixel position of the third pixel block 121 in a frame of image (such as the K+1th frame) overlaps with the dynamic region in the K+1th frame, and if so, then determine the Kth Whether the pixel block 122 corresponding to the pixel position of the third pixel block 121 in the +2 frames overlaps with the dynamic area, when it is determined that the K+2th frame meets the requirements, the K+2th frame is used as the third image, The third pixel block of the first image is replaced with the pixel block corresponding to the pixel position in this frame.
摄像装置在第一位姿采集图像时,通常是连续采集多帧图像,构成一个图像序列,由于这个图像序列中相邻两帧或多帧图像的差异可能比较小,动态对象在相邻两帧的位置变化不大,所以不太适合用相邻帧滤除第一图像的动态对象,如果逐一对这些图像帧进行判断,比较耗费资源。因此,在获取摄像装置采集的多张图像时,可以从摄像装置采集的图像序列中筛 选出一些可以体现动态对象变化的图像,以便更高效的利用这些图像来滤除动态对象。所以,在某些实施例中,这多张图像中除所述第一图像的其他图像可以是与第一图像的差异超过预设阈值的图像,或者是与第一图像间隔指定帧的图像。比如,可以以第一图像作为基准,如果图像序列中某帧图像中指定对象的角度或者位移与第一图像中该对象的角度或者位移超过预设阈值,则获取该图像作为上述多张图像中的一张,也可以获取与第一图像间隔指定帧的图像,比如,第一图像为图像序列的第5帧,则其他图像依次为第10帧、第15帧、第20帧、第25帧等。When the camera device collects images in the first attitude, it usually collects multiple frames of images continuously to form an image sequence. The position of the image does not change much, so it is not suitable to use adjacent frames to filter out the dynamic objects of the first image. If these image frames are judged one by one, it is more resource-intensive. Therefore, when acquiring multiple images collected by the camera, some images that can reflect the changes of dynamic objects can be selected from the image sequence collected by the camera, so that these images can be used more efficiently to filter out dynamic objects. Therefore, in some embodiments, other images in the plurality of images except the first image may be images whose differences from the first image exceed a preset threshold, or images that are separated from the first image by a specified frame. For example, the first image can be used as a reference. If the angle or displacement of a specified object in a certain frame of images in the image sequence and the angle or displacement of the object in the first image exceed a preset threshold, the image is acquired as one of the above-mentioned multiple images. For example, if the first image is the 5th frame of the image sequence, the other images are the 10th, 15th, 20th, and 25th frames in sequence. Wait.
在某些实施例中,由于在通过采集不同位姿的图像来滤除图像中的静态对象时,图像中的动态对象会对静态对象的滤除产生一定的干扰,导致不能很好的滤除静态对象,所以,在某些实施例中,在采用上述方法滤除静态对象之前,可以先滤除图像中的动态对象。In some embodiments, when the static objects in the image are filtered out by collecting images of different poses, the dynamic objects in the image will interfere with the filtering out of the static objects to a certain extent, resulting in an inability to filter out the static objects well. Static objects, therefore, in some embodiments, before using the above method to filter out static objects, dynamic objects in the image may be filtered out first.
此外,本申请还提供一种图像处理方法,该方法可以用于自动去除图像中的动态对象,所述方法如图12所示,包括以下步骤:In addition, the present application also provides an image processing method, which can be used to automatically remove dynamic objects in an image. The method is shown in FIG. 12 and includes the following steps:
S1202、确定第一图像中的待滤除动态对象对应的第一像素区块;S1202, determining the first pixel block corresponding to the dynamic object to be filtered out in the first image;
S1204、确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;S1204. Determine a pixel block whose pixel position of the first pixel block is located in a plurality of second images corresponding to pixel positions, and the plurality of second images and the first image are collected in the same pose by a camera device get;
S1206、从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;S1206, from the plurality of second images, determine that the pixel block of the corresponding pixel position is the third image of the static area;
S1208、利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。S1208. Replace the first pixel block in the first image with the pixel block corresponding to the pixel position in the third image.
本申请实施例的图像处理方法可以由采集第一图像和第二图像的摄像装置执行,该摄像装置可以是任一具有图像采集功能的设备,比如该摄像装置可以是摄像头,或者是设有摄像头的相机、手机、平板、笔记本电脑、智能穿戴设备等终端,也可以是设有摄像头的无人机、无人车等可移动平台。当然,在某些实施例中,本申请的图像处理方法也可以由与摄像装置 通信连接的其他设备执行,比如,可以是云端服务器,摄像装置采集到第一图像和第二图像后发送给云端服务器处理,当然,如果摄像装置为可移动平台,本申请的图像处理方法也可以由于与可移动平台通信连接的控制终端执行,本申请不做限制。The image processing method in this embodiment of the present application may be performed by a camera device that collects the first image and the second image, and the camera device may be any device with an image acquisition function. For example, the camera device may be a camera, or a camera equipped with a camera. Terminals such as cameras, mobile phones, tablets, laptops, smart wearable devices, etc., can also be mobile platforms such as drones and unmanned vehicles with cameras. Of course, in some embodiments, the image processing method of the present application can also be executed by other devices that are communicatively connected to the camera, for example, a cloud server, and the camera collects the first image and the second image and sends them to the cloud Server processing, of course, if the camera device is a movable platform, the image processing method of the present application can also be executed by a control terminal communicatively connected to the movable platform, which is not limited in the present application.
本申请实施例中的待滤除动态对象为用户期望从图像中去除的对象,待滤除动态对象可以由用户确定,也可以自行选择,待滤除动态对象可以是一个或者多个。The dynamic objects to be filtered out in the embodiments of the present application are objects that the user wishes to remove from the image. The dynamic objects to be filtered out may be determined by the user or selected by the user, and there may be one or more dynamic objects to be filtered out.
可以从摄像装置在某个固定的位姿连续采集的图像序列中选取第一图像,其中第一图像可以由用户自行选择,也可以由执行该图像处理方法的设备自动选择,比如自动从图像序列中选择清晰度、构图或者拍摄角度较好的图像作为第一图像。The first image can be selected from the image sequence continuously collected by the camera in a certain fixed pose, wherein the first image can be selected by the user, or can be automatically selected by the device executing the image processing method, such as automatically selecting from the image sequence. Select an image with better clarity, composition or shooting angle as the first image.
确定第一图像后,可以确定第一图像中的待滤除动态对象对应的第一像素区块,然后从图像序列中确定多帧第二图像,并从第二图像中确定第一像素区块所在像素位置的对应像素位置的像素区块为静态区域的第三图像(即对应像素位置的像素区块未被遮挡的图像),然后利用第三图像中第一像素区块的对应像素位置的像素区块替换第一图像中的第一像素区块,以去除动态对象。After determining the first image, it is possible to determine the first pixel block corresponding to the dynamic object to be filtered out in the first image, then determine multiple frames of second images from the image sequence, and determine the first pixel block from the second image The pixel block corresponding to the pixel position at the pixel position is the third image of the static area (that is, the image in which the pixel block corresponding to the pixel position is not occluded), and then the corresponding pixel position of the first pixel block in the third image is used. The pixel block replaces the first pixel block in the first image to remove dynamic objects.
由于图像序列中相邻两帧或多帧图像的差异可能比较小,可能动态对象在邻近帧的位置变化不大,因而,第一图像的相邻帧可能无法用于滤除待滤除动态对象,为了可以更加快速的筛选出可以用于滤除第一图像中的待滤除动态对象的图像帧,在某些实施例中,可以从图像序列选取一些与第一图像差异较大的图像作为第二图像,比如第二图像可以是与第一图像的差异超过预设阈值的图像,或者是与第一图像间隔指定帧的图像。比如,可以第一图像作为基准,如果图像序列中某帧图像中的某个对象的角度或者位移与第一图像中该对象的角度或者位移超过预设阈值,则获取该图像作为第二图像,也可以获取与第一图像间隔指定帧的图像,比如,第一图像为图像序列的第5帧,则第二图像依次为第10帧、第15帧、第20帧、 第25帧等。Since the difference between two or more adjacent frames of images in the image sequence may be relatively small, the position of the dynamic object may not change much in the adjacent frames. Therefore, the adjacent frames of the first image may not be used to filter out the dynamic object to be filtered out. , in order to filter out the image frames that can be used to filter out the dynamic objects to be filtered out in the first image more quickly, in some embodiments, some images that are quite different from the first image can be selected from the image sequence as The second image, for example, the second image may be an image whose difference from the first image exceeds a preset threshold, or an image that is spaced apart from the first image by a specified frame. For example, the first image can be used as a reference. If the angle or displacement of an object in a certain frame of images in the image sequence and the angle or displacement of the object in the first image exceed a preset threshold, the image is acquired as the second image, It is also possible to acquire images with a specified frame interval from the first image. For example, if the first image is the 5th frame of the image sequence, the second image is the 10th frame, the 15th frame, the 20th frame, and the 25th frame in sequence.
在某些实施例,确定第一图像中的动态对象对应的第一像素区块时,可以针对每一帧第二图像分别执行以下操作:计算第一图像各像素点相对于第二图像的光流向量,从第一图像的各像素点中确定光流向量的模长大于预设阈值的目标像素点,对目标像素点进行聚类处理,得到动态对象对应的第一像素区块。比如,可以计算第一图像各像素点与其邻近的一帧或多帧图像的光流向量,若像素点的光流向量模长大于一定阈值,则认为这个像素点是运动的,然后对判定为运动的像素点进行聚类处理,得到多个像素点集合,集合中像素点数量大于一定值的(数量太少可能是噪声可以忽略)区域则认为是动态对象。In some embodiments, when determining the first pixel block corresponding to the dynamic object in the first image, the following operations may be performed for each frame of the second image: calculating the light intensity of each pixel of the first image relative to the second image The flow vector is determined from each pixel point of the first image, and the target pixel point whose modulo length of the optical flow vector is greater than the preset threshold is subjected to clustering processing to obtain the first pixel block corresponding to the dynamic object. For example, the optical flow vector of each pixel of the first image and its adjacent one or more frames of images can be calculated. If the modulo length of the optical flow vector of the pixel is greater than a certain threshold, it is considered that the pixel is moving, and then it is determined as The moving pixels are clustered to obtain multiple sets of pixels, and the area where the number of pixels in the set is greater than a certain value (the number may be too small and the noise can be ignored) is considered to be a dynamic object.
在某些实施例中,利用第三图像中的对应像素位置的像素区块域替换第一图像中的第一像素区块时,可以确定这多张第二图像中的动态区域,针对每个第一像素区块,可以分别按照以下方式确定其对应的第三图像,按照第二图像与第一图像采集顺序由近及远的顺序,确定第一图像的动态对象所在像素位置在第二图像中的对应像素位置的像素区块,直至该对应像素位置的像素区块与动态区域不重叠,则将该第二图像作为第三图像。In some embodiments, when replacing the first pixel block in the first image with the pixel block field corresponding to the pixel position in the third image, the dynamic regions in the plurality of second images can be determined, and for each For the first pixel block, the corresponding third image can be determined in the following manner, and the pixel position of the dynamic object of the first image can be determined in the second image in the order of the second image and the first image acquisition sequence from near to far. until the pixel block corresponding to the pixel position does not overlap the dynamic area, the second image is regarded as the third image.
通过本申请实施例提供的方法,可以从摄像装置在同一位姿采集的多帧图像中确定一张基准图像(即第一图像),然后从基准图像确定待滤除的动态对象对应的第一像素区块,通过判定其他图像中第一像素区块所在像素位置的对应像素位置的像素区块是否为静态区域,可以快速地筛选出第一像素区块所在像素位置的对应像素位置的像素区块未被遮挡的图像,然后使用该图像的对应像素位置的像素区块替换第一图像中的第一像素区块,可以快速、高效地去除第一图像中的动态对象。With the method provided in this embodiment of the present application, a reference image (ie, the first image) can be determined from multiple frames of images collected by the camera in the same pose, and then the first image corresponding to the dynamic object to be filtered can be determined from the reference image. Pixel block, by determining whether the pixel block corresponding to the pixel position of the first pixel block in other images is a static area, the pixel area corresponding to the pixel position of the first pixel block can be quickly screened out. block the unoccluded image, and then replace the first pixel block in the first image with the pixel block corresponding to the pixel position of the image, which can quickly and efficiently remove the dynamic object in the first image.
为了进一步解释本申请实施提供的图像处理方法,以下结合一个具体的实施例加以解释。In order to further explain the image processing method provided by the implementation of this application, the following is explained with reference to a specific embodiment.
通常用户在拍摄图像或视频时,存在一些非目标拍摄对象也会在拍摄视角内,导致最后拍摄的图像存在一些非拍摄目标对象,遮挡了用户想要 拍摄的目标。因此,需要对这些非目标拍摄对象进行去除处理,以下提供一种去除图像中的非拍摄目标对象(即待滤除对象)的方法,其中,待滤对象可以动态对象,也可以是静态对象。以用户采用搭载了摄像头的无人机进行图像采集的场景为例,如图13所示,用户可以通过控制终端132控制无人机131上搭载的摄像装置133采集图像,无人机131可以将摄像装置133采集的图像回传给控制终端,以便显示给用户。滤除图像中的对象可以由控制终端执行,以下分别介绍动态对象和静态对象的滤除方法,由于动态对象会对静态对象的滤除造成一定的干扰,因而,可以先滤除动态对象,再滤除静态对象。Usually, when a user is shooting an image or video, some non-target objects will also be within the shooting angle of view, resulting in some non-target objects in the final captured image, obscuring the target the user wants to shoot. Therefore, it is necessary to remove these non-target shooting objects. The following provides a method for removing non-shooting target objects (ie, objects to be filtered) in an image, wherein the objects to be filtered can be dynamic objects or static objects. Taking the scene where the user uses a drone equipped with a camera to collect images as an example, as shown in FIG. 13 , the user can use the control terminal 132 to control the camera device 133 mounted on the drone 131 to collect images, and the drone 131 can capture images. The images collected by the camera 133 are sent back to the control terminal so as to be displayed to the user. Filtering out the objects in the image can be performed by the control terminal. The following describes the filtering methods of dynamic objects and static objects respectively. Since dynamic objects will cause certain interference to the filtering of static objects, the dynamic objects can be filtered out first, and then the dynamic objects can be filtered out. Filter out static objects.
滤除动态对象:Filter out dynamic objects:
1、可以控制摄像装置在某个固定位姿采集一系列的图像序列,然后由用户从图像序列筛选出一张基准图像I0,或者由控制终端自动从图像序列中筛选出基准图像I0。1. The camera can be controlled to collect a series of image sequences at a certain fixed pose, and then the user selects a reference image I0 from the image sequence, or the control terminal automatically selects the reference image I0 from the image sequence.
2、从图像序列中选取多帧关键帧,其中关键帧为与基准图像I0差异较大的图像帧,比如,可以是某个对象的角度或者位移与基准图像I0中该对象的角度或位移相差一定阈值的图像帧,或者与基准图像间隔指定帧的图像帧,比如基准图像I0为第K帧,关键帧可以是与第K帧间隔5、10、15、20的图像帧。2. Select multiple key frames from the image sequence, wherein the key frame is an image frame with a large difference from the reference image I0, for example, the angle or displacement of an object may be different from the angle or displacement of the object in the reference image I0 An image frame with a certain threshold, or an image frame with a specified frame interval from the reference image. For example, the reference image I0 is the Kth frame, and the key frame can be an image frame with an interval of 5, 10, 15, and 20 from the Kth frame.
3、分别计算基准图像I0中各像素点与筛选出来的其余关键帧的光流向量,若单个像素的光流向量模长大于一定阈值,则认为这个像素在不同时刻发生了变化,即为运动的,将判定为运动的像素点进行聚类处理,得到多个像素点结合,集合中像素点大于一定值,则认为集合中像素点对应的区域是运动物体。3. Calculate the optical flow vector of each pixel in the reference image I0 and the remaining key frames selected separately. If the optical flow vector modulo length of a single pixel is greater than a certain threshold, it is considered that the pixel has changed at different times, that is, motion If the pixels determined to be moving are clustered, a combination of multiple pixels is obtained. If the pixels in the set are greater than a certain value, the area corresponding to the pixels in the set is considered to be a moving object.
4、其余的关键帧也分别和自身前后的两帧(也可以是多帧)关键帧计算光流向量,判定出各关键帧的动态区域与静态区域。4. The remaining key frames also calculate the optical flow vector with the two frames (or multiple frames) before and after itself, respectively, and determine the dynamic area and the static area of each key frame.
5、从第k0帧(即基准图像I0)最近的关键帧开始找可以填补k0帧的动态对象的关键帧,可以通过判定第k0帧的每个动态对象在该帧的对应 区域是否是静态区域确定。如图14所示,图中三角形、正方形以及圆形区域表示动态区域,其余区域为静态区域,比如,针对第k0帧的圆形动态区域,首先确定该圆形区域在第k-1帧中的对应区域,如图中的圆形虚线区域,该区域为静态区域,所以可以使用第k-1帧来填补第k0帧的圆形动态区域。同理,剩余的三角形动态区域与正方形动态区域则需要分别通过第k-5帧,与第k7帧来填补。5. Start from the nearest key frame of the k0th frame (that is, the reference image I0) to find the keyframes that can fill the dynamic objects of the k0th frame. You can determine whether each dynamic object of the k0th frame is a static area in the corresponding area of the frame. Sure. As shown in Figure 14, the triangle, square and circular areas in the figure represent dynamic areas, and the rest of the areas are static areas. For example, for the circular dynamic area of the k0th frame, first determine that the circular area is in the k-1th frame The corresponding area of , such as the circular dotted area in the figure, is a static area, so the k-1th frame can be used to fill the circular dynamic area of the k0th frame. Similarly, the remaining triangular dynamic areas and square dynamic areas need to be filled by the k-5th frame and the k7th frame respectively.
6、确定出可以用于填补第k0帧的每个动态对象的关键帧后,可以使用每个动态对象在关键帧的对应区域来替换k0帧的动态对象,从而达到滤除动态对象的目的。6. After determining the key frame that can be used to fill each dynamic object of the k0th frame, each dynamic object can be used to replace the dynamic object of the k0 frame in the corresponding area of the key frame, so as to achieve the purpose of filtering out the dynamic object.
滤除静态对象Filter out static objects
7、确定待滤除对象对应的像素区域以及被遮挡的背景对应的像素区域。7. Determine the pixel area corresponding to the object to be filtered out and the pixel area corresponding to the occluded background.
可以在基准图像I0中确定待滤除的静态对象,可以由控制终端自动识别,也可以用户在交互界面框选确定。如图15所示,用户可以在基准图像I0中框选待滤除静态对象(如图(1)),由于用户框选的选框不太准确,因而可以自动对选框进行调整,比如对基准图像I0进行超像素分割处理,得到多个图像区域,然后判定每个区域落入选框中的部分与图像区域的比例,比例大于一定值则将该图像区域划入选框内,否则划入选框外。通过上述方式调整后的选框如图(2)所示。自动调整得到比较精准的选框后,可以再适当扩大一些选框,比如扩大5%,保证静态对象完全在选框中,同时也会有一些背景落在选框内,这个背景就是我们需要补全的部分,如图中(3)所示。可以在此基础上再扩展一部分,得到背景区域,如图(4)所示的回形区域。The static object to be filtered out can be determined in the reference image I0, which can be automatically recognized by the control terminal, or can be determined by the user by frame selection on the interactive interface. As shown in Figure 15, the user can select the static object to be filtered out in the reference image I0 (as shown in Figure (1)). Since the frame selected by the user is not very accurate, the selection frame can be adjusted automatically, such as The benchmark image I0 is subjected to superpixel segmentation to obtain multiple image areas, and then the ratio of the part of each area that falls into the selected frame to the image area is determined. outside the box. The frame adjusted by the above method is shown in Figure (2). After automatic adjustment to get a more accurate marquee, you can appropriately expand some marquees, such as 5%, to ensure that the static objects are completely in the marquee, and there will also be some backgrounds in the marquee. This background is what we need to make up for. The complete part is shown in (3) in the figure. On this basis, a part can be extended to obtain the background area, such as the trapezoidal area shown in Figure (4).
8、确定静态对象和背景区域的深度距离。8. Determine the depth distance between static objects and background areas.
针对上一步检测出的静态对象对应的像素区域和背景区域对应的像素区域,可以提取特征点,并做多帧图像之间的特征点跟踪匹配,以及前后帧的特征点跟踪匹配,确定静态对象的深度距离以及背景区域的深度距离。 具体如下:For the pixel area corresponding to the static object detected in the previous step and the pixel area corresponding to the background area, feature points can be extracted, and feature point tracking and matching between multiple frames of images, as well as feature point tracking and matching of the previous and subsequent frames, can be used to determine the static object. and the depth distance of the background area. details as follows:
(1)特征点提取(1) Feature point extraction
根据框选出的静态对象,在基准图像上静态对象的对应区域进行特征点提取,特征点提取可以采用通用的算法,比如Harris算法、SIFT算法、SURF算法、ORB算法等。According to the static object selected by the frame, feature point extraction is performed on the corresponding area of the static object on the reference image. The feature point extraction can use a general algorithm, such as Harris algorithm, SIFT algorithm, SURF algorithm, ORB algorithm, etc.
为了减少计算量,可以采用sparse的方法,先提取图像的特征点,一般可以选用角点(Corner detection)作为特征点,可选的角点检测算法Corner Detection Algorithm有:FAST(features from accelerated segment test)、SUSAN、以及Harris operator等,以下以使用Harris Corner Detection Algorithms算法为例:In order to reduce the amount of calculation, the sparse method can be used to first extract the feature points of the image. Generally, the corner points (Corner detection) can be selected as the feature points. The optional corner detection algorithms Corner Detection Algorithm are: FAST (features from accelerated segment test ), SUSAN, and Harris operator, etc. The following is an example of using the Harris Corner Detection Algorithms algorithm:
定义矩阵A为构造张量,如公式(3)Define matrix A as a construction tensor, such as formula (3)
其中Ix和Iy分别为图像上某一点在x和y方向上的梯度信息,可以定义函数Mc如下公式(4):where Ix and Iy are the gradient information of a certain point on the image in the x and y directions, respectively, and the function Mc can be defined as the following formula (4):
M
c=λ
1λ
2-κ(λ
1+λ
2)
2=det(A)-κ trace
2(A) 公式(4)
M c =λ 1 λ 2 -κ(λ 1 +λ 2 ) 2 =det(A)-κ trace 2 (A) Equation (4)
其中det(A)为矩阵A的行列式,trace(A)为矩阵A的迹,κ为调节灵敏度的参数,设定阈值为Mth,当Mc>Mth时,可以认为此点为特征点。where det(A) is the determinant of matrix A, trace(A) is the trace of matrix A, κ is the parameter to adjust the sensitivity, and the set threshold is Mth. When Mc>Mth, this point can be considered as a feature point.
(2)KLT(Kanade–Lucas–Tomasi feature tracker)特征点跟踪匹配算法(2) KLT (Kanade–Lucas–Tomasi feature tracker) feature point tracking and matching algorithm
可以跟踪多帧图像之间的特征点,以便计算其移动情况(光流),可以取h作为前后两幅图的偏移量,前一图像为F(x),后一图像为G(x)=F(x+h)The feature points between multiple frames of images can be tracked in order to calculate their movement (optical flow), and h can be taken as the offset of the two images before and after, the former image is F(x), and the latter image is G(x) )=F(x+h)
针对每个特征点,通过公式(5)迭代可以得到特征点在前后图像帧的位移h,For each feature point, the displacement h of the feature point before and after the image frame can be obtained through the iteration of formula (5),
为了确保结果的可靠性,可以先令后一张图像为F(x),前一张图像为G(x),算出某一个特征点,在后一张图像相对于前一张的偏移h,再反过来,计算改特征点,在前一张图像相对于后一张的偏移h’,理论上h=-h’,满足此条件方可说明跟踪的点正确,其中,h即为光流向量h=(Δu,Δv)。In order to ensure the reliability of the results, the latter image can be set as F(x) and the former image as G(x), and a certain feature point can be calculated, and the offset h of the latter image relative to the previous one can be calculated. , and then in turn, calculate and change the feature points, the offset h' of the previous image relative to the next image, theoretically h=-h', and this condition can be satisfied to indicate that the tracked point is correct, where h is Optical flow vector h=(Δu,Δv).
(3)更新特征点(3) Update feature points
跟踪过程中,由于视角变化,有些特征点不再能够观测到,有些特征点是新增加进来的,因此,可以不断更新特征点。During the tracking process, due to the change of viewing angle, some feature points can no longer be observed, and some feature points are newly added. Therefore, the feature points can be updated continuously.
(4)计算静态对象的中心的位置(4) Calculate the position of the center of the static object
由于静态对象中心不一定有特征点。所以针对静态对象的中心,需要采用拟合的光流向量确定静态对象的中心在各图像中的位置,以便能进行BA算法求取静态对象中心的三维坐标。Because the center of static objects does not necessarily have feature points. Therefore, for the center of the static object, it is necessary to use the fitted optical flow vector to determine the position of the center of the static object in each image, so that the BA algorithm can be used to obtain the three-dimensional coordinates of the center of the static object.
可以通过从图像中框选的静态对象的对应区域内的其他特征点的光流向量来估算静态对象的中心点。具体如公式(6):The center point of the static object can be estimated from the optical flow vectors of other feature points within the corresponding region of the static object framed in the image. Specifically as formula (6):
x
0=∑
nw
ix
i 公式(6)
x 0 =∑ n w i x i Formula (6)
x
i为框内的特征点的光流向量,w
i是权重,可以根据特征点与中心点的2D图像位置来确定权重,具体如公式(7):
x i is the optical flow vector of the feature points in the frame, w i is the weight, which can be determined according to the 2D image position of the feature point and the center point, as shown in formula (7):
其中,σ根据经验调节,是可调参数,d
i表示特征点i到中线点的距离
(u
i,v
i)表示特征点i的2D图像像素坐标,(u
0,v
0)是目标框中心点的2D图像像素坐标。
Among them, σ is adjusted according to experience and is an adjustable parameter, and d i represents the distance from the feature point i to the midline point (u i , v i ) represents the 2D image pixel coordinates of the feature point i, and (u 0 , v 0 ) represents the 2D image pixel coordinates of the center point of the target frame.
通过上述步骤(1)-(4),可以计算静态对象中心的视差与光流,得到静态对象中心的三维深度信息。Through the above steps (1)-(4), the disparity and optical flow of the center of the static object can be calculated, and the three-dimensional depth information of the center of the static object can be obtained.
采用类似方法,可以计算背景区域的三维深度信息。In a similar way, the 3D depth information of the background region can be calculated.
9、确定可以观测到背景区域时摄像装置的位姿。9. Determine the pose of the camera when the background area can be observed.
可以参考图6,假设摄像装置采基准图像I0时位于“位置1”,摄像装置可以观测到全部的被遮挡区域的视角,可以通过从“位置1”进行平移变换到达“位置2”。其中d1,d2上是一步求得的静态对象的深度距离与背景区域的深度距离。根据静态对象在图像中的尺寸以及静态对象的深度距离可以就出静态对象的最大宽度L。从“位置1”移动到“位置2”的移动距离D可以通过公式(1)求解:Referring to FIG. 6 , assuming that the camera is located at "position 1" when taking the reference image I0, the camera can observe the viewing angle of all the occluded areas, and can reach "position 2" by performing translation transformation from "position 1". Among them, d1 and d2 are the depth distance of the static object obtained in one step and the depth distance of the background area. The maximum width L of the static object can be determined according to the size of the static object in the image and the depth distance of the static object. The moving distance D from "position 1" to "position 2" can be solved by formula (1):
从上述公式(1),当静态对象与背景区域非常接近的时候,即d2≈d1时,D会接近无穷远,所以当静态对象与背景区域距离太近,则无法滤除静态对象,这时可以向用户发出无法滤出的提示信息。From the above formula (1), when the static object is very close to the background area, that is, when d2≈d1, D will be close to infinity, so when the distance between the static object and the background area is too close, the static object cannot be filtered out, then It is possible to issue a prompt message to the user that cannot be filtered out.
图6中示意的是无人机往右飞行,所以能看到全部被遮挡的背景区域的极限位置是被遮挡的背景区域的左边缘刚好被观测到。当然无人机也可以往左飞,相应的极限视角就是刚好看到被遮挡的背景区域的右边缘。确定平移距离D后,可以同时调整相机朝向,把待滤除对象对应的像素区域的右边缘居中即可。通过上述方法即可完成了相机位姿的调整,达到了调整视角的目的。Figure 6 shows that the drone is flying to the right, so the limit position where all the occluded background areas can be seen is that the left edge of the occluded background area is just observed. Of course, the drone can also fly to the left, and the corresponding limit viewing angle is to just see the right edge of the occluded background area. After the translation distance D is determined, the camera orientation can be adjusted at the same time, and the right edge of the pixel area corresponding to the object to be filtered can be centered. Through the above method, the adjustment of the camera pose can be completed, and the purpose of adjusting the viewing angle is achieved.
10、计算单应性矩阵H10. Calculate the homography matrix H
上一步确定了可以观测到被遮挡的背景区域的位姿,可以自动控制无人机调整到该位姿,在该位姿拍摄得到图像In。In the previous step, the pose where the occluded background area can be observed is determined, and the drone can be automatically controlled to adjust to the pose, and the image In can be obtained by shooting at this pose.
可以从基准图像I0中的背景区域对应的像素区域提取特征点,并在图像In做特征点匹配,得到匹配点队列。根据特征点和匹配点确定单应性矩阵H:Feature points can be extracted from the pixel region corresponding to the background region in the reference image I0, and feature point matching can be performed in the image In to obtain a matching point queue. Determine the homography matrix H according to the feature points and matching points:
H矩阵表示摄像装置在不同位姿采集的两幅图像上,匹配的两个像素点之间映射关系,具体如公式(8):The H matrix represents the mapping relationship between two matched pixels on two images collected by the camera at different poses, as shown in formula (8):
x
0=Hx
n 公式(8)
x 0 =Hx n Formula (8)
x
0是图像I0背景区域上的一个特征点,x
n是图像In中与x
0匹配的点。用H矩阵表示两点之间的映射关系实际需要这些像素点在空间中的同一平面上。当摄像装置距离拍摄目标比较远的时候,就可以把背景区域看成平面来处理。所以当d1比较小的时候(比如小于100m),也要提示用户,滤除效果较差或无法滤除。
x 0 is a feature point on the background region of image I0, and x n is the point in image In that matches x 0 . Using the H matrix to represent the mapping relationship between two points actually requires these pixels to be on the same plane in space. When the camera device is far away from the shooting target, the background area can be treated as a plane. Therefore, when d1 is relatively small (for example, less than 100m), the user should also be reminded that the filtering effect is poor or cannot be filtered.
或者将背景上的三维点(特征点求取了深度信息,即可转化为三维信息)拟合平面,拟合平面时用的容忍参数(即凹凸不平的最大程度)可以根据背景的深度来取(比如去背景深度的2%),如果不能拟合平面,提示用户,滤除效果较差或无法滤除。H矩阵有8个未知数,至少需要4对点就能算。Or fit the three-dimensional points on the background (the feature points can be converted into three-dimensional information after obtaining the depth information) to the plane, and the tolerance parameter (that is, the maximum degree of unevenness) used in fitting the plane can be selected according to the depth of the background. (such as removing 2% of the background depth), if the plane cannot be fitted, the user will be prompted that the filtering effect is poor or cannot be filtered. The H matrix has 8 unknowns and requires at least 4 pairs of points to calculate.
可以采用RANSAC(Random sample consensus,随机抽样一致)算法,有效滤除匹配度较差的特征点和匹配点,进一步提高结果的有效性,得到更加精准的H矩阵。The RANSAC (Random sample consensus) algorithm can be used to effectively filter out feature points and matching points with poor matching degree, further improve the effectiveness of the results, and obtain a more accurate H matrix.
11、利用图像In填补图像I0中被遮挡的背景区域,以滤除静态对象。11. Fill the occluded background area in image I0 with image In to filter out static objects.
如图16所示,通过上一步骤确定的单应性矩阵H,可以将图像In全部按照H矩阵投影到图像I0对应的摄像装置的位姿(camera pose)上,得到图像In’,然后将图像In’中的待滤除对象对应的像素区域,替换覆盖图像I0对应的区域,即可实现静态对象的移除。As shown in Figure 16, through the homography matrix H determined in the previous step, the image In can be all projected onto the camera pose (camera pose) of the camera corresponding to the image I0 according to the H matrix to obtain the image In', and then the The pixel area corresponding to the object to be filtered out in the image In' is replaced by the area corresponding to the coverage image I0, and the static object can be removed.
此外,本申请还提供了一种图像处理装置,如图17所示,所述图像处理装置包括处理器171、存储器172、存储于所述存储器172所述处理器171可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:In addition, the present application also provides an image processing apparatus. As shown in FIG. 17 , the image processing apparatus includes a processor 171 , a memory 172 , and a computer program stored in the memory 172 and executable by the processor 171 . When the processor executes the computer program, the following steps are implemented:
获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;
获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤 除对象遮挡的对象;Obtain a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;
通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。The first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
在某些实施例中,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:In some embodiments, when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
确定所述第二位姿;determining the second pose;
控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。The camera is controlled to move to adjust to the second pose and capture the second image.
在某些实施例中,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:In some embodiments, when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
确定所述第二位姿;determining the second pose;
向用户发出指示所述第二位姿的提示信息,以使所述用户根据所述提示信息控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。Sending prompt information indicating the second pose to the user, so that the user controls the camera to move according to the prompt information to adjust to the second pose and capture the second image.
在某些实施例中,所述处理器用于确定所述第二位姿时,具体用于:In some embodiments, when the processor is configured to determine the second pose, it is specifically configured to:
获取所述待滤除对象的位置信息以及所述目标对象的位置信息;Obtain the location information of the object to be filtered and the location information of the target object;
根据所述述待滤除对象的位置信息以及所述目标对象的位置信息确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered and the position information of the target object.
在某些实施例中,所述处理器用于根据所述待滤除对象的位置信息以及所述目标对象的位置信息确定所述第二位姿,具体用于:In some embodiments, the processor is configured to determine the second pose according to the position information of the object to be filtered and the position information of the target object, and is specifically configured to:
根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered.
在某些实施例中,所述第一位姿包括第一位置和第一朝向,所述第二位姿包括第二位置和第二朝向;In some embodiments, the first pose includes a first position and a first orientation, and the second pose includes a second position and a second orientation;
所述第二位置位于经过所述第一位置且所述待滤除对象所在平面平行的直线上,第二朝向指向所述待滤除对象所在的位置。The second position is located on a straight line passing through the first position and parallel to the plane where the object to be filtered is located, and the second orientation points to the position where the object to be filtered is located.
在某些实施例中,所述第二位置通过以下方式确定:In certain embodiments, the second location is determined by:
根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述 待滤除对象的尺寸确定移动距离;Determine the moving distance according to the position information of the object to be filtered, the position information of the target object and the size of the object to be filtered;
根据所述第一位置和所述移动距离确定所述第二位置。The second position is determined according to the first position and the moving distance.
在某些实施例中,所述第二朝向通过以下方式确定:In some embodiments, the second orientation is determined by:
根据所述第一位置以及所述待滤除对象在所述摄像装置采集的图像画面中的位置确定所述第二朝向;或Determine the second orientation according to the first position and the position of the object to be filtered out in the image frame captured by the camera; or
根据所述第一位置、所述待滤除对象左右端点的位置以及所述目标对象左右端点的位置确定所述第二朝向。The second orientation is determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object.
在某些实施例中,所述第二位姿包括第二位置和第二朝向,所述处理器用于向用户发出指示所述第二位姿的提示信息,时,具体用于:In some embodiments, the second posture includes a second position and a second orientation, and the processor is configured to send prompt information indicating the second posture to the user, when, specifically:
向用户展示标识有所述第二位置的图像,以及展示调整至所述第二朝向对应的旋转角度信息。The image marked with the second position is displayed to the user, and the rotation angle information corresponding to the second orientation is displayed.
在某些实施例中,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:In some embodiments, when the processor is configured to acquire the second image captured by the camera in the second pose, the processor is specifically configured to:
控制所述摄像装置运动以改变所述摄像装置的位姿并采集得到多帧图像,针对每一帧图像,判断所述图像中是否包括所述第二像素区块;Controlling the motion of the camera to change the pose of the camera and collecting multiple frames of images, and for each frame of image, determine whether the second pixel block is included in the image;
将包括所述第二像素区块的图像作为所述第二图像。An image including the second pixel block is used as the second image.
在某些实施例中,所述处理器用于判断所述图像中是否包括所述第二像素区块时,具体用于:In some embodiments, when the processor is configured to determine whether the image includes the second pixel block, it is specifically configured to:
在所述第一像素区块中确定第一特征点,以及所述第一像素区块的周边区域确定第二特征点;determining a first feature point in the first pixel block, and determining a second feature point in a peripheral area of the first pixel block;
针对每一帧所述图像,确定所述第一特征点在所述图像中的第一匹配点,以及所述第二特征点在所述图像中的第二匹配点;For each frame of the image, determine a first matching point of the first feature point in the image, and a second matching point of the second feature point in the image;
根据所述第一匹配点和所述第二匹配点的在图像中的位置关系确定所述图像是否包括所述第二像素区块。Whether the image includes the second pixel block is determined according to the positional relationship between the first matching point and the second matching point in the image.
在某些实施例中,所述第一特征点位于所述第一像素区块第一侧之内,所述第二特征点位于所述第一像素区块第二侧之外,其中,所述第一侧为所述第二侧的对侧;In some embodiments, the first feature point is located within a first side of the first pixel block, and the second feature point is located outside a second side of the first pixel block, wherein the the first side is the opposite side of the second side;
所述处理器用于根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块时,具体用于:When the processor is used to determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point, it is specifically used for:
当判定所述第二匹配点位于所述第一匹配点的第一侧时,判定所述图像包括所述第二像素区块。When it is determined that the second matching point is located on the first side of the first matching point, it is determined that the image includes the second pixel block.
在某些实施例中,多个所述第二特征点位于环绕所述第一像素区域的环状像素区块中,所述处理器用于根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块时,具体用于:In some embodiments, a plurality of the second feature points are located in a ring-shaped pixel block surrounding the first pixel area, and the processor is configured to determine the first matching point and the second matching point according to the first matching point and the second matching point. When determining whether the image includes the second pixel block, it is specifically used for:
当多个所述第二匹配点中预设数量的所述第二匹配点位于所述第一匹配点的一侧时,则判定所述第二图像中包括所述第二像素区块。When a preset number of the second matching points among the plurality of second matching points are located on one side of the first matching point, it is determined that the second pixel block is included in the second image.
在某些实施例中,所述摄像装置搭载于可移动平台,所述处理器用于控制所述摄像装置运动时,具体用于:In some embodiments, the camera device is mounted on a movable platform, and the processor is used to control the movement of the camera device, specifically:
控制所述可移动平台运动以控制所述摄像装置运动。Movement of the movable platform is controlled to control movement of the camera.
在某些实施例中,所述摄像装置通过云台搭载于可移动平台,所述处理器用于控制所述摄像装置运动时,具体用于:In some embodiments, the camera device is mounted on a movable platform through a pan/tilt, and the processor is used to control the movement of the camera device, specifically:
控制所述可移动平台运动,和/或,控制所述云台使所述摄像装置与所述可移动平台之间产生相对运动,以控制所述摄像装置运动。The movable platform is controlled to move, and/or the pan/tilt is controlled to generate relative motion between the camera and the movable platform, so as to control the camera to move.
在某些实施例中,所述摄像装置通过云台搭载于可移动平台,所述第二位姿包括第二位置和第二朝向,所述处理器用于控制所述摄像装置运动以使所述摄像装置调整至所述第二位姿时,具体用于:In some embodiments, the camera device is mounted on the movable platform through a pan/tilt head, the second pose includes a second position and a second orientation, and the processor is configured to control the camera device to move so as to make the camera device move. When the camera device is adjusted to the second pose, it is specifically used for:
控制所述可移动平台运动,以使所述摄像装置位于所述第二位置;以及控制所述云台转动,以使所述摄像装置的朝向调整至所述第二朝向。The movable platform is controlled to move so that the camera is located at the second position; and the pan-tilt is controlled to rotate so that the orientation of the camera is adjusted to the second orientation.
在某些实施例中,所述可移动平台包括无人机、无人车、无人船中的任一种。In some embodiments, the movable platform includes any one of an unmanned aerial vehicle, an unmanned vehicle, and an unmanned boat.
在某些实施例中,所述处理器用于在所述第一图像中确定待滤除对象对应的第一像素区块时,具体用于:In some embodiments, when the processor is configured to determine the first pixel block corresponding to the object to be filtered out in the first image, it is specifically configured to:
响应于用户的指令,从所述第一图像中确定待滤除对象对应的第一像素区块。In response to the user's instruction, the first pixel block corresponding to the object to be filtered out is determined from the first image.
在某些实施例中,所述指令包括用户通过人机交互界面输入的选框,所述选框用于框选所述静态目标对象。In some embodiments, the instruction includes a check box input by the user through a human-computer interaction interface, and the check box is used to frame the static target object.
在某些实施例中,所述第一像素区块为所述选框框选的像素区块,所述装置还用于:In some embodiments, the first pixel block is a pixel block selected by the marquee, and the device is further configured to:
对所述第一图像进行超像素分割处理,得到多个图像区域,基于所述多个图像区域调整所述选框框选的像素区块。Perform superpixel segmentation processing on the first image to obtain multiple image areas, and adjust the pixel blocks selected by the frame selection based on the multiple image areas.
在某些实施例中,所述处理器基于所述多个图像区域调整所述选框框选的像素区块时,具体用于:In some embodiments, when the processor adjusts the pixel blocks selected by the frame based on the plurality of image regions, the processor is specifically configured to:
根据所述多个图像区域中各图像区域落入所述选框的部分与各图像区域的占比调整所述选框框选的像素区块。The pixel block selected by the frame is adjusted according to the ratio of the portion of each image area that falls within the frame and each image area in the plurality of image areas.
在某些实施例中,所述装置还用于:In certain embodiments, the apparatus is also used to:
当预设第一条件触发后,向用户发出无法滤除所述待滤除对象的提示信息。When the preset first condition is triggered, a prompt message that the object to be filtered out cannot be filtered out is sent to the user.
在某些实施例中,所述预设第一条件包括以下一种或多种:In some embodiments, the preset first condition includes one or more of the following:
所述待滤除对象与所述目标对象的第一距离小于第一预设阈值;The first distance between the object to be filtered and the target object is less than a first preset threshold;
或所述目标对象的与所述摄像装置的第二距离小于第二预设阈值;or the second distance between the target object and the camera device is less than a second preset threshold;
或,所述第一距离与所述第二距离之间的距离大小关系不满足预设第二条件。Or, the distance magnitude relationship between the first distance and the second distance does not satisfy a preset second condition.
在某些实施例中,所述装置还用于:In certain embodiments, the apparatus is also used to:
在所述第二图像中确定所述第二像素区块。The second pixel block is determined in the second image.
在某些实施例中,所述处理器用于在所述第二图像中确定所述第二像素区块时,具体用于:In some embodiments, when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:
确定所述第一图像的像素点与所述第二图像的像素点之间的映射关系;determining the mapping relationship between the pixels of the first image and the pixels of the second image;
根据所述映射关系确定所述第一像素区块在所述第二图像的映射区域,作为所述第二像素区块。The mapping area of the first pixel block in the second image is determined according to the mapping relationship as the second pixel block.
在某些实施例中,所述处理器用于确定所述第一图像的像素点与所述 第二图像的像素点之间的映射关系时,具体用于:In some embodiments, when the processor is configured to determine the mapping relationship between the pixels of the first image and the pixels of the second image, it is specifically configured to:
在所述第一像素区块的周边区域提取第三特征点,并在所述第二图像中确定所述第三特征点的第三匹配点;Extract the third feature point in the peripheral area of the first pixel block, and determine the third matching point of the third feature point in the second image;
基于所述第三特征点和所述第三匹配点确定所述映射关系。The mapping relationship is determined based on the third feature point and the third matching point.
在某些实施例中,所述处理器用于在所述第二图像中确定所述第二像素区块时,具体用于:In some embodiments, when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:
在所述第一图像中确定一环绕所述第一像素区块的环状像素区块;determining a ring-shaped pixel block surrounding the first pixel block in the first image;
在所述第二图像中确定与所述环状像素区块相匹配的匹配环状区块;determining a matching ring-shaped block that matches the ring-shaped pixel block in the second image;
将述第二图像中所述匹配环状区块包围的像素区块作为所述第二像素区块。A pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
在某些实施例中,所述处理器用于获取摄像装置在第一位姿采集的第一图像时,具体用于:In some embodiments, when the processor is configured to acquire the first image captured by the camera in the first pose, the processor is specifically configured to:
获取摄像装置在第一位姿采集的多张图像;acquiring multiple images collected by the camera device in the first pose;
在所述多张图像中确定所述第一图像。The first image is determined among the plurality of images.
在某些实施例中,所述处理器用于在所述第一图像中确定待滤除对象对应的第一像素区块之前,还用于:In some embodiments, before the processor is configured to determine the first pixel block corresponding to the object to be filtered out in the first image, the processor is further configured to:
通过所述多张图像确定所述待滤除对象的类别信息,所述类别信息用于标识所述待滤除对象为动态对象或静态对象;Determine the category information of the object to be filtered out by using the plurality of images, where the category information is used to identify the object to be filtered out as a dynamic object or a static object;
若所述待滤除对象为静态对象,则执行所述在所述第一图像中确定待滤除对象对应的第一像素区块,获取所述摄像装置在第二位姿采集的包括第二像素区块的第二图像,并通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像的步骤。If the object to be filtered out is a static object, then the determining of the first pixel block corresponding to the object to be filtered out in the first image is performed, and the acquisition of the image data collected by the camera in the second pose including the second pixel block is performed. The second image of the pixel block, and the step of replacing the first pixel block in the first image with the second pixel block to generate the replaced first image.
在某些实施例中,所述装置还用于:In certain embodiments, the apparatus is also used to:
若所述待滤除对象为动态对象,则执行以下步骤:If the object to be filtered is a dynamic object, perform the following steps:
确定待滤除对象在所述第一图像中对应的第三像素区块;Determine the third pixel block corresponding to the object to be filtered out in the first image;
确定所述第三像素区域所在像素位置在所述多张图像中除所述第一图像外的其他图像中对应像素位置上的第四像素区块;Determine the fourth pixel block on the corresponding pixel position in the other images except the first image in the plurality of images at the pixel position of the third pixel area;
从所述其他图像中确定所述第四像素区块为静态区域的第三图像;Determine from the other images that the fourth pixel block is the third image of the static area;
利用所述第三图像中的所述第四像素区块替换所述第一图像中的所述第三像素区块。The third pixel block in the first image is replaced with the fourth pixel block in the third image.
在某些实施例中,所述处理器用于通过所述多张图像确定所述待滤除对象的所述类别时,具体用于:In some embodiments, when the processor is configured to determine the category of the object to be filtered out from the plurality of images, the processor is specifically configured to:
根据所述待滤除对象的各像素点相对于所述多张图像中除所述第一图像外的其他图像的光流确定所述待滤除对象的类别信息。The category information of the object to be filtered out is determined according to the optical flow of each pixel of the object to be filtered out relative to other images in the plurality of images except the first image.
在某些实施例中,所述处理器用于从所述其他图像中确定所述第四像素区块为静态区域的第三图像时,具体用于:In some embodiments, when the processor is configured to determine from the other images that the fourth pixel block is the third image of the static area, the processor is specifically configured to:
确定所述其他图像中的动态区域;determining dynamic regions in said other images;
针对每个所述待滤除对象,执行以下步骤:For each object to be filtered out, perform the following steps:
按照所述其他图像与所述第一图像采集顺序由近及远的顺序,确定所述第三像素区块所在像素位置在所述其他图像中的对应像素位置的像素区块,直至所述对应像素位置的像素区块与所述动态区域不重叠,则将所述其他图像作为所述第三图像。According to the order of acquisition of the other images and the first image from near to far, determine the pixel block of the corresponding pixel position in the other image where the pixel position of the third pixel block is located, until the corresponding pixel position If the pixel block of the pixel position does not overlap with the dynamic area, the other image is used as the third image.
在某些实施例中,所述其他与所述第一图像的差异超过预设阈值;或In some embodiments, the other difference from the first image exceeds a preset threshold; or
所述其他图像为与所述第一图像间隔指定帧的图像。The other images are images spaced apart from the first image by a specified frame.
其中,所述图像处理装置进行图像处理的具体细节参考上述图像处理方法中各实施例的描述,在此不再赘述。The specific details of the image processing performed by the image processing apparatus refer to the descriptions of the embodiments in the above-mentioned image processing method, which will not be repeated here.
进一步的,本申请还提供了另一种图像处理装置,所述图像处理装置包括处理器、存储器、存储于所述存储器所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:Further, the present application also provides another image processing apparatus, the image processing apparatus includes a processor, a memory, a computer program stored in the memory and executable by the processor, and the processor executes the computer program , implement the following steps:
确定第一图像中的动态对象对应的第一像素区块;Determine the first pixel block corresponding to the dynamic object in the first image;
确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;Determine the pixel block of the pixel position of the first pixel block corresponding to the pixel position in a plurality of second images, and the plurality of second images and the first image are collected in the same pose by a camera;
从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域 的第三图像;From the plurality of second images, determine that the pixel block of the corresponding pixel position is the third image of the static area;
利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。The first pixel block in the first image is replaced with a pixel block at the corresponding pixel position in the third image.
在某些实施例中,所述处理器用于确定所述第一图像中的动态对象对应的第一像素区块时,具体用于:In some embodiments, when the processor is used to determine the first pixel block corresponding to the dynamic object in the first image, it is specifically used to:
针对所述每一帧所述第二图像执行以下操作:Do the following for each frame of the second image:
计算所述第一图像各像素点相对于所述第二图像的光流;calculating the optical flow of each pixel of the first image relative to the second image;
从所述第一图像各像素点确定所述光流的模长大于预设阈值的目标像素点;Determine, from each pixel of the first image, a target pixel whose modulo length of the optical flow is greater than a preset threshold;
对所述目标像素点进行聚类处理,得到所述动态对象对应的第一像素区块。The target pixel points are clustered to obtain the first pixel block corresponding to the dynamic object.
在某些实施例中,所述处理器用于从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;具体用于:In some embodiments, the processor is configured to determine from the plurality of second images that the pixel block corresponding to the pixel position is the third image of the static area; specifically:
确定所述多张第二图像中的动态区域;determining dynamic regions in the plurality of second images;
针对每个所述第一像素区块,执行以下步骤:For each of the first pixel blocks, the following steps are performed:
按照所述第二图像与所述第一图像采集顺序由近及远的顺序,确定所述第一像素区块所在的像素位置在所述第二图像中的对应像素位置的像素区块,直至所述对应像素位置的像素区块与所述动态区域不重叠,则将所述第二图像作为所述第三图像。According to the second image and the first image acquisition sequence from near to far, determine the pixel block where the pixel position of the first pixel block is located in the corresponding pixel position in the second image, until If the pixel block corresponding to the pixel position does not overlap with the dynamic area, the second image is used as the third image.
在某些实施例中,所述第二图像与所述第一图像的差异超过预设阈值;或In some embodiments, the difference between the second image and the first image exceeds a preset threshold; or
所述第二图像为与所述第一图像间隔指定帧的图像。The second image is an image spaced apart from the first image by a specified frame.
其中,所述图像处理装置进行图像处理的具体细节参考上述图像处理方法中各实施例的描述,在此不再赘述。The specific details of the image processing performed by the image processing apparatus refer to the descriptions of the embodiments in the above-mentioned image processing method, which will not be repeated here.
另外,本申请还提供了一种可移动平台,所述可移动平台可以是无人机、无人车、无人船、智能机器人、手持云台等任一设备。所述可移动平台包括摄像装置以及图像处理装置,所述图像处理装置可以实现本申请实 施例中的任一项图像处理方法,具体实现细节参考上述图像处理方法中各实施例的描述,在此不再赘述。In addition, the present application also provides a movable platform, and the movable platform can be any device such as an unmanned aerial vehicle, an unmanned vehicle, an unmanned ship, an intelligent robot, and a handheld PTZ. The movable platform includes a camera device and an image processing device. The image processing device can implement any of the image processing methods in the embodiments of the present application. For specific implementation details, refer to the descriptions of the embodiments in the above image processing methods. No longer.
相应地,本说明书实施例还提供一种计算机存储介质,所述存储介质中存储有程序,所述程序被处理器执行时实现上述任一实施例中图像处理方法。Correspondingly, an embodiment of the present specification further provides a computer storage medium, where a program is stored in the storage medium, and when the program is executed by a processor, the image processing method in any of the foregoing embodiments is implemented.
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。Embodiments of the present specification may take the form of a computer program product embodied on one or more storage media having program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like. Computer-usable storage media includes permanent and non-permanent, removable and non-removable media, and storage of information can be accomplished by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the apparatus embodiments, since they basically correspond to the method embodiments, reference may be made to the partial descriptions of the method embodiments for related parts. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没 有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. The terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or device comprising a list of elements includes not only those elements, but also other not expressly listed elements, or also include elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The methods and devices provided by the embodiments of the present invention have been described in detail above. The principles and implementations of the present invention are described in this paper by using specific examples. At the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. To sum up, the content of this description should not be construed as a limitation to the present invention. .
Claims (75)
- 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤除对象遮挡的对象;Obtain a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。The first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
- 根据权利要求1所述的方法,其特征在于,获取所述摄像装置在第二位姿采集的第二图像,包括:The method according to claim 1, wherein acquiring the second image collected by the camera at the second pose comprises:确定所述第二位姿;determining the second pose;控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。The camera is controlled to move to adjust to the second pose and capture the second image.
- 根据权利要求1所述的方法,其特征在于,获取所述摄像装置在第二位姿采集的第二图像,包括The method according to claim 1, wherein acquiring the second image collected by the camera at the second pose comprises:确定所述第二位姿;determining the second pose;向用户发出指示所述第二位姿的提示信息,以使所述用户根据所述提示信息控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。Sending prompt information indicating the second pose to the user, so that the user controls the camera to move according to the prompt information to adjust to the second pose and capture the second image.
- 根据权利要求2或3所述的方法,其特征在于,确定所述第二位姿,包括:The method according to claim 2 or 3, wherein determining the second pose comprises:获取所述待滤除对象的位置信息以及所述目标对象的位置信息;Obtain the location information of the object to be filtered and the location information of the target object;根据所述述待滤除对象的位置信息以及所述目标对象的位置信息确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered and the position information of the target object.
- 根据权利要求4所述的方法,其特征在于,根据所述待滤除对象的位 置信息以及所述目标对象的位置信息确定所述第二位姿,包括:The method according to claim 4, wherein determining the second pose according to the position information of the object to be filtered and the position information of the target object, comprising:根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered.
- 根据权利要求5所述的方法,其特征在于,所述第一位姿包括第一位置和第一朝向,所述第二位姿包括第二位置和第二朝向;The method according to claim 5, wherein the first posture includes a first position and a first orientation, and the second posture includes a second position and a second orientation;所述第二位置位于经过所述第一位置且与所述待滤除对象所在平面平行的直线上,第二朝向指向所述待滤除对象所在的位置。The second position is located on a straight line passing through the first position and parallel to the plane where the object to be filtered is located, and the second orientation points to the position where the object to be filtered is located.
- 根据权利要求6所述的方法,其特征在于,所述第二位置通过以下方式确定:The method of claim 6, wherein the second position is determined by:根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定移动距离;Determine the moving distance according to the position information of the object to be filtered, the position information of the target object and the size of the object to be filtered;根据所述第一位置和所述移动距离确定所述第二位置。The second position is determined according to the first position and the moving distance.
- 根据权利要求6所述的方法,其特征在于,所述第二朝向通过以下方式确定:The method according to claim 6, wherein the second orientation is determined by:根据所述第一位置以及所述待滤除对象在所述摄像装置采集的图像画面中的位置确定所述第二朝向;或Determine the second orientation according to the first position and the position of the object to be filtered out in the image frame captured by the camera; or根据所述第一位置、所述待滤除对象左右端点的位置以及所述目标对象左右端点的位置确定所述第二朝向。The second orientation is determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object.
- 根据权利要求3所述的方法,其特征在于,所述第二位姿包括第二位置和第二朝向,向用户发出指示所述第二位姿的提示信息,包括:The method according to claim 3, wherein the second pose includes a second position and a second orientation, and sending prompt information indicating the second pose to the user, comprising:向用户展示标识有所述第二位置的图像,以及展示调整至所述第二朝向对应的旋转角度信息。The image marked with the second position is displayed to the user, and the rotation angle information corresponding to the second orientation is displayed.
- 根据权利要求1所述的方法,其特征在于,获取所述摄像装置在第二位姿采集的第二图像,包括:The method according to claim 1, wherein acquiring the second image collected by the camera at the second pose comprises:控制所述摄像装置运动以改变所述摄像装置的位姿并采集得到多帧图像,针对每一帧图像,判断所述图像中是否包括所述第二像素区块;Controlling the motion of the camera to change the pose of the camera and collecting multiple frames of images, and for each frame of image, determine whether the second pixel block is included in the image;将包括所述第二像素区块的图像作为所述第二图像。An image including the second pixel block is used as the second image.
- 根据权利要求10所述的方法,其特征在于,判断所述图像中是否包括所述第二像素区块,包括:The method of claim 10, wherein determining whether the image includes the second pixel block comprises:在所述第一像素区块中确定第一特征点,以及所述第一像素区块的周边区域确定第二特征点;determining a first feature point in the first pixel block, and determining a second feature point in a peripheral area of the first pixel block;针对每一帧所述图像,确定所述第一特征点在所述图像中的第一匹配点,以及所述第二特征点在所述图像中的第二匹配点;For each frame of the image, determine a first matching point of the first feature point in the image, and a second matching point of the second feature point in the image;根据所述第一匹配点和所述第二匹配点的在图像中的位置关系确定所述图像是否包括所述第二像素区块。Whether the image includes the second pixel block is determined according to the positional relationship between the first matching point and the second matching point in the image.
- 根据权利要求11所述的方法,其特征在于,所述第一特征点位于所述第一像素区块第一侧之内,所述第二特征点位于所述第一像素区块第二侧之外,其中,所述第一侧为所述第二侧的对侧;The method of claim 11, wherein the first feature point is located within a first side of the first pixel block, and the second feature point is located on a second side of the first pixel block In addition, wherein, the first side is the opposite side of the second side;根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块,包括:Determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point, including:当判定所述第二匹配点位于所述第一匹配点的第一侧时,判定所述图像包括所述第二像素区块。When it is determined that the second matching point is located on the first side of the first matching point, it is determined that the image includes the second pixel block.
- 根据权利要求11所述的方法,其特征在于,多个所述第二特征点位于环绕所述第一像素区域的环状像素区块中,根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块,包括:The method according to claim 11, wherein a plurality of the second feature points are located in a ring-shaped pixel block surrounding the first pixel area, according to the first matching point and the second matching The positional relationship of the point determines whether the image includes the second pixel block, including:当多个所述第二匹配点中预设数量的所述第二匹配点位于所述第一匹配点的一侧时,则判定所述第二图像中包括所述第二像素区块。When a preset number of the second matching points among the plurality of second matching points are located on one side of the first matching point, it is determined that the second pixel block is included in the second image.
- 根据权利要求2、3或10所述的方法,其特征在于,所述摄像装置搭 载于可移动平台,所述控制所述摄像装置运动,包括:The method according to claim 2, 3 or 10, wherein the camera device is mounted on a movable platform, and the control of the camera device to move includes:控制所述可移动平台运动以控制所述摄像装置运动。Movement of the movable platform is controlled to control movement of the camera.
- 根据权利要2、3或10所述的方法,其特征在于,所述摄像装置通过云台搭载于可移动平台;所述控制所述摄像装置运动,包括:The method according to claim 2, 3 or 10, wherein the camera device is mounted on a movable platform through a pan/tilt; the controlling the movement of the camera device includes:控制所述可移动平台运动,和/或,控制所述云台使所述摄像装置与所述可移动平台之间产生相对运动,以控制所述摄像装置运动。The movable platform is controlled to move, and/or the pan/tilt is controlled to generate relative motion between the camera and the movable platform, so as to control the camera to move.
- 根据权利要2或3所述的方法,其特征在于,所述摄像装置通过云台搭载于可移动平台,所述第二位姿包括第二位置和第二朝向,控制所述摄像装置运动以使所述摄像装置调整至所述第二位姿,包括:The method according to claim 2 or 3, wherein the camera device is mounted on a movable platform through a pan/tilt, the second pose includes a second position and a second orientation, and the camera device is controlled to move to Adjusting the camera device to the second pose includes:控制所述可移动平台运动,以使所述摄像装置位于所述第二位置;以及控制所述云台转动,以使所述摄像装置的朝向调整至所述第二朝向。The movable platform is controlled to move so that the camera is located at the second position; and the pan-tilt is controlled to rotate so that the orientation of the camera is adjusted to the second orientation.
- 根据权利要求14-16任一项所述的方法,其特征在于,所述可移动平台包括无人机、无人车、无人船中的任一种。The method according to any one of claims 14-16, wherein the movable platform comprises any one of an unmanned aerial vehicle, an unmanned vehicle, and an unmanned boat.
- 根据权利要求1-17任一项所述的方法,其特征在于,在所述第一图像中确定待滤除对象对应的第一像素区块,包括:The method according to any one of claims 1-17, wherein determining the first pixel block corresponding to the object to be filtered out in the first image comprises:响应于用户的指令,从所述第一图像中确定待滤除对象对应的第一像素区块。In response to the user's instruction, the first pixel block corresponding to the object to be filtered out is determined from the first image.
- 根据权利要求18所述的方法,其特征在于,所述指令包括用户通过人机交互界面输入的选框,所述选框用于框选所述静态目标对象。The method according to claim 18, wherein the instruction comprises a check box input by a user through a human-computer interaction interface, and the check box is used to frame the static target object.
- 据权利要求19所述的方法,其特征在于,所述第一像素区块为所述选框框选的像素区块,所述方法还包括:The method of claim 19, wherein the first pixel block is a pixel block selected by the frame, and the method further comprises:对所述第一图像进行超像素分割处理,得到多个图像区域,基于所述多个图像区域调整所述选框框选的像素区块。Perform superpixel segmentation processing on the first image to obtain multiple image areas, and adjust the pixel blocks selected by the frame selection based on the multiple image areas.
- 据权利要求20所述的方法,其特征在于,基于所述多个图像区域调 整所述选框框选的像素区块,包括:The method according to claim 20, wherein, adjusting the pixel block selected by the frame selection based on the plurality of image regions, comprising:根据所述多个图像区域中各图像区域落入所述选框的部分与各图像区域的占比调整所述选框框选的像素区块。The pixel block selected by the frame is adjusted according to the ratio of the portion of each image area that falls within the frame and each image area in the plurality of image areas.
- 根据权利要求1-21任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-21, wherein the method further comprises:当预设第一条件触发后,向用户发出无法滤除所述待滤除对象的提示信息。When the preset first condition is triggered, a prompt message that the object to be filtered out cannot be filtered out is sent to the user.
- 根据权利要求22所述的方法,其特征在于,所述预设第一条件包括以下一种或多种:The method according to claim 22, wherein the preset first condition comprises one or more of the following:所述待滤除对象与所述目标对象的第一距离小于第一预设阈值;The first distance between the object to be filtered and the target object is less than a first preset threshold;或所述目标对象的与所述摄像装置的第二距离小于第二预设阈值;or the second distance between the target object and the camera device is less than a second preset threshold;或所述第一距离与所述第二距离之间的距离大小关系不满足预设第二条件。Or the distance magnitude relationship between the first distance and the second distance does not satisfy a preset second condition.
- 根据权利要求1-23任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-23, wherein the method further comprises:在所述第二图像中确定所述第二像素区块。The second pixel block is determined in the second image.
- 根据权利要求24所述的方法,其特征在于,在所述第二图像中确定所述第二像素区块,包括:The method of claim 24, wherein determining the second pixel block in the second image comprises:确定所述第一图像的像素点与所述第二图像的像素点之间的映射关系;determining the mapping relationship between the pixels of the first image and the pixels of the second image;根据所述映射关系确定所述第一像素区块在所述第二图像的映射区域,作为所述第二像素区块。The mapping area of the first pixel block in the second image is determined according to the mapping relationship as the second pixel block.
- 根据权利要求25所述的方法,其特征在于,确定所述第一图像的像素点与所述第二图像的像素点之间的映射关系,包括:The method according to claim 25, wherein determining the mapping relationship between the pixels of the first image and the pixels of the second image comprises:在所述第一像素区块的周边区域提取第三特征点,并在所述第二图像中 确定所述第三特征点的第三匹配点;Extract the 3rd feature point in the peripheral area of described first pixel block, and determine the 3rd matching point of described 3rd feature point in described second image;基于所述第三特征点和所述第三匹配点确定所述映射关系。The mapping relationship is determined based on the third feature point and the third matching point.
- 根据权利要求24所述的方法,其特征在于,在所述第二图像中确定所述第二像素区块,包括:The method of claim 24, wherein determining the second pixel block in the second image comprises:在所述第一图像中确定一环绕所述第一像素区块的环状像素区块;determining a ring-shaped pixel block surrounding the first pixel block in the first image;在所述第二图像中确定与所述环状像素区块相匹配的匹配环状区块;determining a matching ring-shaped block that matches the ring-shaped pixel block in the second image;将述第二图像中所述匹配环状区块包围的像素区块作为所述第二像素区块。A pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
- 根据权利要求1-27任一项所述的方法,其特征在于,获取摄像装置在第一位姿采集的第一图像包括:The method according to any one of claims 1-27, wherein acquiring the first image captured by the camera in the first pose comprises:获取摄像装置在第一位姿采集的多张图像;acquiring multiple images collected by the camera device in the first pose;在所述多张图像中确定所述第一图像。The first image is determined among the plurality of images.
- 根据权利要求28所述的方法,其特征在于,在所述第一图像中确定待滤除对象对应的第一像素区块之前,还包括:The method according to claim 28, wherein before determining the first pixel block corresponding to the object to be filtered out in the first image, the method further comprises:通过所述多张图像确定所述待滤除对象的类别信息,所述类别信息用于标识所述待滤除对象为动态对象或静态对象;Determine the category information of the object to be filtered out by using the plurality of images, where the category information is used to identify the object to be filtered out as a dynamic object or a static object;若所述待滤除对象为静态对象,则执行所述在所述第一图像中确定待滤除对象对应的第一像素区块,获取所述摄像装置在第二位姿采集的包括第二像素区块的第二图像,并通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像的步骤。If the object to be filtered out is a static object, then the determining of the first pixel block corresponding to the object to be filtered out in the first image is performed, and the acquisition of the image data collected by the camera in the second pose including the second pixel block is performed. A second image of a pixel block, and performing a replacement process on the first pixel block in the first image through the second pixel block to generate a replaced first image.
- 根据权利要求29所述的方法,其特征在于,若所述待滤除对象为动态对象,则执行以下步骤:The method according to claim 29, wherein if the object to be filtered is a dynamic object, the following steps are performed:确定待滤除对象在所述第一图像中对应的第三像素区块;Determine the third pixel block corresponding to the object to be filtered out in the first image;确定所述第三像素区块所在像素位置在所述多张图像中除所述第一图像 外的其他图像中的对应像素位置上的第四像素区块;Determine the fourth pixel block on the corresponding pixel position in the other images except the first image in the plurality of images at the pixel position of the third pixel block;从所述其他图像中确定所述第四像素区块为静态区域的第三图像;Determine from the other images that the fourth pixel block is the third image of the static area;利用所述第三图像中的所述第四像素区块替换所述第一图像中的所述第三像素区块。The third pixel block in the first image is replaced with the fourth pixel block in the third image.
- 根据权利要求29或30所述的方法,其特征在于,通过所述多张图像确定所述待滤除对象的所述类别,包括:The method according to claim 29 or 30, wherein determining the category of the object to be filtered out from the plurality of images comprises:根据所述待滤除对象的各像素点相对于所述其他图像的光流确定所述待滤除对象的类别信息。The category information of the object to be filtered is determined according to the optical flow of each pixel of the object to be filtered relative to the other images.
- 根据权利要求30所述的方法,其特征在于,从所述其他图像中确定所述第四像素区块为静态区域的第三图像,包括:The method according to claim 30, wherein determining from the other images that the fourth pixel block is a third image of a static area, comprising:确定所述其他图像中动态区域;determining dynamic regions in said other images;针对每个所述待滤除对象,执行以下步骤:For each object to be filtered out, perform the following steps:按照所述其他图像与所述第一图像采集顺序由近及远的顺序,确定所述第三像素区块所在像素位置在所述其他图像中的对应像素位置的像素区块,直至所述对应像素位置的像素区块与所述动态区域不重叠,则将所述其他图像作为所述第三图像。According to the order of acquisition of the other images and the first image from near to far, determine the pixel block of the corresponding pixel position in the other image where the pixel position of the third pixel block is located, until the corresponding pixel position If the pixel block at the pixel position does not overlap with the dynamic area, the other image is used as the third image.
- 根据权利要求29-32任一项所述的方法,其特征在于,所述其他与所述第一图像的差异超过预设阈值;或The method according to any one of claims 29-32, wherein the difference between the other and the first image exceeds a preset threshold; or所述其他图像为与所述第一图像间隔指定帧的图像。The other images are images spaced apart from the first image by a specified frame.
- 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:确定第一图像中的动态对象对应的第一像素区块;Determine the first pixel block corresponding to the dynamic object in the first image;确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;Determine the pixel block of the pixel position of the first pixel block corresponding to the pixel position in a plurality of second images, and the plurality of second images and the first image are collected in the same pose by a camera;从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;From the plurality of second images, it is determined that the pixel block of the corresponding pixel position is the third image of the static area;利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。The first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
- 根据权利要求34所述的方法,其特征在于,确定所述第一图像中的动态对象对应的第一像素区块,包括:The method according to claim 34, wherein determining the first pixel block corresponding to the dynamic object in the first image comprises:针对所述每一帧所述第二图像执行以下操作:Do the following for each frame of the second image:计算所述第一图像各像素点相对于所述第二图像的光流;calculating the optical flow of each pixel of the first image relative to the second image;从所述第一图像各像素点确定所述光流的模长大于预设阈值的目标像素点;Determine, from each pixel of the first image, a target pixel whose modulo length of the optical flow is greater than a preset threshold;对所述目标像素点进行聚类处理,得到所述动态对象对应的第一像素区块。The target pixel points are clustered to obtain the first pixel block corresponding to the dynamic object.
- 根据权利要求35所述的方法,其特征在于,从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像,包括:The method according to claim 35, wherein determining from the plurality of second images that the pixel block corresponding to the pixel position is the third image of the static area, comprising:确定所述多张第二图像中的动态区域;determining dynamic regions in the plurality of second images;针对每个所述第一像素区块,执行以下步骤:For each of the first pixel blocks, the following steps are performed:按照所述第二图像与所述第一图像采集顺序由近及远的顺序,确定所述第一像素区域所在像素位置在所述第二图像中的对应像素位置的像素区块,直至所述对应位置的像素区块与所述动态区域不重叠,则将所述第二图像作为所述第三图像。According to the sequence of acquiring the second image and the first image from near to far, determine the pixel block of the pixel position where the first pixel area is located in the corresponding pixel position in the second image, until the If the pixel block at the corresponding position does not overlap with the dynamic area, the second image is used as the third image.
- 根据权利要求34-36任一项所述的方法,其特征在于,所述第二图像与所述第一图像的差异超过预设阈值;或The method according to any one of claims 34-36, wherein the difference between the second image and the first image exceeds a preset threshold; or所述第二图像为与所述第一图像间隔指定帧的图像。The second image is an image spaced apart from the first image by a specified frame.
- 一种图像处理装置,其特征在于,所述图像处理装置包括处理器、 存储器、存储于所述存储器所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:An image processing apparatus, characterized in that the image processing apparatus includes a processor, a memory, and a computer program stored in the memory and executable by the processor, and when the processor executes the computer program, the following steps are implemented :获取摄像装置在第一位姿采集的第一图像,并在所述第一图像中确定待滤除对象对应的第一像素区块;acquiring the first image collected by the camera in the first pose, and determining the first pixel block corresponding to the object to be filtered out in the first image;获取所述摄像装置在第二位姿采集的第二图像,所述第二图像包括目标对象对应的第二像素区块,所述目标对象为所述第一图像中被所述待滤除对象遮挡的对象;Obtain a second image collected by the camera in the second pose, the second image includes a second pixel block corresponding to a target object, and the target object is the object to be filtered out in the first image occluded object;通过所述第二像素区块对所述第一图像中所述第一像素区块做替换处理,以生成替换处理后的第一图像。The first pixel block in the first image is replaced by the second pixel block to generate a replaced first image.
- 根据权利要求38所述的装置,其特征在于,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:The device according to claim 38, wherein when the processor is configured to acquire the second image collected by the camera in the second pose, the processor is specifically configured to:确定所述第二位姿;determining the second pose;控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。The camera is controlled to move to adjust to the second pose and capture the second image.
- 根据权利要求38所述的装置,其特征在于,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:The device according to claim 38, wherein when the processor is configured to acquire the second image collected by the camera in the second pose, the processor is specifically configured to:确定所述第二位姿;determining the second pose;向用户发出指示所述第二位姿的提示信息,以使所述用户根据所述提示信息控制所述摄像装置运动以调整至所述第二位姿并采集所述第二图像。Sending prompt information indicating the second pose to the user, so that the user controls the camera to move according to the prompt information to adjust to the second pose and capture the second image.
- 根据权利要求39或40所述的装置,其特征在于,所述处理器用于确定所述第二位姿时,具体用于:The device according to claim 39 or 40, wherein when the processor is configured to determine the second pose, it is specifically configured to:获取所述待滤除对象的位置信息以及所述目标对象的位置信息;Obtain the location information of the object to be filtered and the location information of the target object;根据所述述待滤除对象的位置信息以及所述目标对象的位置信息确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered and the position information of the target object.
- 根据权利要求41所述的装置,其特征在于,所述处理器用于根据所 述待滤除对象的位置信息以及所述目标对象的位置信息确定所述第二位姿,具体用于:The device according to claim 41, wherein the processor is configured to determine the second pose according to the position information of the object to be filtered and the position information of the target object, and is specifically used for:根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定所述第二位姿。The second pose is determined according to the position information of the object to be filtered, the position information of the target object, and the size of the object to be filtered.
- 根据权利要42所述的装置,其特征在于,所述第一位姿包括第一位置和第一朝向,所述第二位姿包括第二位置和第二朝向;The device of claim 42, wherein the first posture includes a first position and a first orientation, and the second posture includes a second position and a second orientation;所述第二位置位于经过所述第一位置且所述待滤除对象所在平面平行的直线上,第二朝向指向所述待滤除对象所在的位置。The second position is located on a straight line passing through the first position and parallel to the plane where the object to be filtered is located, and the second orientation points to the position where the object to be filtered is located.
- 根据权利要求43所述的装置,其特征在于,所述第二位置通过以下方式确定:The apparatus of claim 43, wherein the second position is determined by:根据所述待滤除对象的位置信息、所述目标对象的位置信息以及所述待滤除对象的尺寸确定移动距离;Determine the moving distance according to the position information of the object to be filtered, the position information of the target object and the size of the object to be filtered;根据所述第一位置和所述移动距离确定所述第二位置。The second position is determined according to the first position and the moving distance.
- 根据权利要求43或44所述的装置,其特征在于,所述第二朝向通过以下方式确定:The device according to claim 43 or 44, wherein the second orientation is determined by:根据所述第一位置以及所述待滤除对象在所述摄像装置采集的图像画面中的位置确定所述第二朝向;或Determine the second orientation according to the first position and the position of the object to be filtered out in the image frame captured by the camera; or根据所述第一位置、所述待滤除对象左右端点的位置以及所述目标对象左右端点的位置确定所述第二朝向。The second orientation is determined according to the first position, the positions of the left and right endpoints of the object to be filtered, and the positions of the left and right endpoints of the target object.
- 根据权利要求40所述的装置,其特征在于,所述第二位姿包括第二位置和第二朝向,所述处理器用于向用户发出指示所述第二位姿的提示信息,时,具体用于:The device according to claim 40, wherein the second posture includes a second position and a second orientation, and the processor is configured to send prompt information indicating the second posture to the user, when, specifically Used for:向用户展示标识有所述第二位置的图像,以及展示调整至所述第二朝向对应的旋转角度信息。The image marked with the second position is displayed to the user, and the rotation angle information corresponding to the second orientation is displayed.
- 根据权利要求38所述的装置,其特征在于,所述处理器用于获取所述摄像装置在第二位姿采集的第二图像时,具体用于:The device according to claim 38, wherein when the processor is configured to acquire the second image collected by the camera in the second pose, the processor is specifically configured to:控制所述摄像装置运动以改变所述摄像装置的位姿并采集得到多帧图像,针对每一帧图像,判断所述图像中是否包括所述第二像素区块;Controlling the motion of the camera to change the pose of the camera and collecting multiple frames of images, and for each frame of image, determine whether the second pixel block is included in the image;将包括所述第二像素区块的图像作为所述第二图像。An image including the second pixel block is used as the second image.
- 根据权利要求47所述的装置,其特征在于,所述处理器用于判断所述图像中是否包括所述第二像素区块时,具体用于:The device according to claim 47, wherein when the processor is configured to determine whether the image includes the second pixel block, the processor is specifically configured to:在所述第一像素区块中确定第一特征点,以及所述第一像素区块的周边区域确定第二特征点;determining a first feature point in the first pixel block, and determining a second feature point in a peripheral area of the first pixel block;针对每一帧所述图像,确定所述第一特征点在所述图像中的第一匹配点,以及所述第二特征点在所述图像中的第二匹配点;For each frame of the image, determine a first matching point of the first feature point in the image, and a second matching point of the second feature point in the image;根据所述第一匹配点和所述第二匹配点的在图像中的位置关系确定所述图像是否包括所述第二像素区块。Whether the image includes the second pixel block is determined according to the positional relationship between the first matching point and the second matching point in the image.
- 根据权利要求48所述的装置,其特征在于,所述第一特征点位于所述第一像素区块第一侧之内,所述第二特征点位于所述第一像素区块第二侧之外,其中,所述第一侧为所述第二侧的对侧;The device of claim 48, wherein the first feature point is located within a first side of the first pixel block, and the second feature point is located on a second side of the first pixel block In addition, wherein, the first side is the opposite side of the second side;所述处理器用于根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块时,具体用于:When the processor is used to determine whether the image includes the second pixel block according to the positional relationship between the first matching point and the second matching point, it is specifically used for:当判定所述第二匹配点位于所述第一匹配点的第一侧时,判定所述图像包括所述第二像素区块。When it is determined that the second matching point is located on the first side of the first matching point, it is determined that the image includes the second pixel block.
- 根据权利要求48所述的装置,其特征在于,多个所述第二特征点位于环绕所述第一像素区域的环状像素区块中,所述处理器用于根据所述第一匹配点和所述第二匹配点的位置关系确定所述图像是否包括所述第二像素区块时,具体用于:The device according to claim 48, wherein a plurality of the second feature points are located in a ring-shaped pixel block surrounding the first pixel area, and the processor is configured to match the first matching points and the When the positional relationship of the second matching point determines whether the image includes the second pixel block, it is specifically used for:当多个所述第二匹配点中预设数量的所述第二匹配点位于所述第一匹配点的一侧时,则判定所述第二图像中包括所述第二像素区块。When a preset number of the second matching points among the plurality of second matching points are located on one side of the first matching point, it is determined that the second pixel block is included in the second image.
- 根据权利要求39、40或47所述的装置,其特征在于,所述摄像装置搭载于可移动平台,所述处理器用于控制所述摄像装置运动时,具体用于:The device according to claim 39, 40 or 47, wherein the camera device is mounted on a movable platform, and the processor is used to control the movement of the camera device, and is specifically used for:控制所述可移动平台运动以控制所述摄像装置运动。Movement of the movable platform is controlled to control movement of the camera.
- 根据权利要39、40或47所述的装置,其特征在于,所述摄像装置通过云台搭载于可移动平台,所述处理器用于控制所述摄像装置运动时,具体用于:The device according to claim 39, 40 or 47, wherein the camera device is mounted on a movable platform through a pan/tilt, and the processor is used to control the movement of the camera device, and is specifically used for:控制所述可移动平台运动,和/或,控制所述云台使所述摄像装置与所述可移动平台之间产生相对运动,以控制所述摄像装置运动。The movable platform is controlled to move, and/or the pan/tilt is controlled to generate relative motion between the camera and the movable platform, so as to control the camera to move.
- 根据权利要39或40所述的装置,其特征在于,所述摄像装置通过云台搭载于可移动平台,所述第二位姿包括第二位置和第二朝向,所述处理器用于控制所述摄像装置运动以使所述摄像装置调整至所述第二位姿时,具体用于:The device according to claim 39 or 40, wherein the camera device is mounted on the movable platform through a pan/tilt head, the second posture includes a second position and a second orientation, and the processor is used to control the When the camera is moved to adjust the camera to the second pose, it is specifically used for:控制所述可移动平台运动,以使所述摄像装置位于所述第二位置;以及控制所述云台转动,以使所述摄像装置的朝向调整至所述第二朝向。The movable platform is controlled to move so that the camera is located at the second position; and the pan-tilt is controlled to rotate so that the orientation of the camera is adjusted to the second orientation.
- 根据权利要求51-53任一项所述的装置,其特征在于,所述可移动平台包括无人机、无人车、无人船中的任一种。The device according to any one of claims 51-53, wherein the movable platform comprises any one of an unmanned aerial vehicle, an unmanned vehicle, and an unmanned boat.
- 根据权利要求38-54任一项所述的装置,其特征在于,所述处理器用于在所述第一图像中确定待滤除对象对应的第一像素区块时,具体用于:The device according to any one of claims 38-54, wherein when the processor is configured to determine the first pixel block corresponding to the object to be filtered out in the first image, it is specifically configured to:响应于用户的指令,从所述第一图像中确定待滤除对象对应的第一像素区块。In response to the user's instruction, the first pixel block corresponding to the object to be filtered out is determined from the first image.
- 根据权利要求55所述的装置,其特征在于,所述指令包括用户通过人机交互界面输入的选框,所述选框用于框选所述静态目标对象。The apparatus according to claim 55, wherein the instruction comprises a check box input by a user through a human-computer interaction interface, and the check box is used to frame the static target object.
- 据权利要求56所述的装置,其特征在于,所述第一像素区块为所述选框框选的像素区块,所述装置还用于:The apparatus of claim 56, wherein the first pixel block is a pixel block selected by the marquee, and the apparatus is further configured to:对所述第一图像进行超像素分割处理,得到多个图像区域,基于所述多个图像区域调整所述选框框选的像素区块。Perform superpixel segmentation processing on the first image to obtain multiple image areas, and adjust the pixel blocks selected by the frame selection based on the multiple image areas.
- 据权利要求57所述的装置,其特征在于,所述处理器基于所述多个图像区域调整所述选框框选的像素区块时,具体用于:The device according to claim 57, wherein when the processor adjusts the pixel blocks selected by the marquee based on the plurality of image regions, the processor is specifically configured to:根据所述多个图像区域中各图像区域落入所述选框的部分与各图像区域的占比调整所述选框框选的像素区块。The pixel block selected by the frame is adjusted according to the ratio of the portion of each image area that falls within the frame and each image area in the plurality of image areas.
- 根据权利要求38-58任一项所述的装置,其特征在于,所述装置还用于:The device according to any one of claims 38-58, characterized in that, the device is further used for:当预设第一条件触发后,向用户发出无法滤除所述待滤除对象的提示信息。When the preset first condition is triggered, a prompt message that the object to be filtered out cannot be filtered out is sent to the user.
- 根据权利要求59所述的装置,其特征在于,所述预设第一条件包括以下一种或多种:The device according to claim 59, wherein the preset first condition comprises one or more of the following:所述待滤除对象与所述目标对象的第一距离小于第一预设阈值;The first distance between the object to be filtered and the target object is less than a first preset threshold;或所述目标对象的与所述摄像装置的第二距离小于第二预设阈值;or the second distance between the target object and the camera device is less than a second preset threshold;或所述第一距离与所述第二距离之间的距离大小关系不满足预设第二条件。Or the distance magnitude relationship between the first distance and the second distance does not satisfy a preset second condition.
- 根据权利要求30-60任一项所述的装置,其特征在于,所述装置还用于:The device according to any one of claims 30-60, wherein the device is further used for:在所述第二图像中确定所述第二像素区块。The second pixel block is determined in the second image.
- 根据权利要求61所述的装置,其特征在于,所述处理器用于在所述第二图像中确定所述第二像素区块时,具体用于:The device according to claim 61, wherein when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:确定所述第一图像的像素点与所述第二图像的像素点之间的映射关系;determining the mapping relationship between the pixels of the first image and the pixels of the second image;根据所述映射关系确定所述第一像素区块在所述第二图像的映射区域,作为所述第二像素区块。The mapping area of the first pixel block in the second image is determined according to the mapping relationship as the second pixel block.
- 根据权利要求62所述的装置,其特征在于,所述处理器用于确定所述第一图像的像素点与所述第二图像的像素点之间的映射关系时,具体用于:The device according to claim 62, wherein when the processor is configured to determine the mapping relationship between the pixels of the first image and the pixels of the second image, it is specifically configured to:在所述第一像素区块的周边区域提取第三特征点,并在所述第二图像中确定所述第三特征点的第三匹配点;Extract the third feature point in the peripheral area of the first pixel block, and determine the third matching point of the third feature point in the second image;基于所述第三特征点和所述第三匹配点确定所述映射关系。The mapping relationship is determined based on the third feature point and the third matching point.
- 根据权利要求61所述的装置,其特征在于,所述处理器用于在所述第二图像中确定所述第二像素区块时,具体用于:The device according to claim 61, wherein when the processor is configured to determine the second pixel block in the second image, it is specifically configured to:在所述第一图像中确定一环绕所述第一像素区块的环状像素区块;determining a ring-shaped pixel block surrounding the first pixel block in the first image;在所述第二图像中确定与所述环状像素区块相匹配的匹配环状区块;determining a matching ring-shaped block that matches the ring-shaped pixel block in the second image;将述第二图像中所述匹配环状区块包围的像素区块作为所述第二像素区块。A pixel block surrounded by the matching ring-shaped block in the second image is used as the second pixel block.
- 根据权利要求38-64任一项所述的装置,其特征在于,所述处理器用于获取摄像装置在第一位姿采集的第一图像时,具体用于:The device according to any one of claims 38 to 64, wherein when the processor is configured to acquire the first image captured by the camera in the first pose, the processor is specifically configured to:获取摄像装置在第一位姿采集的多张图像;acquiring multiple images collected by the camera device in the first pose;在所述多张图像中确定所述第一图像。The first image is determined among the plurality of images.
- 根据权利要求65所述的装置,其特征在于,所述处理器用于在所述第一图像中确定待滤除对象对应的第一像素区块之前,还用于:The device according to claim 65, wherein the processor is further configured to: before determining the first pixel block corresponding to the object to be filtered out in the first image:通过所述多张图像确定所述待滤除对象的类别信息,所述类别信息用于标识所述待滤除对象为动态对象或静态对象;Determine the category information of the object to be filtered out by using the plurality of images, where the category information is used to identify the object to be filtered out as a dynamic object or a static object;若所述待滤除对象为静态对象,则执行所述在所述第一图像中确定待滤除对象对应的第一像素区块,获取所述摄像装置在第二位姿采集的包括第二像素区块的第二图像,并通过所述第二像素区块对所述第一图像中所述第一 像素区块做替换处理,以生成替换处理后的第一图像的步骤。If the object to be filtered out is a static object, then the determining of the first pixel block corresponding to the object to be filtered out in the first image is performed, and the acquisition of the image data collected by the camera in the second pose including the second pixel block is performed. The second image of the pixel block, and the step of replacing the first pixel block in the first image with the second pixel block to generate the replaced first image.
- 根据权利要求66所述的装置,其特征在于,所述装置还用于:The apparatus of claim 66, wherein the apparatus is further configured to:若所述待滤除对象为动态对象,则执行以下步骤:If the object to be filtered is a dynamic object, perform the following steps:确定待滤除对象在所述第一图像中对应的第三像素区块;Determine the third pixel block corresponding to the object to be filtered out in the first image;确定所述第三像素区域所在像素位置在所述多张图像中除所述第一图像外的其他图像中对应像素位置上的第四像素区块;Determine the fourth pixel block on the corresponding pixel position in the other images except the first image in the plurality of images at the pixel position of the third pixel area;从所述其他图像中确定所述第四像素区块为静态区域的第三图像;Determine from the other images that the fourth pixel block is the third image of the static area;利用所述第三图像中的所述第四像素区块替换所述第一图像中的所述第三像素区块。The third pixel block in the first image is replaced with the fourth pixel block in the third image.
- 根据权利要求66或67所述的装置,其特征在于,所述处理器用于通过所述多张图像确定所述待滤除对象的所述类别时,具体用于:The device according to claim 66 or 67, wherein when the processor is configured to determine the category of the object to be filtered out from the multiple images, it is specifically configured to:根据所述待滤除对象的各像素点相对于所述多张图像中除所述第一图像外的其他图像的光流确定所述待滤除对象的类别信息。The category information of the object to be filtered out is determined according to the optical flow of each pixel of the object to be filtered out relative to other images in the plurality of images except the first image.
- 根据权利要求67所述的装置,其特征在于,所述处理器用于从所述其他图像中确定所述第四像素区块为静态区域的第三图像时,具体用于:The device according to claim 67, wherein when the processor is configured to determine from the other images that the fourth pixel block is the third image of the static area, the processor is specifically configured to:确定所述其他图像中的动态区域;determining dynamic regions in said other images;针对每个所述待滤除对象,执行以下步骤:For each object to be filtered out, perform the following steps:按照所述其他图像与所述第一图像采集顺序由近及远的顺序,确定所述第三像素区块所在像素位置在所述其他图像中的对应像素位置的像素区块,直至所述对应像素位置的像素区块与所述动态区域不重叠,则将所述其他图像作为所述第三图像。According to the order of acquisition of the other images and the first image from near to far, determine the pixel block of the corresponding pixel position of the third pixel block in the other image, until the corresponding pixel position If the pixel block at the pixel position does not overlap with the dynamic area, the other image is used as the third image.
- 根据权利要求66-69任一项所述的装置,其特征在于,所述其他与所述第一图像的差异超过预设阈值;或The device according to any one of claims 66-69, wherein the difference between the other and the first image exceeds a preset threshold; or所述其他图像为与所述第一图像间隔指定帧的图像。The other images are images spaced apart from the first image by a specified frame.
- 一种图像处理装置,其特征在于,所述图像处理装置包括处理器、存储器、存储于所述存储器所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:An image processing device, characterized in that the image processing device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, and when the processor executes the computer program, the following steps are implemented :确定第一图像中的动态对象对应的第一像素区块;Determine the first pixel block corresponding to the dynamic object in the first image;确定所述第一像素区块所在像素位置在多张第二图像中的对应像素位置的像素区块,所述多张第二图像与所述第一图像通过摄像装置在同一位姿采集得到;Determine the pixel block of the pixel position of the first pixel block corresponding to the pixel position in a plurality of second images, and the plurality of second images and the first image are collected in the same pose by a camera;从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;From the plurality of second images, it is determined that the pixel block of the corresponding pixel position is the third image of the static area;利用所述第三图像中的所述对应像素位置的像素区块替换所述第一图像中的所述第一像素区块。The first pixel block in the first image is replaced with the pixel block at the corresponding pixel position in the third image.
- 根据权利要求71所述的装置,其特征在于,所述处理器用于确定所述第一图像中的动态对象对应的第一像素区块时,具体用于:The device according to claim 71, wherein when the processor is configured to determine the first pixel block corresponding to the dynamic object in the first image, it is specifically configured to:针对所述每一帧所述第二图像执行以下操作:Do the following for each frame of the second image:计算所述第一图像各像素点相对于所述第二图像的光流;calculating the optical flow of each pixel of the first image relative to the second image;从所述第一图像各像素点确定所述光流的模长大于预设阈值的目标像素点;Determine, from each pixel of the first image, a target pixel whose modulo length of the optical flow is greater than a preset threshold;对所述目标像素点进行聚类处理,得到所述动态对象对应的第一像素区块。The target pixel points are clustered to obtain the first pixel block corresponding to the dynamic object.
- 根据权利要求71所述的装置,其特征在于,所述处理器用于从所述多张第二图像中确定所述对应像素位置的像素区块为静态区域的第三图像;具体用于:The device according to claim 71, wherein the processor is configured to determine from the plurality of second images that the pixel block corresponding to the pixel position is the third image of the static area; specifically:确定所述多张第二图像中的动态区域;determining dynamic regions in the plurality of second images;针对每个所述第一像素区块,执行以下步骤:For each of the first pixel blocks, the following steps are performed:按照所述第二图像与所述第一图像采集顺序由近及远的顺序,确定所述第一像素区块所在的像素位置在所述第二图像中的对应像素位置的像素区块,直至所述对应像素位置的像素区块与所述动态区域不重叠,则将所述第二图像作为所述第三图像。According to the second image and the first image acquisition sequence from near to far, determine the pixel block where the pixel position of the first pixel block is located in the corresponding pixel position in the second image, until If the pixel block corresponding to the pixel position does not overlap with the dynamic area, the second image is used as the third image.
- 根据权利要求71-73任一项所述的装置法,其特征在于,所述第二图像与所述第一图像的差异超过预设阈值;或The device method according to any one of claims 71-73, wherein the difference between the second image and the first image exceeds a preset threshold; or所述第二图像为与所述第一图像间隔指定帧的图像。The second image is an image spaced apart from the first image by a specified frame.
- 一种可移动平台,其特征在于,所述可移动平台包括摄像装置以及如权利要求38-74任一项所述的图像处理装置。A movable platform, characterized in that, the movable platform comprises a camera device and the image processing device according to any one of claims 38-74.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/111450 WO2022040988A1 (en) | 2020-08-26 | 2020-08-26 | Image processing method and apparatus, and movable platform |
CN202080039127.8A CN113950705A (en) | 2020-08-26 | 2020-08-26 | Image processing method and device and movable platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/111450 WO2022040988A1 (en) | 2020-08-26 | 2020-08-26 | Image processing method and apparatus, and movable platform |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022040988A1 true WO2022040988A1 (en) | 2022-03-03 |
Family
ID=79327044
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/111450 WO2022040988A1 (en) | 2020-08-26 | 2020-08-26 | Image processing method and apparatus, and movable platform |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113950705A (en) |
WO (1) | WO2022040988A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118175190A (en) * | 2024-05-13 | 2024-06-11 | 国网山东省电力公司阳信县供电公司 | Inspection method, system, equipment and medium for insulating rod type pole tower equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110103644A1 (en) * | 2009-10-30 | 2011-05-05 | Zoran Corporation | Method and apparatus for image detection with undesired object removal |
CN106056534A (en) * | 2016-05-31 | 2016-10-26 | 中国科学院深圳先进技术研究院 | Obstruction perspective method and device based on smart glasses |
CN106791393A (en) * | 2016-12-20 | 2017-05-31 | 维沃移动通信有限公司 | A kind of image pickup method and mobile terminal |
CN109035185A (en) * | 2018-06-29 | 2018-12-18 | 努比亚技术有限公司 | A kind of image processing method and terminal |
CN109167893A (en) * | 2018-10-23 | 2019-01-08 | Oppo广东移动通信有限公司 | Shoot processing method, device, storage medium and the mobile terminal of image |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018086050A1 (en) * | 2016-11-11 | 2018-05-17 | 深圳市大疆创新科技有限公司 | Depth map generation method and unmanned aerial vehicle based on this method |
CN108629283B (en) * | 2018-04-02 | 2022-04-08 | 北京小米移动软件有限公司 | Face tracking method, device, equipment and storage medium |
-
2020
- 2020-08-26 WO PCT/CN2020/111450 patent/WO2022040988A1/en active Application Filing
- 2020-08-26 CN CN202080039127.8A patent/CN113950705A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110103644A1 (en) * | 2009-10-30 | 2011-05-05 | Zoran Corporation | Method and apparatus for image detection with undesired object removal |
CN106056534A (en) * | 2016-05-31 | 2016-10-26 | 中国科学院深圳先进技术研究院 | Obstruction perspective method and device based on smart glasses |
CN106791393A (en) * | 2016-12-20 | 2017-05-31 | 维沃移动通信有限公司 | A kind of image pickup method and mobile terminal |
CN109035185A (en) * | 2018-06-29 | 2018-12-18 | 努比亚技术有限公司 | A kind of image processing method and terminal |
CN109167893A (en) * | 2018-10-23 | 2019-01-08 | Oppo广东移动通信有限公司 | Shoot processing method, device, storage medium and the mobile terminal of image |
Also Published As
Publication number | Publication date |
---|---|
CN113950705A (en) | 2022-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10867430B2 (en) | Method and system of 3D reconstruction with volume-based filtering for image processing | |
US10284789B2 (en) | Dynamic generation of image of a scene based on removal of undesired object present in the scene | |
US11838606B2 (en) | Methods and systems for large-scale determination of RGBD camera poses | |
US9396399B1 (en) | Unusual event detection in wide-angle video (based on moving object trajectories) | |
EP3296952B1 (en) | Method and device for blurring a virtual object in a video | |
CN102148965B (en) | Video monitoring system for multi-target tracking close-up shooting | |
CN109313799B (en) | Image processing method and apparatus | |
US20180182114A1 (en) | Generation apparatus of virtual viewpoint image, generation method, and storage medium | |
CN111815517B (en) | Self-adaptive panoramic stitching method based on snapshot pictures of dome camera | |
JP2018151689A (en) | Image processing apparatus, control method thereof, program and storage medium | |
CN109981972B (en) | Target tracking method of robot, robot and storage medium | |
EP3629570A2 (en) | Image capturing apparatus and image recording method | |
CN111866523B (en) | Panoramic video synthesis method and device, electronic equipment and computer storage medium | |
CN106469435B (en) | Image processing method, device and equipment | |
US11812154B2 (en) | Method, apparatus and system for video processing | |
CN112640419B (en) | Following method, movable platform, device and storage medium | |
CN106791456A (en) | A kind of photographic method and electronic equipment | |
WO2022040988A1 (en) | Image processing method and apparatus, and movable platform | |
CN105467741A (en) | Panoramic shooting method and terminal | |
WO2020196520A1 (en) | Method, system and computer readable media for object detection coverage estimation | |
JP6483661B2 (en) | Imaging control apparatus, imaging control method, and program | |
CN113853559A (en) | Control method, device and equipment of movable platform and storage medium | |
KR101132976B1 (en) | Mobile device with a plurality of camera, method for display using the sane | |
JP2017021430A (en) | Panoramic video data processing device, processing method, and program | |
CN113327228B (en) | Image processing method and device, terminal and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20950660 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20950660 Country of ref document: EP Kind code of ref document: A1 |