WO2016082590A1 - 图片处理方法、装置和存储介质 - Google Patents
图片处理方法、装置和存储介质 Download PDFInfo
- Publication number
- WO2016082590A1 WO2016082590A1 PCT/CN2015/087385 CN2015087385W WO2016082590A1 WO 2016082590 A1 WO2016082590 A1 WO 2016082590A1 CN 2015087385 W CN2015087385 W CN 2015087385W WO 2016082590 A1 WO2016082590 A1 WO 2016082590A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- picture
- pictures
- pixel
- dynamic background
- merged
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 23
- 238000000034 method Methods 0.000 claims abstract description 85
- 238000001914 filtration Methods 0.000 claims abstract description 62
- 239000002131 composite material Substances 0.000 description 7
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- 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
Definitions
- Embodiments of the present invention relate to the field of image processing technologies, and in particular, to a picture processing method, apparatus, and storage medium.
- Photographing is an indispensable activity in people's lives, especially in tourist attractions. Photographing is even more indispensable. Especially the best places in the landscape, the more people take pictures.
- the embodiment of the invention provides a picture processing method, device and storage medium, so as to realize a picture with a clean background in a dynamic background such as a human stream.
- an embodiment of the present invention provides a picture processing method, including:
- At least three pictures taken during the shooting At least three pictures taken during the shooting
- the merged picture is displayed.
- an embodiment of the present invention provides a picture processing apparatus, including:
- a picture acquisition module for acquiring at least three pictures taken during shooting
- a picture processing module configured to perform a merge process on the at least three pictures according to a preset picture dynamic background filtering policy, to obtain a merged picture, where the picture dynamic background filtering policy is used to filter out the at least three pictures Dynamic background
- a picture display module for displaying the merged picture.
- an embodiment of the present invention provides a non-volatile computer storage medium, where the computer storage medium stores one or more modules, when the one or more modules are executed by a device that executes a picture processing method.
- the device is caused to perform the following operations:
- At least three pictures taken during the shooting At least three pictures taken during the shooting
- the merged picture is displayed.
- the image processing method, apparatus, and storage medium provided by the embodiments of the present invention acquire at least three pictures after the shooting target remains in the shooting process after acquiring at least three pictures taken during shooting.
- the middle is at the same position, and the dynamic background dynamically moves relative to the shooting target during shooting, so the dynamic background appears at different positions in the acquired at least three pictures, such that by filtering out the at least three pictures
- the strategy of the dynamic background, the merging of the at least three pictures can make the merged picture in the obtained only part that remains still during the shooting process, thereby realizing that the background is clean in a place with a dynamic background such as a stream of people.
- the purpose of the picture is to improve the performance of the camera device.
- FIG. 1 is a flowchart of a picture processing method according to Embodiment 1 of the present invention.
- FIG. 2 is a flowchart of a method for merging pictures in a picture processing method according to Embodiment 2 of the present invention
- FIG. 3 is a flowchart of a method for merging pictures in a picture processing method according to Embodiment 3 of the present invention.
- FIG. 4 is a flowchart of a picture processing method according to Embodiment 4 of the present invention.
- FIG. 5 is a schematic structural diagram of a picture processing apparatus according to Embodiment 5 of the present invention.
- FIG. 6 is a schematic structural diagram of hardware of an apparatus for performing a picture processing method according to Embodiment 7 of the present invention.
- the image processing method provided by the embodiment of the present invention can be applied to various digital cameras, smart cameras, and smart phones, and the like.
- the corresponding code implementation can be added on the basis of the existing camera application software (APP) such as Baidu Magic Shoot.
- APP camera application software
- FIG. 1 is a flowchart of a method for processing a picture according to Embodiment 1 of the present invention.
- the method of the embodiments of the present invention may be performed by a picture processing device configured to be implemented in hardware and/or software, which is typically configured in a device capable of providing picture capture and picture processing services (eg, camera or smart) In a mobile phone, or in a software application related to photographing in a device capable of providing picture capturing and image processing services, such as a camera or a smart phone.
- a picture processing device configured to be implemented in hardware and/or software, which is typically configured in a device capable of providing picture capture and picture processing services (eg, camera or smart) In a mobile phone, or in a software application related to photographing in a device capable of providing picture capturing and image processing services, such as a camera or a smart phone.
- a picture processing device configured to be implemented in hardware and/or software, which is typically configured in a device capable of providing picture capture and picture processing services (eg, camera
- the method includes operations 110 through 130.
- At least three pictures taken are taken during shooting.
- the shutter is continuously pressed for several seconds, and several pictures are continuously taken every fixed time (for example, 1 second), and then at least three pictures taken are acquired.
- At least three images obtained through this operation are usually for the same shooting location and are aimed at the same shooting target, but for a shooting location such as an attraction, the traffic is large, resulting in the same at least three images acquired.
- the shooting location is not limited to attractions, and the dynamic background is not limited to dynamic people.
- the coming and going vehicles and people flow can constitute a dynamic background of the shooting target.
- the attraction and the dynamic flow are taken as an example, but the scenic spot and the dynamic flow are not used to limit the present invention.
- the shooting target remains stationary during the shooting, causing the shooting target to remain stationary in at least three images acquired, in other words, at the same position in at least three images acquired; and the dynamic background is shooting During the process, the motion is dynamically moved relative to the shooting target, resulting in a dynamic background appearing at different positions in the acquired at least three pictures.
- the shooting target is located in the central area of the three pictures.
- a passerby dynamically passes the shooting target, resulting in the first picture taken by the passerby on the left side of the shooting target.
- the passerby is located on the left side of the subject, and the distance between the passerby and the subject is closer than the distance between the passerby and the subject in the first picture, and the passerby is located in the third picture.
- the right side of the subject is the shooting target.
- the at least three pictures are merged according to a preset picture dynamic background filtering policy, to obtain a merged picture, where the picture dynamic background filtering policy is used to filter out the dynamic background in the at least three pictures. .
- the operation specifically uses the picture dynamic background filtering policy to merge the at least three pictures, so that only the part that remains still during the shooting process is presented in the merged picture, and the dynamic background is filtered out.
- a new composite picture may be obtained, and the composite picture may exist independently of the obtained original picture, such as generating a new one.
- a blank picture is obtained by setting the image obtained by the merge processing to the blank picture; or a picture based on one of the at least three pictures of the original existing dynamic background acquired, and using the remaining pictures to the basic picture. The merging process is performed so that only the shooting target is presented in the base picture, and there is no dynamic background.
- the merged picture is displayed.
- the display function is a basic function of the photographing device, and here, the merged picture obtained by the operation 120 can be displayed based on the display function of the photographing device.
- the shooting target after acquiring at least three pictures taken during the shooting, since the shooting target remains stationary during the shooting, the shooting target is located at the same position in at least three acquired images, and the dynamic The background dynamically moves relative to the shooting target during shooting, so the dynamic background appears at different positions in the acquired at least three pictures, such that by filtering based on the dynamic background of the at least three pictures,
- the at least three pictures are combined and processed, so that only the part that remains still during the shooting process is presented in the merged picture, thereby realizing the purpose of capturing a clean picture in a place with a dynamic background such as a stream of people, and improving the photographing.
- the performance of the device enhances the user's photo experience.
- the method may further include:
- the obtained pre-ordered two pictures are displayed.
- combining the at least three pictures to obtain a merged picture which may include:
- the pixel value is used as the pixel value of the corresponding pixel in the merged picture; if the same pixel in the at least three pictures corresponds to multiple different The pixel value of the plurality of pixel values is used as the pixel value of the corresponding pixel in the merged picture.
- the foregoing combining the at least three pictures according to the preset picture dynamic background filtering policy to obtain the merged picture may include:
- the dynamic background regions of at least two of the at least three pictures are respectively removed;
- the dynamic background area of at least two of the at least two pictures is respectively removed, and the pixel values of the pixels in the dynamic background area of the at least two pictures are respectively set to zero;
- a combined picture which may be specifically: respectively: pixel values of the pixels that have undergone the culling process in the at least two pictures, and the at least three pictures In the other picture, the sum of the pixel values of the corresponding pixel points of the culling process is not performed as the pixel value of the corresponding pixel point in the merged picture.
- the at least two pictures may include at least one of the at least three pictures:
- the method may further include the following operations:
- the shooting time interval is set too small and the number of captured pictures is too small, the acquired adjacent pictures are not enough to capture the dynamic change of the dynamic background relative to the shooting target, so the number is very large. It is difficult to recognize the still part and the dynamic background in the captured picture, which affects the filtering effect of the dynamic background in the composite picture; if the shooting time interval is set too If the number of pictures taken is too small, the number of pictures acquired in the same area will be different, which will affect the dynamic background filtering effect in the composite picture. In this case, in order to ensure the composite picture. The good filtering effect of the dynamic background requires increasing the number of pictures taken, so that the new picture with the corresponding area remains still.
- FIG. 2 is a flowchart of a method for combining processing in a picture processing method according to Embodiment 2 of the present invention. The method is based on the preset picture dynamic background filtering policy, and the merging process is performed on the at least three pictures to obtain a merged picture, which includes: operations 210 to 220.
- the pixel values corresponding to the same pixel in the at least three pictures are counted.
- each pixel in the image may be traversed for each image acquired, and the pixel value corresponding to each pixel in the image may be counted; corresponding to each pixel in each obtained image. After the pixel value, the pixel value corresponding to the same pixel in each picture is counted; each pixel in each picture may be traversed in parallel, and the pixel value corresponding to the same pixel in each picture is traversed.
- the pixel value is used as the pixel value of the corresponding pixel in the merged picture; if the same pixel in the at least three pictures Corresponding to a plurality of different pixel values, pixel values that occur more frequently among the plurality of different pixel values are used as pixel values of corresponding pixel points in the merged picture.
- the pixel values corresponding to the same pixel point in the at least three pictures are the same, it indicates that the pixel point remains stationary in the at least three pictures, and thus the pixel value is used as a corresponding pixel point in the merged picture.
- the pixel value allows for the retention of the still part in the merged picture.
- the pixel is dynamically changed in the at least three pictures, because for a same pixel, a pixel that has fewer occurrences among a plurality of different pixel values is a dynamic background, and a plurality of different pixel values occur more frequently
- the pixel is a still part, so the pixel value of the plurality of different pixel values is used as the pixel value of the corresponding pixel in the merged picture, so that the still part is retained in the merged picture, and the dynamic part is filtered. background.
- the pixel values corresponding to a pixel in the three pictures are A, B, and B, respectively, and the pixel value B with more occurrences of two different pixel values of A and B is taken as Combines the pixel values of the corresponding pixels in the image.
- the pixel values corresponding to the same pixel point in at least three pictures obtained by statistics are taken as the unit of the same pixel in each picture, and the value of the pixel value of the same pixel point in each picture is used.
- the number of occurrences and the number of occurrences of the pixel value, the same pixel value corresponding to the same pixel point, or the pixel value corresponding to the number of occurrences corresponding to the same pixel point, is determined as the pixel value of the corresponding pixel point in the merged picture, to the pixel point
- the unit retains the still portion in the merged image and filters the dynamic background.
- the present embodiment provides another preferred solution for performing the operation of combining pictures by combining the at least three pictures based on a preset picture dynamic background filtering policy.
- FIG. 3 is a flowchart of a method for merging pictures in a picture processing method according to Embodiment 3 of the present invention.
- the method is based on the preset picture dynamic background filtering policy, and the merging process is performed on the at least three pictures to obtain a merged picture.
- the method includes: operations 310 to 340.
- operation 310 the pixel values corresponding to the same pixel in the at least three pictures are counted. This operation is similar to the above operation 210, and will not be described again here.
- a dynamic background area of each of the at least three pictures is determined according to a statistical pixel value, wherein the dynamic background area satisfies the condition that one of the at least three pictures In the dynamic background area, the pixel value of the pixel is different from the pixel value of the corresponding pixel in the corresponding area of the other picture.
- the operation is specifically based on pixel points, according to the pixel value corresponding to the same pixel in each picture.
- a dynamic background area of each of the at least three pictures is determined separately.
- the pixel value of a pixel in the first picture is A
- the pixel value of the corresponding pixel in the second picture is B
- the pixel value of the corresponding pixel in the third picture is B
- the pixel in the first picture constitutes one of the pixels in the dynamic background area of the picture
- the pixel value of the other pixel in the first picture is C
- the pixel of the corresponding pixel in the second picture The value is D
- the pixel value of the corresponding pixel in the third picture is D
- the pixel in the first picture constitutes another pixel in the dynamic background area of the picture.
- the pixel values of the pixel points in the dynamic background region of the at least two pictures may be respectively set to zero.
- the pixel value of the pixel that has undergone the culling process in the at least two pictures and the corresponding pixel that has not been subjected to the culling process in another one of the at least two pictures may be separately The sum of the pixel values of the points as the pixel values of the corresponding pixel points in the merged picture.
- the pixel point set of the pixel in the image is different from the pixel value of the corresponding pixel in the corresponding area of the other picture as the dynamic background area of the picture, and the area corresponding to the dynamic background area of the picture in the other picture. That is, the still part, in other words, the dynamic background area of a picture corresponds to the still part of other pictures, and the dynamic background area of different pictures is different, so the dynamic background areas of at least two pictures are respectively removed, and the culling is performed.
- the processed at least two pictures are merged to retain the still part in the resulting merged picture and filter the dynamic background.
- the pixel value corresponding to the same pixel point in at least three pictures obtained by statistics is taken as the unit of the same pixel in each picture, because the pixel value of the pixel point in a certain picture is compared with other pictures.
- a set of pixel points having different pixel values of corresponding pixels in the corresponding area is used as a dynamic background area of the picture, so the area corresponding to the dynamic background area of the picture in other pictures is a still part, and the dynamic background area in different pictures is different. Therefore, the dynamic background regions of at least two pictures are respectively removed, and at least two pictures subjected to the culling processing are combined to obtain the combined And keep the still part in the picture and filter the dynamic background.
- the at least two pictures preferably include at least one of the at least three pictures:
- the first way is to improve the rejection efficiency of the dynamic background area; the second way is to improve the definition of the composite picture.
- FIG. 4 is a flowchart of a method for processing a picture according to Embodiment 4 of the present invention.
- the method includes operations 410 through 450.
- operation 410 it is detected whether the shutter is pressed, and if so, operation 420 is performed, and if not, operation 410 is continued.
- operation 420 a picture is acquired and operation 430 is continued.
- operation 430 it is determined whether the number of pictures is greater than 2, and if so, operation 440 is performed; if not, operation 450 is performed.
- the operation is specifically performed when the number of acquired pictures is greater than 2, that is, when at least three pictures are acquired.
- the obtained at least three pictures are merged to obtain a merged picture
- the picture dynamic background filtering policy is used to filter out dynamics in the at least three pictures. background. It is beneficial for the user to intuitively know the filtering effect of the dynamic background in the merged picture.
- the user can continue to press the shutter operation, or press the shutter again, then trigger the new picture to be taken again, and perform the merge processing until the displayed merged picture is approved by the user, and the user no longer presses the shutter. until. Proceed to operation 450.
- operation 450 a picture is displayed, and operation 410 continues thereafter.
- operation 430 when it is determined in the above operation 430 that the number of pictures obtained is less than or equal to 2, if the first picture is acquired, the first picture is displayed, and if the second picture is obtained, the second picture is displayed; What is performed before this operation is operation 440, that is, if a merged picture has been obtained, this operation displays a merged picture.
- the shooting target after acquiring at least three pictures taken during the shooting, since the shooting target remains stationary during the shooting, the shooting target is located at the same position in at least three acquired images, and the dynamic The background dynamically moves relative to the shooting target during shooting, so the dynamic background appears at different positions in the acquired at least three pictures, such that by filtering based on the dynamic background of the at least three pictures,
- the at least three pictures are combined and processed, so that only the part that remains still during the shooting process is presented in the merged picture, thereby realizing the purpose of capturing a clean picture in a place with a dynamic background such as a stream of people, and improving the photographing.
- the performance of the device enhances the user's photo experience.
- FIG. 5 is a schematic structural diagram of a picture processing apparatus according to Embodiment 5 of the present invention.
- the device includes: a picture obtaining module 510, a picture processing module 520, and a picture display module 530.
- the image obtaining module 510 is configured to acquire at least three captured images during the shooting process, and the image processing module 520 is configured to combine the at least three images according to a preset dynamic background filtering policy to obtain a merge.
- a picture the picture dynamic background filtering policy is used to filter out the dynamic background in the at least three pictures;
- the picture display module 530 is configured to display the merged picture.
- the shooting target after acquiring at least three pictures taken during the shooting, since the shooting target remains stationary during the shooting, the shooting target is located at the same position in at least three acquired images, and the dynamic The background dynamically moves relative to the shooting target during shooting, so the dynamic background appears at different positions in the acquired at least three pictures, such that by filtering based on the dynamic background of the at least three pictures,
- the at least three pictures are combined and processed, so that only the part that remains still during the shooting process is presented in the merged picture, and the dynamic background is filtered out, thereby realizing a clean picture in a place with a dynamic background such as a stream of people.
- the purpose is to improve the performance of the camera device and improve the user's photo experience.
- the image processing module 520 may be specifically configured to:
- the pixel value is used as the pixel value of the corresponding pixel in the merged picture; if the same pixel in the at least three pictures corresponds to multiple different The pixel value of the plurality of pixel values is used as the pixel value of the corresponding pixel in the merged picture.
- the image processing module 520 may include: a pixel value statistics sub-module, a dynamic area determination sub-module, a dynamic area processing sub-module, and a picture merge sub-module.
- the pixel value statistics sub-module is configured to collect pixel values corresponding to the same pixel point in the at least three pictures; the dynamic area determining sub-module is configured to determine the at least the pixel value according to the pixel value statistics sub-module.
- a dynamic background area of each of the three pictures wherein the dynamic background area satisfies the condition that: in a dynamic background area of one of the at least three pictures, a pixel value of the pixel corresponds to another picture The pixel values of the corresponding pixels in the area are different;
- the dynamic area processing sub-module is configured to respectively remove the dynamic background areas of at least two of the at least three pictures; the picture merging sub-module is used to pass the dynamic area processing sub- At least two pictures of the module culling process are merged to obtain a merged picture.
- the dynamic area processing sub-module may be specifically configured to: respectively set a pixel value of a pixel point in a dynamic background area of the at least two pictures to be zero; the picture merging sub-module is specifically configured to: separately a pixel value of a pixel that has undergone the culling process in the at least two pictures, and a sum of pixel values of corresponding pixel points of the other one of the at least three pictures that have not been subjected to the culling process, As the pixel value of the corresponding pixel in the merged picture.
- the at least two pictures processed by the dynamic area processing sub-module may include at least one of the at least three pictures:
- the picture obtaining module 510 is further configured to be used in the picture processing module 520.
- the picture processing module 520 is further configured to use the dynamic background filtering policy of the picture to view the at least three pictures and the The new picture performs the operation of the merge process.
- the picture display module 530 may be further configured to perform, after the picture processing module 520 performs a merge process on the at least three pictures based on a preset picture dynamic background filtering policy, to obtain a merged picture.
- the image processing apparatus provided by the embodiment of the present invention may perform the image processing method provided by any embodiment of the present invention, and has a function module and a beneficial effect corresponding to the execution method.
- At least three pictures taken during the shooting At least three pictures taken during the shooting
- the merged picture is displayed.
- the merging process of the at least three images to obtain a merged image may be performed according to a preset dynamic background filtering policy.
- the pixel value is used as the pixel value of the corresponding pixel in the merged picture; if the same pixel in the at least three pictures corresponds to multiple different The pixel value of the plurality of pixel values is used as the pixel value of the corresponding pixel in the merged picture.
- the merging process of the at least three images to obtain a merged image may be performed according to a preset dynamic background filtering policy.
- the dynamic background regions of at least two of the at least three pictures are respectively removed;
- the dynamic background regions of at least two of the at least three pictures are respectively removed, and specifically, the dynamic background area of the at least two pictures is The pixel values of the pixels are respectively set to zero;
- the at least two pictures may include at least one of the at least three pictures:
- the method may further include:
- the method may further include: combining the at least three pictures according to a preset picture dynamic background filtering policy to obtain a merged picture, the method may further include:
- the obtained pre-ordered two pictures are displayed.
- FIG. 6 a hardware node of a device for performing a picture processing method according to Embodiment 7 of the present invention is provided. Schematic diagram.
- the device includes:
- One or more processors 610, one processor 610 is taken as an example in FIG. 6;
- Memory 620 and one or more modules.
- the device may also include an input device 630 and an output device 640.
- the processor 610, the memory 620, the input device 630, and the output device 640 in the device may be connected by a bus or other means, and the bus connection is taken as an example in FIG.
- the memory 620 is used as a computer readable storage medium, and can be used to store a software program, a computer executable program, and a module, such as a program instruction/module corresponding to the image processing method in the embodiment of the present invention (for example, the image shown in FIG.
- the processor 610 executes various functional applications and data processing of the device by executing software programs, instructions, and modules stored in the memory 620, that is, implementing the image processing method in the above method embodiments.
- the memory 620 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the terminal device, and the like.
- memory 620 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
- memory 620 can further include memory remotely located relative to processor 610, which can be connected to the terminal device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- Input device 630 can be used to receive input digital or character information and to generate key signal inputs related to user settings and function control of the terminal.
- the output device 640 can include a display device such as a display screen.
- the one or more modules are stored in the memory 620, and when executed by the one or more processors 610, perform the following operations:
- At least three pictures taken during the shooting At least three pictures taken during the shooting
- the merged picture is displayed.
- the combining the at least three pictures to obtain the merged picture based on the preset picture dynamic background filtering policy may include:
- the pixel value is used as the pixel value of the corresponding pixel in the merged picture; if the same pixel in the at least three pictures corresponds to multiple different The pixel value of the plurality of pixel values is used as the pixel value of the corresponding pixel in the merged picture.
- the combining the at least three pictures to obtain the merged picture based on the preset picture dynamic background filtering policy may include:
- the dynamic background regions of at least two of the at least three pictures are respectively removed;
- the dynamic background regions of at least two of the at least two pictures are respectively removed, and the pixel values of the pixels in the dynamic background region of the at least two pictures are respectively set to zero;
- a combined picture which may be specifically: respectively: pixel values of the pixels that have undergone the culling process in the at least two pictures, and the at least three pictures In the other picture, the sum of the pixel values of the corresponding pixel points of the culling process is not performed as the pixel value of the corresponding pixel point in the merged picture.
- the at least two pictures may include at least one of the at least three pictures:
- the method may further include:
- the method may further include: before the merged picture is obtained, based on the preset picture dynamic background filtering policy, the method may further include:
- the obtained pre-ordered two pictures are displayed.
- the present invention can be implemented by software and necessary general hardware, and can also be implemented by hardware, but in many cases, the former is a better implementation. .
- the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk of a computer. , Read-Only Memory (ROM), Random Access Memory (RAM), Flash (FLASH), hard disk or optical disk, etc., including a number of instructions to make a computer device (can be a personal computer)
- the server, or network device, etc. performs the methods described in various embodiments of the present invention.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
一种图片处理方法、装置和存储介质。该方法包括:在拍摄过程中,获取拍摄的至少三张图片(110);基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片(120),所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;显示所述合并图片(130)。通过所述过滤策略对至少三张图片进行合并处理,能够使得到的合并图片中只呈现在拍摄过程中保持静止的部分,而滤除动态背景,使用户得到背景干净的图片,提升了用户拍照体验。
Description
本专利申请要求于2014年11月27日提交的、申请号为201410709150.X、申请人为百度在线网络技术(北京)有限公司、发明名称为“图片处理方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
本发明实施例涉及图像处理技术领域,尤其涉及一种图片处理方法、装置和存储介质。
拍照是人们生活中不可缺少的一项活动,尤其在旅游景点,拍照更不可或缺。特别是景观最好的地方,拍照的人越多。
但是景观越好,参观的人越多,特别是节假日,如果要想在景观比较好的地方拍照,必须等到没人的时候才能拍到背景比较干净的照片,否则拍到的照片中总有不期望的人或物(即动态背景)。
然而,目前尚未有在拍照时去除背景中不期望的人或物的技术,使得拍照设备还无法在有人流的地方拍出背景干净的照片。
发明内容
本发明实施例提供一种图片处理方法、装置和存储介质,以实现在有人流等动态背景的地方拍摄到背景干净的图片。
第一方面,本发明实施例提供了一种图片处理方法,包括:
在拍摄过程中,获取拍摄的至少三张图片;
基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动
态背景;
显示所述合并图片。
第二方面,本发明实施例提供了一种图片处理装置,包括:
图片获取模块,用于在拍摄过程中,获取拍摄的至少三张图片;
图片处理模块,用于基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;
图片显示模块,用于显示所述合并图片。
第三方面,本发明实施例提供了一种非易失性计算机存储介质,所述计算机存储介质存储有一个或者多个模块,当所述一个或者多个模块被一个执行图片处理方法的设备执行时,使得所述设备执行如下操作:
在拍摄过程中,获取拍摄的至少三张图片;
基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;
显示所述合并图片。
本发明实施例提供的图片处理方法、装置和存储介质,在获取到拍摄过程中拍摄的至少三张图片之后,由于拍摄目标在拍摄过程中保持静止,因此拍摄目标在获取到的至少三张图片中位于相同的位置,而动态背景在拍摄过程中相对于拍摄目标动态运动,因此动态背景出现在获取到的至少三张图片中不同的位置,这样,通过基于滤除所述至少三张图片中的动态背景的策略,对所述至少三张图片进行合并处理,能够使得到的合并图片中只呈现在拍摄过程中保持静止的部分,从而实现了在有人流等动态背景的地方拍摄到背景干净的图片的目的,提高了拍照设备的性能。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所
需使用的附图作简单地介绍,当然,以下描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以对这些附图进行修改和替换。
图1为本发明实施例一提供的一种图片处理方法的流程图;
图2为本发明实施例二提供的一种图片处理方法中合并图片的方法的流程图;
图3为本发明实施例三提供的一种图片处理方法中合并图片的方法的流程图;
图4为本发明实施例四提供的一种图片处理方法的流程图;
图5为本发明实施例五提供的一种图片处理装置的结构示意图;
图6本发明实施例七提供的一种执行图片处理方法的设备的硬件结构示意图。
下面将结合附图对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例,是为了阐述本发明的原理,而不是要将本发明限制于这些具体的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供的图片处理方法可应用于各种数码相机、智能相机和智能手机等可拍照的设备中。实现时,可在现有的拍照应用软件(APP)如百度魔拍的基础上,增加相应的代码实现。
实施例一
请参阅图1,为本发明实施例一提供的一种图片处理方法的流程图。本发明实施例的方法可以由配置以硬件和/或软件实现的图片处理装置来执行,该实现装置典型的是配置于能够提供图片拍摄和图片处理服务的设备(如,相机或智
能手机)中,或者配置于能够提供图片拍摄和图片处理服务的设备(如,相机或智能手机)中的与拍照有关的软件应用中。
该方法包括:操作110~操作130。
操作110中,在拍摄过程中,获取拍摄的至少三张图片。
本操作具体可以是,在拍摄过程中首先连续按下快门数秒,每隔固定时间(例如1秒)连续拍摄数张图片,然后获取拍摄的至少三张图片。
通过本操作获取的至少三张图片,通常针对的是同一个拍摄地点,且针对的是相同的拍摄目标,但是对于景点这样的拍摄地点,人流量较大,导致获取的至少三张图片中相同的拍摄目标周边存在动态背景,该动态背景可以是动态人流。
需要说明的是,拍摄地点并不局限于景点,动态背景也不局限于动态人流。例如,在户外某个街景,来来往往的车辆和人流都可以构成拍摄目标的动态背景,本实施例以景点和动态人流为例进行说明,但景点和动态人流并不用于限制本发明。
还需要说明的是,拍摄目标在拍摄过程中保持静止,导致拍摄目标在获取到的至少三张图片中保持静止,换言之,在获取的至少三张图片中位于相同的位置;而动态背景在拍摄过程中相对于拍摄目标动态运动,导致动态背景出现在获取到的至少三张图片中不同的位置。以三张图片为例进行说明,假设拍摄目标位于三张图片的中央区域,在拍摄过程中,某路人动态经过拍摄目标,导致获取到的第一张图片中该路人位于该拍摄目标的左侧,第二张图片中该路人位于该拍摄目标的左侧,且该路人与拍摄目标之间的距离比第一张图片中路人与拍摄目标之间的距离近,第三张图片中该路人位于该拍摄目标的右侧。
操作120中,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景。
本操作具体是利用所述图片动态背景过滤策略,对所述至少三张图片进行合并处理,使得到的合并图片中只呈现在拍摄过程中保持静止的部分,而滤除动态背景。
本操作中,可以是对获取到的原始的存在动态背景的至少三张图片合并处理后,得到一张新的合成图片,该合成图片可以独立于获取到的原始图片而存在,如生成新的空白图片,将合并处理得到的图像设置于该空白图片得到;也可以是以获取到的原始的存在动态背景的至少三张图片中的某一张图片为基础图片,利用其余图片对该基础图片进行合并处理,使得该基础图片中只呈现拍摄目标,而没有动态背景。
操作130中,显示所述合并图片。显示功能为拍照设备的基本功能,这里,可以基于拍照设备的显示功能显示操作120得到的合并图片。
本实施例的技术方案,在获取到拍摄过程中拍摄的至少三张图片之后,由于拍摄目标在拍摄过程中保持静止,因此拍摄目标在获取到的至少三张图片中位于相同的位置,而动态背景在拍摄过程中相对于拍摄目标动态运动,因此动态背景出现在获取到的至少三张图片中不同的位置,这样,通过基于滤除所述至少三张图片中的动态背景的策略,对所述至少三张图片进行合并处理,能够使得到的合并图片中只呈现在拍摄过程中保持静止的部分,从而实现了在有人流等动态背景的地方拍摄到背景干净的图片的目的,提高了拍照设备的性能,提升了用户拍照体验。
在本实施例的基础上,在基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,所述方法还可以包括:
显示获取的前序两张图片。
通过显示获取的前序两张图片,并显示所述合并图片,有利于使用户直观地获知合并图片中动态背景的滤除效果。
上述基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
或者,上述基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
根据统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;
将所述至少三张图片中至少两张图片的动态背景区域分别剔除;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片。
其中,将所述至少三张图片中至少两张图片的动态背景区域分别剔除,具体可为:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片,可具体为:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
其中,所述至少两张图片可包括所述至少三张图片中的以下至少一张图片:
所述动态背景区域面积最小的图片;
清晰度最高的图片。
进一步地,在对所述至少三张图片进行合并处理,得到合并图片之后,所述方法还可以包括如下操作:
获取拍摄的新图片;
基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
需要说明的是,如果拍摄时间间隔设定的太小,且获取拍摄的图片的数量太少,则导致获取到的相邻的图片来不及捕获动态背景相对于拍摄目标的动态变化,因此从数量很少的拍摄图片很难识别拍摄到的图片中的静止部分和动态背景,从而影响合成图片中动态背景的过滤效果;如果拍摄时间间隔设定的太
大,且获取拍摄的图片的数量太少,则导致获取到的数量较少的各图片中同一区域出现不同的动态背景,从而影响合成图片中动态背景的过滤效果,此时为了保证合成图片中动态背景的良好的过滤效果,需要增加拍摄的图片数量,从而得到对应区域保持静止的新拍摄图片,虽然可以滤除新合成的图片中的动态背景,但耗时较长;因此,选取合适的拍摄时间间隔和获取合适数量的拍摄到的图片,有利于保证合成图片中动态背景的过滤效果,同时有利于提升动态背景滤除效率。
实施例二
本实施例在上述实施例的基础上,提供了基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片这一操作的一优选方案。请参阅图2,为本发明实施例二提供的一种图片处理方法中合并处理的方法流程图。该方法基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,具体包括:操作210~操作220。
操作210中,统计所述至少三张图片中同一像素点对应的像素值。
本操作中,可以对获取到的各张图片,遍历该图片中每个像素点,并统计该图片中每个像素点对应的像素值;在得到获取到的各张图片中每个像素点对应的像素值之后,统计所述各张图片中同一像素点对应的像素值;也可以并行遍历各张图片中每个像素点,边遍历边统计各张图片中同一像素点对应的像素值。
操作220中,如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
其中,如果所述至少三张图片中同一像素点对应的像素值相同,则表明该像素点在所述至少三张图片中保持静止,因此将该像素值作为所述合并图片中对应像素点的像素值,可以实现在合并图片中保留了静止部分。
相应地,如果所述至少三张图片中同一像素点对应多个不同的像素值,则
表明该像素点在所述至少三张图片中动态变化,由于对于同一像素点,多个不同的像素值中出现次数较少的像素点为动态背景,多个不同的像素值中出现次数较多的像素点为静止部分,因此将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值,可以实现合并图片中保留了静止部分,同时过滤了动态背景。
例如,以三张图片为例,三张图片中某个像素点对应的像素值分别为A、B和B,则将A和B两个不同的像素值中出现次数较多的像素值B作为合并图片中对应像素点的像素值。
本实施例的技术方案,以各张图片中同一像素点为单位,通过统计获取的至少三张图片中同一像素点对应的像素值,并根据各张图片中同一像素点的像素值的取值个数、以及像素值的出现次数,将同一像素点对应的相同的像素值,或者同一像素点对应的出现次数较多的像素值,确定为合并图片中对应像素点的像素值,以像素点为单位在合并图片中保留了静止部分,并过滤了动态背景。
实施例三
本实施例在上述实施例一的基础上,提供了基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片这一操作的另一优选方案。
请参阅图3,为本发明实施例三提供的一种图片处理方法中合并图片的方法的流程图。该方法基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,具体包括:操作310~操作340。
操作310中,统计所述至少三张图片中同一像素点对应的像素值。该操作与上述操作210类似,这里不再赘述。
操作320中,根据统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同。
本操作具体是以像素点为单位,根据各张图片中同一像素点对应的像素值
分别确定所述至少三张图片中各图片的动态背景区域。
以三张图片为例进行说明,第一张图片中某个像素点的像素值为A,第二张图片中对应像素点的像素值为B,第三张图片中对应像素点的像素值为B,则第一张图片中该像素点构成该图片的动态背景区域中的其中一个像素点;第一张图片中另一个像素点的像素值为C,第二张图片中对应像素点的像素值为D,第三张图片中对应像素点的像素值为D,则第一张图片中该像素点构成该图片的动态背景区域中的另一个像素点。
操作330中,将所述至少三张图片中至少两张图片的动态背景区域分别剔除。
具体地,可以将所述至少两张图片的动态背景区域中的像素点的像素值分别置零。
操作340中,将经过所述剔除处理的至少两张图片进行合并,得到合并图片。
具体地,可以分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
由于将某张图片中像素点的像素值与其他图片的对应区域中对应像素点的像素值不同的像素点集合作为该图片的动态背景区域,其他图片中与该图片的动态背景区域对应的区域即为静止部分,换言之,某张图片中动态背景区域对应于其他图片的静止部分,且不同图片中动态背景区域不同,因此将至少两张图片的动态背景区域分别剔除,并将经过所述剔除处理的至少两张图片进行合并,能够在得到的合并图片中保留静止部分,并过滤动态背景。
本实施例的技术方案,以各张图片中同一像素点为单位,通过统计获取的至少三张图片中同一像素点对应的像素值,由于将某张图片中像素点的像素值与其他图片的对应区域中对应像素点的像素值不同的像素点集合作为该图片的动态背景区域,因此其他图片中与该图片的动态背景区域对应的区域即为静止部分,且不同图片中动态背景区域不同,因此将至少两张图片的动态背景区域分别剔除,并将经过所述剔除处理的至少两张图片进行合并,能够在得到的合
并图片中保留静止部分,并过滤动态背景。
在本实施例中,所述至少两张图片优选包括所述至少三张图片中的以下至少一张图片:
所述动态背景区域面积最小的图片;
清晰度最高的图片。
第一种方式,有利于提高动态背景区域的剔除效率;第二种方式,有利于提高合成图片的清晰度。
实施例四
请参阅图4,为本发明实施例四提供的一种图片处理方法的流程图。该方法包括:操作410~操作450。
操作410中,检测快门是否按下,若是,则执行操作420,若否,则继续执行操作410。
操作420中,获取一张图片,继续执行操作430。
操作430中,判断图片数量是否大于2,若是,则执行操作440;若否,则执行操作450。
本操作具体是在获取的图片数量大于2时,也即获取到至少三张图片时,执行下述图片合并操作。
操作440中,基于预设的图片动态背景过滤策略,对获取到的至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景。有利于使用户直观地获知合并图片中动态背景的滤除效果。当用户不满意时,可继续保持按快门操作,或者再次按下快门,之后再次触发获取拍摄的新图片,并进行合并处理操作,直至显示的合并图片得到用户的认可,用户不再按下快门为止。继续执行操作450。
其中,基于预设的图片动态背景过滤策略,对获取到的至少三张图片进行合并处理,得到合并图片,同样适用于实施例二和实施例三中的具体操作,不再赘述。
操作450中,显示图片,之后继续执行操作410。
具体地,在上述操作430中判断获得的图片数量小于等于2时,如获取的是第一张图片,则显示第一张图片,若获取的是第二张图片,则显示第二张图片;在本操作之前执行的是操作440时,即如果已经得到合并图片,则本操作显示的是合并图片。
本实施例的技术方案,在获取到拍摄过程中拍摄的至少三张图片之后,由于拍摄目标在拍摄过程中保持静止,因此拍摄目标在获取到的至少三张图片中位于相同的位置,而动态背景在拍摄过程中相对于拍摄目标动态运动,因此动态背景出现在获取到的至少三张图片中不同的位置,这样,通过基于滤除所述至少三张图片中的动态背景的策略,对所述至少三张图片进行合并处理,能够使得到的合并图片中只呈现在拍摄过程中保持静止的部分,从而实现了在有人流等动态背景的地方拍摄到背景干净的图片的目的,提高了拍照设备的性能,提升了用户拍照体验。
实施例五
请参阅图5,为本发明实施例五提供的一种图片处理装置的结构示意图。该装置包括:图片获取模块510、图片处理模块520和图片显示模块530。
其中,图片获取模块510用于在拍摄过程中,获取拍摄的至少三张图片;图片处理模块520用于基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;图片显示模块530用于显示所述合并图片。
本实施例的技术方案,在获取到拍摄过程中拍摄的至少三张图片之后,由于拍摄目标在拍摄过程中保持静止,因此拍摄目标在获取到的至少三张图片中位于相同的位置,而动态背景在拍摄过程中相对于拍摄目标动态运动,因此动态背景出现在获取到的至少三张图片中不同的位置,这样,通过基于滤除所述至少三张图片中的动态背景的策略,对所述至少三张图片进行合并处理,能够使得到的合并图片中只呈现在拍摄过程中保持静止的部分,而滤除动态背景,从而实现了在有人流等动态背景的地方拍摄到背景干净的图片的目的,提高了拍照设备的性能,提升了用户拍照体验。
作为本实施例的一种优选的实施方式,所述图片处理模块520具体可以用于:
统计所述至少三张图片中同一像素点对应的像素值;
如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
作为本实施例的另一种优选的实施方式所述图片处理模块520可以包括:像素值统计子模块、动态区域确定子模块、动态区域处理子模块和图片合并子模块。
其中,像素值统计子模块用于统计所述至少三张图片中同一像素点对应的像素值;动态区域确定子模块用于根据所述像素值统计子模块统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;动态区域处理子模块用于将所述至少三张图片中至少两张图片的动态背景区域分别剔除;图片合并子模块用于将经过所述动态区域处理子模块剔除处理的至少两张图片进行合并,得到合并图片。
进一步地,所述动态区域处理子模块具体可以用于:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;所述图片合并子模块具体用于:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
进一步地,所述动态区域处理子模块进行处理的所述至少两张图片,可以包括所述至少三张图片中的以下至少一张图片:
所述动态背景区域面积最小的图片;
清晰度最高的图片。
在上述方案中,所述图片获取模块510还可以用于在所述图片处理模块520
对所述至少三张图片进行合并处理,得到合并图片之后,获取拍摄的新图片;所述图片处理模块520还可以用于基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
在上述方案中,所述图片显示模块530还可以用于在所述图片处理模块520基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,显示所述图片获取模块510获取的前序两张图片。
本发明实施例提供的图片处理装置可执行本发明任意实施例所提供的图片处理方法,具备执行方法相应的功能模块和有益效果。
实施例六
本实施例提供一种非易失性计算机存储介质,所述计算机存储介质存储有一个或者多个模块,当所述一个或者多个模块被一个执行图片处理方法的设备执行时,使得所述设备执行如下操作:
在拍摄过程中,获取拍摄的至少三张图片;
基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;
显示所述合并图片。
上述存储介质中存储的模块被所述设备执行时,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
上述存储介质中存储的模块被所述设备执行时,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
根据统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;
将所述至少三张图片中至少两张图片的动态背景区域分别剔除;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片。
上述存储介质中存储的模块被所述设备执行时,将所述至少三张图片中至少两张图片的动态背景区域分别剔除,具体可以为:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片,具体可以为:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
上述存储介质中存储的模块被所述设备执行时,所述至少两张图片可包括所述至少三张图片中的以下至少一张图片:
所述动态背景区域面积最小的图片;
清晰度最高的图片。
上述存储介质中存储的模块被所述设备执行时,在对所述至少三张图片进行合并处理,得到合并图片之后,所述方法还可包括:
获取拍摄的新图片;
基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
上述存储介质中存储的模块被所述设备执行时,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,所述方法还可包括:
显示获取的前序两张图片。
实施例七
请参阅图6,本发明实施例七提供的一种执行图片处理方法的设备的硬件结
构示意图。
该设备包括:
一个或者多个处理器610,图6中以一个处理器610为例;
存储器620;以及一个或者多个模块。
所述设备还可以包括:输入装置630和输出装置640。所述设备中的处理器610、存储器620、输入装置630和输出装置640可以通过总线或其他方式连接,图6中以通过总线连接为例。
存储器620作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本发明实施例中的图片处理方法对应的程序指令/模块(例如,附图5所示的图片处理装置中的图片获取模块510、图片处理模块520和图片显示模块530)。处理器610通过运行存储在存储器620中的软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述方法实施例中的图片处理方法。
存储器620可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器620可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器620可进一步包括相对于处理器610远程设置的存储器,这些远程存储器可以通过网络连接至终端设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置630可用于接收输入的数字或字符信息,以及产生与终端的用户设置以及功能控制有关的键信号输入。输出装置640可包括显示屏等显示设备。
所述一个或者多个模块存储在所述存储器620中,当被所述一个或者多个处理器610执行时,执行如下操作:
在拍摄过程中,获取拍摄的至少三张图片;
基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;
显示所述合并图片。
进一步地,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
进一步地,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,可包括:
统计所述至少三张图片中同一像素点对应的像素值;
根据统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;
将所述至少三张图片中至少两张图片的动态背景区域分别剔除;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片。
进一步地,将所述至少三张图片中至少两张图片的动态背景区域分别剔除,可具体为:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;
将经过所述剔除处理的至少两张图片进行合并,得到合并图片,可具体为:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
进一步地,所述至少两张图片可包括所述至少三张图片中的以下至少一张图片:
所述动态背景区域面积最小的图片;
清晰度最高的图片。
进一步地,在对所述至少三张图片进行合并处理,得到合并图片之后,所述方法还可包括:
获取拍摄的新图片;
基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
进一步地,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,所述方法还可包括:
显示获取的前序两张图片。
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本发明可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
值得注意的是,上述图片处理装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明披露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。
Claims (15)
- 一种图片处理方法,其特征在于,包括:在拍摄过程中,获取拍摄的至少三张图片;基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;显示所述合并图片。
- 根据权利要求1所述的方法,其特征在于,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,包括:统计所述至少三张图片中同一像素点对应的像素值;如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
- 根据权利要求1所述的方法,其特征在于,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,包括:统计所述至少三张图片中同一像素点对应的像素值;根据统计的像素值分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;将所述至少三张图片中至少两张图片的动态背景区域分别剔除;将经过所述剔除处理的至少两张图片进行合并,得到合并图片。
- 根据权利要求3所述的方法,其特征在于,将所述至少三张图片中至少两张图片的动态背景区域分别剔除,具体为:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;将经过所述剔除处理的至少两张图片进行合并,得到合并图片,具体为:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之 和,作为所述合并图片中对应像素点的像素值。
- 根据权利要求3或4所述的方法,其特征在于,所述至少两张图片包括所述至少三张图片中的以下至少一张图片:所述动态背景区域面积最小的图片;清晰度最高的图片。
- 根据权利要求1-5任一所述的方法,其特征在于,在对所述至少三张图片进行合并处理,得到合并图片之后,所述方法还包括:获取拍摄的新图片;基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
- 根据权利要求1-6任一所述的方法,其特征在于,基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,所述方法还包括:显示获取的前序两张图片。
- 一种图片处理装置,其特征在于,包括:图片获取模块,用于在拍摄过程中,获取拍摄的至少三张图片;图片处理模块,用于基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;图片显示模块,用于显示所述合并图片。
- 根据权利要求8所述的装置,其特征在于,所述图片处理模块具体用于:统计所述至少三张图片中同一像素点对应的像素值;如果所述至少三张图片中同一像素点对应的像素值相同,则将该像素值作为所述合并图片中对应像素点的像素值;如果所述至少三张图片中同一像素点对应多个不同的像素值,则将多个不同的像素值中出现次数较多的像素值作为所述合并图片中对应像素点的像素值。
- 根据权利要求8所述的装置,其特征在于,所述图片处理模块包括:像素值统计子模块,用于统计所述至少三张图片中同一像素点对应的像素 值;动态区域确定子模块,用于根据所述像素值统计子模块统计的像素值,分别确定所述至少三张图片中各图片的动态背景区域,其中,所述动态背景区域满足下述条件:所述至少三张图片中的一张图片的动态背景区域中,像素点的像素值与其他图片的对应区域中对应像素点的像素值不同;动态区域处理子模块,用于将所述至少三张图片中至少两张图片的动态背景区域分别剔除;图片合并子模块,用于将经过所述动态区域处理子模块剔除处理的至少两张图片进行合并,得到合并图片。
- 根据权利要求10所述的装置,其特征在于,所述动态区域处理子模块具体用于:将所述至少两张图片的动态背景区域中的像素点的像素值分别置零;所述图片合并子模块具体用于:分别将所述至少两张图片中经过所述剔除处理的像素点的像素值,与所述至少三张图片中的另外一张图片中未做过所述剔除处理的对应的像素点的像素值之和,作为所述合并图片中对应像素点的像素值。
- 根据权利要求10或11所述的装置,其特征在于,所述动态区域处理子模块进行处理的所述至少两张图片,包括所述至少三张图片中的以下至少一张图片:所述动态背景区域面积最小的图片;清晰度最高的图片。
- 根据权利要求8-12任一所述的装置,其特征在于:所述图片获取模块还用于在所述图片处理模块对所述至少三张图片进行合并处理,得到合并图片之后,获取拍摄的新图片;所述图片处理模块还用于基于所述图片动态背景过滤策略,对所述至少三张图片和所述新图片进行所述合并处理的操作。
- 根据权利要求8-13任一所述的装置,其特征在于:所述图片显示模块还用于在所述图片处理模块基于预设的图片动态背景过 滤策略,对所述至少三张图片进行合并处理,得到合并图片之前,显示所述图片获取模块获取的前序两张图片。
- 一种非易失性计算机存储介质,所述计算机存储介质存储有一个或者多个模块,其特征在于,当所述一个或者多个模块被一个执行图片处理方法的设备执行时,使得所述设备执行如下操作:在拍摄过程中,获取拍摄的至少三张图片;基于预设的图片动态背景过滤策略,对所述至少三张图片进行合并处理,得到合并图片,所述图片动态背景过滤策略用于滤除所述至少三张图片中的动态背景;显示所述合并图片。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410709150.XA CN104361572B (zh) | 2014-11-27 | 2014-11-27 | 图片处理方法和装置 |
CN201410709150.X | 2014-11-27 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016082590A1 true WO2016082590A1 (zh) | 2016-06-02 |
Family
ID=52528830
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/087385 WO2016082590A1 (zh) | 2014-11-27 | 2015-08-18 | 图片处理方法、装置和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104361572B (zh) |
WO (1) | WO2016082590A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111401477A (zh) * | 2020-04-17 | 2020-07-10 | Oppo广东移动通信有限公司 | 图像处理方法、装置、电子设备和计算机可读存储介质 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104361572B (zh) * | 2014-11-27 | 2017-12-29 | 百度在线网络技术(北京)有限公司 | 图片处理方法和装置 |
CN111107261A (zh) * | 2018-10-25 | 2020-05-05 | 华勤通讯技术有限公司 | 照片生成方法和设备 |
CN109727266A (zh) * | 2019-01-08 | 2019-05-07 | 青岛一舍科技有限公司 | 一种基于视频获取纯景致背景的目标人物照片的方法 |
CN110222207B (zh) * | 2019-05-24 | 2021-03-30 | 珠海格力电器股份有限公司 | 图片的整理方法、装置和智能终端 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09102910A (ja) * | 1995-10-03 | 1997-04-15 | Nippon Hoso Kyokai <Nhk> | 動画像処理装置および方法 |
CN102592128A (zh) * | 2011-12-20 | 2012-07-18 | Tcl集团股份有限公司 | 一种动态图像检测处理方法、装置及显示终端 |
CN103679749A (zh) * | 2013-11-22 | 2014-03-26 | 北京奇虎科技有限公司 | 一种基于运动目标跟踪的图像处理方法及装置 |
CN103856617A (zh) * | 2012-12-03 | 2014-06-11 | 联想(北京)有限公司 | 一种拍照方法和用户终端 |
CN103971381A (zh) * | 2014-05-16 | 2014-08-06 | 江苏新瑞峰信息科技有限公司 | 一种多目标跟踪系统及方法 |
CN104361572A (zh) * | 2014-11-27 | 2015-02-18 | 百度在线网络技术(北京)有限公司 | 图片处理方法和装置 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5880739A (en) * | 1995-06-06 | 1999-03-09 | Compaq Computer Corporation | Blitting of images using instructions |
JP2009512038A (ja) * | 2005-10-12 | 2009-03-19 | アクティブ オプティクス ピーティーワイ リミテッド | 複数の画像フレームに基づいて結合画像を生成する方法 |
CN101261681B (zh) * | 2008-03-31 | 2011-07-20 | 北京中星微电子有限公司 | 智能视频监控中的路面图像提取方法及装置 |
RU2395787C2 (ru) * | 2008-05-19 | 2010-07-27 | Государственный Научный Центр России "Государственное Научное Учреждение "Центральный Научно-Исследовательский И Опытно-Конструкторский Институт Робототехники И Технической Кибернетики"(Цнии Ртк) | Способ обнаружения объектов |
JP5133816B2 (ja) * | 2008-08-22 | 2013-01-30 | オリンパスイメージング株式会社 | カメラ、画像合成方法、およびプログラム |
CN103136537B (zh) * | 2012-12-12 | 2017-02-08 | 惠州学院 | 一种基于支持向量机的车型识别方法 |
-
2014
- 2014-11-27 CN CN201410709150.XA patent/CN104361572B/zh active Active
-
2015
- 2015-08-18 WO PCT/CN2015/087385 patent/WO2016082590A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09102910A (ja) * | 1995-10-03 | 1997-04-15 | Nippon Hoso Kyokai <Nhk> | 動画像処理装置および方法 |
CN102592128A (zh) * | 2011-12-20 | 2012-07-18 | Tcl集团股份有限公司 | 一种动态图像检测处理方法、装置及显示终端 |
CN103856617A (zh) * | 2012-12-03 | 2014-06-11 | 联想(北京)有限公司 | 一种拍照方法和用户终端 |
CN103679749A (zh) * | 2013-11-22 | 2014-03-26 | 北京奇虎科技有限公司 | 一种基于运动目标跟踪的图像处理方法及装置 |
CN103971381A (zh) * | 2014-05-16 | 2014-08-06 | 江苏新瑞峰信息科技有限公司 | 一种多目标跟踪系统及方法 |
CN104361572A (zh) * | 2014-11-27 | 2015-02-18 | 百度在线网络技术(北京)有限公司 | 图片处理方法和装置 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111401477A (zh) * | 2020-04-17 | 2020-07-10 | Oppo广东移动通信有限公司 | 图像处理方法、装置、电子设备和计算机可读存储介质 |
CN111401477B (zh) * | 2020-04-17 | 2023-11-14 | Oppo广东移动通信有限公司 | 图像处理方法、装置、电子设备和计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN104361572A (zh) | 2015-02-18 |
CN104361572B (zh) | 2017-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108898567B (zh) | 图像降噪方法、装置及系统 | |
CN111641778B (zh) | 一种拍摄方法、装置与设备 | |
CN109671106B (zh) | 一种图像处理方法、装置与设备 | |
WO2016082590A1 (zh) | 图片处理方法、装置和存储介质 | |
US9154697B2 (en) | Camera selection based on occlusion of field of view | |
CN104796594B (zh) | 一种预览界面特殊效果即时呈现方法及终端设备 | |
US20140293079A1 (en) | Camera Obstruction Detection | |
KR102229811B1 (ko) | 단말기를 위한 촬영 방법 및 단말기 | |
WO2017096866A1 (zh) | 高动态范围图像的生成方法和装置 | |
CN107749944A (zh) | 一种拍摄方法及装置 | |
JP2018513992A (ja) | 連続オートフォーカスのためのシステムおよび方法 | |
WO2018223394A1 (zh) | 一种图像拍摄方法及装置 | |
JP2016197858A (ja) | リアルタイム画像ステッチ装置およびリアルタイム画像ステッチ方法 | |
US20180077359A1 (en) | Image processing method and apparatus and terminal device | |
CN112367459B (zh) | 图像处理方法、电子装置及非易失性计算机可读存储介质 | |
US20130162759A1 (en) | Controlling Image Capture and/or Controlling Image Processing | |
WO2016197657A1 (zh) | 一种拍照处理方法和装置 | |
CN110383335A (zh) | 视频内容中基于光流和传感器输入的背景减除 | |
US10726524B2 (en) | Low-resolution tile processing for real-time bokeh | |
WO2022161340A1 (zh) | 图像显示方法、装置及电子设备 | |
CN108040244B (zh) | 基于光场视频流的抓拍方法及装置、存储介质 | |
CN111201773A (zh) | 拍摄方法及装置、移动终端及计算机可读存储介质 | |
WO2016192467A1 (zh) | 一种播放视频的方法及装置 | |
CN105120153B (zh) | 一种图像拍摄方法及装置 | |
JP2010212781A (ja) | 画像処理装置及び画像処理プログラム |
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: 15864027 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: 15864027 Country of ref document: EP Kind code of ref document: A1 |