WO2018032702A1 - Image processing method and apparatus - Google Patents

Image processing method and apparatus Download PDF

Info

Publication number
WO2018032702A1
WO2018032702A1 PCT/CN2016/113503 CN2016113503W WO2018032702A1 WO 2018032702 A1 WO2018032702 A1 WO 2018032702A1 CN 2016113503 W CN2016113503 W CN 2016113503W WO 2018032702 A1 WO2018032702 A1 WO 2018032702A1
Authority
WO
WIPO (PCT)
Prior art keywords
foreground
image
pixel
frame
captured image
Prior art date
Application number
PCT/CN2016/113503
Other languages
French (fr)
Chinese (zh)
Inventor
雷延强
Original Assignee
广州视源电子科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州视源电子科技股份有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2018032702A1 publication Critical patent/WO2018032702A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation

Definitions

  • the present invention relates to the field of information processing, and in particular to an image processing method and apparatus.
  • the present invention provides an image processing method and apparatus, which can save storage space of an electronic device and eliminate the trouble of manual post-editing.
  • the invention provides an image processing method, comprising:
  • a rectangular image having the smallest area of the foreground is taken from the captured image, and a final output image is generated based on the rectangular image.
  • the image processing method provided by the present invention captures image information with a foreground frame when photographing, divides the foreground of the image by using the captured image information, obtains an output image according to a rectangular image having the smallest area including the foreground, automatically removes the background, and only saves the image.
  • the content that the user is interested in saves the storage space of the electronic device, and also eliminates the trouble of manual editing.
  • segmenting the foreground of the captured image according to the partial image framed by the foreground frame in the captured image includes:
  • the partial image framed in the captured image by the foreground frame is an initial seed region
  • any of the neighboring pixels is a foreground pixel, updating the current seed region to the set of the foreground pixel and the original seed region;
  • the current seed region is segmented as the foreground of the captured image.
  • the partial image selected by the foreground frame is used as a seed region, and the probability algorithm is used as a criterion for regional growth.
  • the algorithm is simple and the calculation amount is low, and can also be implemented on an ordinary electronic camera device such as a mobile phone or a camera. It is suitable for occasions where the background is unchanged, which can meet the basic requirements of foreground segmentation, and can minimize the calculation amount of the algorithm and improve the operability.
  • the determining, by the preset probability algorithm, whether the neighboring pixel of the edge pixel of the current seed region is a foreground pixel specifically includes:
  • the neighboring pixel is a foreground pixel whose probability density value p(x) is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
  • the neighboring pixel is not a foreground pixel.
  • the Gaussian model is the most simple continuous distribution probability density function, and the Gaussian model is used as the criterion for the regional growth method to further reduce the computational complexity of the algorithm.
  • the characteristic value is a brightness value.
  • the brightness value is better for segmenting the foreground.
  • the rectangular image having the smallest area of the foreground is taken from the captured image, and the final output image is generated according to the rectangular image, which specifically includes:
  • the capturing a rectangular image having the smallest area of the foreground from the captured image, and generating a final output image according to the rectangular image includes:
  • a rectangular image having the smallest area including the foreground is taken from the captured image, and the rectangular image is taken as the final output image.
  • the rectangular image with the smallest area of the foreground can be directly taken out from the captured image as an output image, which is fast and effective; and the screenshot frame with adjustable size and position can also be output, which is complicated in the foreground and may be inaccurately segmented.
  • the user adjust the output image to improve the user experience.
  • the present invention also provides an image processing apparatus, including:
  • a foreground box calling module configured to display a preset foreground frame on a shooting interface of the camera device
  • An image acquisition module configured to locate a photographic subject according to the foreground frame, and capture an image
  • a foreground segmentation module configured to segment a foreground of the captured image according to the partial image framed by the foreground frame in the captured image
  • an output module configured to intercept a rectangular image having the smallest area of the foreground from the captured image, and generate a final output image according to the rectangular image.
  • the foreground segmentation module includes:
  • An initializing unit configured to use the partial image framed in the captured image by the foreground frame as an initial seed region
  • a foreground determining unit configured to determine, according to a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel
  • a seed area updating unit configured to update a current seed area to a set of the foreground pixel and the original seed area if any of the neighboring pixels is a foreground pixel;
  • a dividing unit configured to divide the current seed region as a foreground of the captured image if all of the neighboring pixels are not foreground pixels.
  • the foreground determining unit includes:
  • a parameter calculation unit configured to calculate a mean value ⁇ of the feature values of all pixels in the current seed region and a variance ⁇ 2 , wherein x i is a feature value of the i-th pixel of the seed region;
  • a probability calculation unit configured to calculate a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein x is a feature value of the neighboring pixel;
  • a foreground confirmation unit configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
  • the foreground negation unit is configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
  • the characteristic value is a brightness value.
  • the output module includes:
  • a screenshot frame display unit configured to capture a rectangular image having the smallest area of the foreground from the captured image, and display a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a handle for the user to adjust the size and position of the screenshot frame;
  • An adjusting unit configured to receive a movement operation of the control point by the user, and adjust a size and a position of the screenshot frame according to the moving operation;
  • An image output unit configured to receive confirmation information that the user completes the image processing, and the image captured by the screenshot frame is the final output image
  • the output module includes: a rectangular image output unit for extracting a rectangular image having the smallest area of the foreground from the captured image, and using the rectangular image as a final output image.
  • FIG. 2 is a schematic diagram of an image of an image processing method provided by the present invention.
  • Fig. 3 is a structural diagram of an image processing apparatus provided by the present invention.
  • FIG. 1 is a flowchart of an image processing method provided by the present invention, including:
  • the frame of the area c in the figure is a preset foreground frame.
  • the foreground frame positions the subject and captures the image. It is assumed that the area a in the figure is the captured image, and the area b is the foreground of the captured image.
  • the area b can be gradually segmented, and the rectangular image containing the smallest area of the area b is extracted from the area a. (as shown by the dotted frame selection area in Fig. 2), and the final output image is generated based on the rectangular image.
  • the image processing method provided by the present invention captures image information with a foreground frame when photographing, divides the foreground of the image by using the captured image information, obtains an output image according to a rectangular image having the smallest area including the foreground, automatically removes the background, and only saves the image.
  • the content that the user is interested in saves the storage space of the electronic device, and also eliminates the trouble of manual editing.
  • step S3 “the foreground of the captured image is segmented according to the partial image framed by the foreground frame in the captured image”, the foreground of the captured image may be segmented by using different front background segmentation methods.
  • a region growing method can be employed, using different region growing criteria, and various embodiments can be used to segment the foreground of the captured image.
  • step S3 specifically includes:
  • the partial image framed in the captured image by the foreground frame is an initial seed region
  • any of the neighboring pixels is a foreground pixel, updating the current seed region to the set of the foreground pixel and the original seed region;
  • the current seed region is segmented as the foreground of the captured image.
  • the partial image selected by the foreground frame is used as the seed region, and the probability algorithm is used as the criterion for the region growth.
  • the algorithm is simple and the calculation amount is low, and can also be implemented on an ordinary electronic camera device such as a mobile phone or a camera. It is suitable for occasions where the background is unchanged, which can meet the basic requirements of foreground segmentation, and can minimize the calculation amount of the algorithm and improve the operability.
  • a representative pixel in the foreground image selected as the seed pixel may also be used as the seed pixel, and other region growth criteria (such as the feature value of the neighborhood pixel and the feature value of the seed pixel) Whether the difference is less than a certain threshold) splits the foreground. It is selected according to the actual application scenario.
  • the determining, by the preset probability algorithm, whether the neighboring pixel of the edge pixel of the current seed region is a foreground pixel further comprising:
  • the neighboring pixel is a foreground pixel whose probability density value p(x) is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
  • the neighboring pixel is not a foreground pixel.
  • the Gaussian model is used as the criterion for the regional growth method, and the Gaussian model is the easiest to further reduce the computational complexity of the algorithm.
  • the calculation may be performed on the 4-neighbor pixel or the 8-neighbor pixel.
  • the use of 4 neighborhood pixels can further reduce the amount of calculation, which is suitable for images with obvious foreground and background boundaries; the use of 8 neighborhood pixels is more accurate.
  • the characteristic value is a brightness value.
  • the brightness value is better for segmenting the foreground.
  • step S4 “cutting a rectangular image containing the smallest area of the foreground from the captured image and generating a final output image according to the rectangular image” also has various embodiments;
  • the rectangular image having the smallest area of the foreground may be intercepted from the captured image, and the rectangular image is used as the final output image, which is quick and easy to segment.
  • step S4 specifically includes:
  • the image captured by the screenshot box is the final output image.
  • the user can adjust the output image and improve the user experience in the case where the foreground is complicated and the segmentation may be inaccurate.
  • FIG. 3 is a structural diagram of an image processing apparatus provided by the present invention, including:
  • the foreground frame calls the module 1 for displaying a preset foreground frame on the shooting interface of the imaging device;
  • An image acquisition module 2 configured to locate a photographic subject according to the foreground frame, and capture an image
  • the foreground segmentation module 3 is configured to segment a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
  • An output module 4 configured to capture, from the captured image, a rectangular image having the smallest area of the foreground, and according to the The rectangular image produces the final output image.
  • the foreground segmentation module 3 includes:
  • An initializing unit configured to use the partial image framed in the captured image by the foreground frame as an initial seed region
  • a foreground determining unit configured to determine, according to a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel
  • a seed area updating unit configured to update a current seed area to a set of the foreground pixel and the original seed area if any of the neighboring pixels is a foreground pixel;
  • a dividing unit configured to divide the current seed region as a foreground of the captured image if all of the neighboring pixels are not foreground pixels.
  • the foreground determining unit includes:
  • a parameter calculation unit configured to calculate a mean value ⁇ of the feature values of all pixels in the current seed region and a variance ⁇ 2 , wherein x i is a feature value of the i-th pixel of the seed region;
  • a probability calculation unit configured to calculate a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein x is a feature value of the neighboring pixel;
  • a foreground confirmation unit configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
  • the foreground negation unit is configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
  • the characteristic value is a brightness value.
  • the output module 4 includes:
  • a screenshot frame display unit configured to capture a rectangular image having the smallest area of the foreground from the captured image, and display a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a handle for the user to adjust the size and position of the screenshot frame;
  • An adjusting unit configured to receive a movement operation of the control point by the user, and adjust a size and a position of the screenshot frame according to the moving operation;
  • An image output unit configured to receive confirmation information that the user completes the image processing, and the image captured by the screenshot frame is the final output image
  • the output module includes: a rectangular image output unit for extracting a rectangular image having the smallest area of the foreground from the captured image, and using the rectangular image as a final output image.
  • the image processing method and device provided by the invention capture image information by foreground frame when photographing, segment the foreground of the image by using the captured image information, obtain an output image according to the rectangular image with the smallest area of the foreground, and automatically remove the background, only The content that is of interest to the user is saved, which saves the storage space of the electronic device and eliminates the trouble of manual editing.

Abstract

The present invention provides an image processing method, comprising: displaying a preset foreground frame on a photographing interface of a photographing device; positioning an object to be photographed according to the foreground frame, and photographing an image; separating out the foreground of the photographed image according to a local image frame-selected by the foreground frame from the photographed image; and from the photographed image, cutting out a rectangular image having a minimum area yet still containing the foreground, and generating a final output image according to the rectangular image. Correspondingly, the present invention further provides an image processing apparatus. By means of the image processing method and apparatus provided by the present invention, image information is captured by means of a foreground frame during photographing, the foreground of an image is separated out according to the captured image information, an output image is obtained according to a rectangular imagehaving a minimum area yet still contains the foreground, the background is automatically removed, and only the content of interest to a user is stored, so that the storage space of an electronic device is saved, and the costs of manual post-photographing processing are also avoided.

Description

一种图像处理方法及装置Image processing method and device 技术领域Technical field
本发明涉及信息处理领域,具体地,涉及一种图像处理方法及装置。The present invention relates to the field of information processing, and in particular to an image processing method and apparatus.
背景技术Background technique
随着电子技术的发展,大量的电子设备中添加了拍照功能。而在拍照过程中,很多时候人们只想保存感兴趣的内容,比如在参加一些讨论会议时,主持人通过投影仪分享演示文稿,人们希望记录会议内容因此需要拍摄演示文稿会后整理,但对于演示文稿的背景并不感兴趣。由于现有技术中去除背景只能采用人工后期编辑的方式,不能在拍摄过程中自动完成去除背景,因此造成需要保存一些多余的信息,浪费电子设备的存储空间;后期需要人工编辑也较为麻烦。With the development of electronic technology, a large number of electronic devices have been added to the camera function. In the process of taking pictures, people often only want to save content of interest. For example, when attending some discussion meetings, the host shares the presentation through the projector. People want to record the content of the meeting, so they need to take the presentation after finishing the presentation. The background of the presentation is not of interest. Since the background removal in the prior art can only be performed by manual post-editing, the background cannot be automatically removed during the shooting process, so that it is necessary to save some redundant information and waste the storage space of the electronic device; it is also troublesome to manually edit later.
发明内容Summary of the invention
为了克服现有技术的缺陷,本发明提供一种图像处理方法及装置,其能节约电子设备的存储空间,免去人工后期编辑的麻烦。In order to overcome the defects of the prior art, the present invention provides an image processing method and apparatus, which can save storage space of an electronic device and eliminate the trouble of manual post-editing.
本发明提供一种图像处理方法,包括:The invention provides an image processing method, comprising:
在摄像设备的拍摄界面上显示预先设定的前景框;Displaying a preset foreground frame on a shooting interface of the imaging device;
根据所述前景框定位拍摄对象,并拍摄图像;Positioning the subject according to the foreground frame, and capturing an image;
根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;Delineating a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像。A rectangular image having the smallest area of the foreground is taken from the captured image, and a final output image is generated based on the rectangular image.
实施本发明,具有如下有益效果:The implementation of the present invention has the following beneficial effects:
本发明提供的图像处理方法,在拍照时以前景框捕捉图像信息,利用捕捉到的图像信息分割图像的前景,根据包含前景的面积最小的矩形图像获得输出图像,自动去除了背景,只保存了用户感兴趣的内容,节约了电子设备的存储空间,也免去了人工后期编辑的麻烦。The image processing method provided by the present invention captures image information with a foreground frame when photographing, divides the foreground of the image by using the captured image information, obtains an output image according to a rectangular image having the smallest area including the foreground, automatically removes the background, and only saves the image. The content that the user is interested in saves the storage space of the electronic device, and also eliminates the trouble of manual editing.
进一步地,所述根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景,具体包括:Further, the segmenting the foreground of the captured image according to the partial image framed by the foreground frame in the captured image includes:
以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域; The partial image framed in the captured image by the foreground frame is an initial seed region;
按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;Determining, by a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;If any of the neighboring pixels is a foreground pixel, updating the current seed region to the set of the foreground pixel and the original seed region;
若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。If all of the neighborhood pixels are not foreground pixels, the current seed region is segmented as the foreground of the captured image.
在进一步方案中,采用前景框框选的局部图像为种子区域,结合概率算法作为区域生长的判断准则,算法简单、计算量低,在普通的电子摄像设备,比如手机、相机上也可实现。适用于背景单一不变的场合,能满足前景分割的基本要求,又能最大程度地降低算法计算量,提高可操作性。In a further scheme, the partial image selected by the foreground frame is used as a seed region, and the probability algorithm is used as a criterion for regional growth. The algorithm is simple and the calculation amount is low, and can also be implemented on an ordinary electronic camera device such as a mobile phone or a camera. It is suitable for occasions where the background is unchanged, which can meet the basic requirements of foreground segmentation, and can minimize the calculation amount of the algorithm and improve the operability.
进一步地,所述按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素,具体包括:Further, the determining, by the preset probability algorithm, whether the neighboring pixel of the edge pixel of the current seed region is a foreground pixel, specifically includes:
计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
Figure PCTCN2016113503-appb-000001
Figure PCTCN2016113503-appb-000002
xi为所述种子区域的第i个像素的特征值;
Calculating a mean value μ of the eigenvalues of all pixels in the current seed region and a variance σ 2 , wherein
Figure PCTCN2016113503-appb-000001
Figure PCTCN2016113503-appb-000002
x i is a feature value of the i-th pixel of the seed region;
计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
Figure PCTCN2016113503-appb-000003
x为所述邻域像素的特征值;
Calculating a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
Figure PCTCN2016113503-appb-000003
x is a feature value of the neighboring pixel;
若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;If the neighboring pixel is a foreground pixel whose probability density value p(x) is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。If the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
在进一步方案中,由于一般图像的特征值都是连续分布,高斯模型是最为简便的连续分布概率密度函数,以高斯模型作为区域生长法的判断准则,进一步降低算法计算量。In the further scheme, since the eigenvalues of the general image are continuous distribution, the Gaussian model is the most simple continuous distribution probability density function, and the Gaussian model is used as the criterion for the regional growth method to further reduce the computational complexity of the algorithm.
优选地,所述特征值为亮度值。Preferably, the characteristic value is a brightness value.
对于在会议、讲座等场合拍摄主讲人分享的演示文稿,由于演示文稿亮度较高,背景较暗,因此以亮度值为特征值能更好地分割前景。For presentations shared by the presenter in conferences, lectures, etc., because the brightness of the presentation is high and the background is dark, the brightness value is better for segmenting the foreground.
进一步地,所述从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像,具体包括:Further, the rectangular image having the smallest area of the foreground is taken from the captured image, and the final output image is generated according to the rectangular image, which specifically includes:
从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点; Extracting a rectangular image having the smallest area of the foreground from the captured image, and displaying a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a user for adjusting the The handle of the size and position of the screenshot frame;
接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;Receiving a movement operation of the control point by the user, and adjusting a size and a position of the screenshot frame according to the moving operation;
接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像;Receiving confirmation information that the user completes the image processing, and the image intercepted by the screenshot frame is the final output image;
或者,所述从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像,包括:Alternatively, the capturing a rectangular image having the smallest area of the foreground from the captured image, and generating a final output image according to the rectangular image, includes:
从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像。A rectangular image having the smallest area including the foreground is taken from the captured image, and the rectangular image is taken as the final output image.
在进一步方案中,可以直接从所拍摄图像中截取包含前景的面积最小的矩形图像作为输出图像,快捷有效;也可以输出可调整尺寸和位置的截图框,在前景复杂,可能分割不准确的情况下,让用户可以调整输出图像,提高用户体验。In a further solution, the rectangular image with the smallest area of the foreground can be directly taken out from the captured image as an output image, which is fast and effective; and the screenshot frame with adjustable size and position can also be output, which is complicated in the foreground and may be inaccurately segmented. Next, let the user adjust the output image to improve the user experience.
相应地,本发明还提供一种图像处理装置,包括:Correspondingly, the present invention also provides an image processing apparatus, including:
前景框调用模块,用于在摄像设备的拍摄界面上显示预先设定的前景框;a foreground box calling module, configured to display a preset foreground frame on a shooting interface of the camera device;
图像获取模块,用于根据所述前景框定位拍摄对象,并拍摄图像;An image acquisition module, configured to locate a photographic subject according to the foreground frame, and capture an image;
前景分割模块,用于根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;a foreground segmentation module, configured to segment a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
输出模块,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像。And an output module, configured to intercept a rectangular image having the smallest area of the foreground from the captured image, and generate a final output image according to the rectangular image.
进一步地,所述前景分割模块包括:Further, the foreground segmentation module includes:
初始化单元,用于以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域;An initializing unit, configured to use the partial image framed in the captured image by the foreground frame as an initial seed region;
前景判断单元,用于按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;a foreground determining unit, configured to determine, according to a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
种子区域更新单元,用于若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;a seed area updating unit, configured to update a current seed area to a set of the foreground pixel and the original seed area if any of the neighboring pixels is a foreground pixel;
分割单元,用于若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。a dividing unit, configured to divide the current seed region as a foreground of the captured image if all of the neighboring pixels are not foreground pixels.
进一步地,所述前景判断单元包括:Further, the foreground determining unit includes:
参数计算单元,用于计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
Figure PCTCN2016113503-appb-000004
xi为所述种子区域的第i个像素的特征值;
a parameter calculation unit, configured to calculate a mean value μ of the feature values of all pixels in the current seed region and a variance σ 2 , wherein
Figure PCTCN2016113503-appb-000004
x i is a feature value of the i-th pixel of the seed region;
概率计算单元,用于计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
Figure PCTCN2016113503-appb-000005
x为所述邻域像素的特征值;
a probability calculation unit, configured to calculate a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
Figure PCTCN2016113503-appb-000005
x is a feature value of the neighboring pixel;
前景确认单元,用于若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;a foreground confirmation unit, configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
前景否定单元,用于若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。The foreground negation unit is configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
优选地,所述特征值为亮度值。Preferably, the characteristic value is a brightness value.
进一步地,所述输出模块包括:Further, the output module includes:
截图框显示单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点;a screenshot frame display unit, configured to capture a rectangular image having the smallest area of the foreground from the captured image, and display a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a handle for the user to adjust the size and position of the screenshot frame;
调节单元,用于接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;An adjusting unit, configured to receive a movement operation of the control point by the user, and adjust a size and a position of the screenshot frame according to the moving operation;
图像输出单元,用于接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像;An image output unit, configured to receive confirmation information that the user completes the image processing, and the image captured by the screenshot frame is the final output image;
或者,所述输出模块包括:矩形图像输出单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像。Alternatively, the output module includes: a rectangular image output unit for extracting a rectangular image having the smallest area of the foreground from the captured image, and using the rectangular image as a final output image.
附图说明DRAWINGS
图1是本发明提供的图像处理方法的流程图;1 is a flow chart of an image processing method provided by the present invention;
图2是本发明提供的图像处理方法的图像示意图;2 is a schematic diagram of an image of an image processing method provided by the present invention;
图3是本发明提供的图像处理装置的结构图。Fig. 3 is a structural diagram of an image processing apparatus provided by the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
参见图1,是本发明提供的图像处理方法的流程图,包括:Referring to FIG. 1, which is a flowchart of an image processing method provided by the present invention, including:
S1、在摄像设备的拍摄界面上显示预先设定的前景框;S1, displaying a preset foreground frame on a shooting interface of the imaging device;
S2、根据所述前景框定位拍摄对象,并拍摄图像;S2, positioning a subject according to the foreground frame, and capturing an image;
S3、根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;S3. Segmenting a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
S4、从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生 成最终输出的图像。S4. Obtain a rectangular image having the smallest area of the foreground from the captured image, and generate a rectangular image according to the rectangular image. The resulting image is output.
参见图2,是本发明提供的图像处理方法的图像分割示意图,图中区域c的外框为预先设定的前景框,用户在使用拍摄设备时,可以通过移动拍摄设备或者移动前景框,使前景框定位拍摄对象,拍摄图像。假设图中区域a为所拍摄图像,区域b为所拍摄图像的前景,根据区域c中的局部图像,可以逐步将区域b分割出来,再从区域a中截取包含区域b的面积最小的矩形图像(如图2中虚线框选区域所示),并根据所述矩形图像生成最终输出的图像。2 is a schematic diagram of image segmentation of the image processing method provided by the present invention. The frame of the area c in the figure is a preset foreground frame. When the user uses the shooting device, the user can move the shooting device or move the foreground frame. The foreground frame positions the subject and captures the image. It is assumed that the area a in the figure is the captured image, and the area b is the foreground of the captured image. According to the partial image in the area c, the area b can be gradually segmented, and the rectangular image containing the smallest area of the area b is extracted from the area a. (as shown by the dotted frame selection area in Fig. 2), and the final output image is generated based on the rectangular image.
本发明提供的图像处理方法,在拍照时以前景框捕捉图像信息,利用捕捉到的图像信息分割图像的前景,根据包含前景的面积最小的矩形图像获得输出图像,自动去除了背景,只保存了用户感兴趣的内容,节约了电子设备的存储空间,也免去了人工后期编辑的麻烦。The image processing method provided by the present invention captures image information with a foreground frame when photographing, divides the foreground of the image by using the captured image information, obtains an output image according to a rectangular image having the smallest area including the foreground, automatically removes the background, and only saves the image. The content that the user is interested in saves the storage space of the electronic device, and also eliminates the trouble of manual editing.
具体实施时,步骤S3“根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景”中,可采用不同的前背景分割方法分割出所拍摄图像的前景。典型地,可采用区域生长法,利用不同的区域生长准则,还可以有多种实施方式分割出所拍摄图像的前景。优选地,步骤S3具体包括:In a specific implementation, in step S3, “the foreground of the captured image is segmented according to the partial image framed by the foreground frame in the captured image”, the foreground of the captured image may be segmented by using different front background segmentation methods. Typically, a region growing method can be employed, using different region growing criteria, and various embodiments can be used to segment the foreground of the captured image. Preferably, step S3 specifically includes:
以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域;The partial image framed in the captured image by the foreground frame is an initial seed region;
按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;Determining, by a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;If any of the neighboring pixels is a foreground pixel, updating the current seed region to the set of the foreground pixel and the original seed region;
若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。If all of the neighborhood pixels are not foreground pixels, the current seed region is segmented as the foreground of the captured image.
上述实施方式,采用前景框框选的局部图像为种子区域,结合概率算法作为区域生长的判断准则,算法简单、计算量低,在普通的电子摄像设备,比如手机、相机上也可实现。适用于背景单一不变的场合,能满足前景分割的基本要求,又能最大程度地降低算法计算量,提高可操作性。In the above embodiment, the partial image selected by the foreground frame is used as the seed region, and the probability algorithm is used as the criterion for the region growth. The algorithm is simple and the calculation amount is low, and can also be implemented on an ordinary electronic camera device such as a mobile phone or a camera. It is suitable for occasions where the background is unchanged, which can meet the basic requirements of foreground segmentation, and can minimize the calculation amount of the algorithm and improve the operability.
在其他实施方式中,也可采用前景框框选的局部图像中的某个具有代表性的像素作为种子像素,以其他的区域生长准则(比如邻域像素的特征值与种子像素的特征值之间的差值是否小于某一阈值)分割前景。具体视实际应用场景选用。In other embodiments, a representative pixel in the foreground image selected as the seed pixel may also be used as the seed pixel, and other region growth criteria (such as the feature value of the neighborhood pixel and the feature value of the seed pixel) Whether the difference is less than a certain threshold) splits the foreground. It is selected according to the actual application scenario.
进一步地,在优选实施方式中,所述按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素,进一步包括:Further, in a preferred embodiment, the determining, by the preset probability algorithm, whether the neighboring pixel of the edge pixel of the current seed region is a foreground pixel, further comprising:
计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
Figure PCTCN2016113503-appb-000006
Figure PCTCN2016113503-appb-000007
xi为所述种子区域的第i个像素的特征值;
Calculating a mean value μ of the eigenvalues of all pixels in the current seed region and a variance σ 2 , wherein
Figure PCTCN2016113503-appb-000006
Figure PCTCN2016113503-appb-000007
x i is a feature value of the i-th pixel of the seed region;
计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
Figure PCTCN2016113503-appb-000008
x为所述邻域像素的特征值;
Calculating a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
Figure PCTCN2016113503-appb-000008
x is a feature value of the neighboring pixel;
若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;If the neighboring pixel is a foreground pixel whose probability density value p(x) is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。If the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
在进一步方案中,以高斯模型作为区域生长法的判断准则,高斯模型最为简便,进一步降低算法计算量。在计算种子区域的边缘像素的邻域像素是否为前景像素时,可以对4邻域像素进行计算,也可以对8邻域像素进行计算。采用4邻域像素能进一步减小计算量,适用于前景和背景界限比较明显的图像;采用8邻域像素则比较精准。In a further scheme, the Gaussian model is used as the criterion for the regional growth method, and the Gaussian model is the easiest to further reduce the computational complexity of the algorithm. When calculating whether the neighboring pixel of the edge pixel of the seed region is a foreground pixel, the calculation may be performed on the 4-neighbor pixel or the 8-neighbor pixel. The use of 4 neighborhood pixels can further reduce the amount of calculation, which is suitable for images with obvious foreground and background boundaries; the use of 8 neighborhood pixels is more accurate.
优选地,所述特征值为亮度值。Preferably, the characteristic value is a brightness value.
对于在会议、讲座等场合拍摄主讲人分享的演示文稿,由于演示文稿亮度较高,背景较暗,因此以亮度值为特征值能更好地分割前景。For presentations shared by the presenter in conferences, lectures, etc., because the brightness of the presentation is high and the background is dark, the brightness value is better for segmenting the foreground.
具体实施时,步骤S4“从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像”也有多种实施方式;In a specific implementation, step S4 “cutting a rectangular image containing the smallest area of the foreground from the captured image and generating a final output image according to the rectangular image” also has various embodiments;
在其中一种实施方式中,可以从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像,这种方式分割快捷简便。In one embodiment, the rectangular image having the smallest area of the foreground may be intercepted from the captured image, and the rectangular image is used as the final output image, which is quick and easy to segment.
在另一种实施方式中,步骤S4具体包括:In another implementation, step S4 specifically includes:
从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点;接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像。Extracting a rectangular image having the smallest area of the foreground from the captured image, and displaying a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a user for adjusting the a control point of the size and position of the screenshot frame; receiving a movement operation of the control point by the user, and adjusting a size and a position of the screenshot frame according to the moving operation; receiving confirmation information that the user completes the image processing, The image captured by the screenshot box is the final output image.
通过输出可调整尺寸和位置的截图框,在前景复杂,可能分割不准确的情况下,让用户可以调整输出图像,提高用户体验。By outputting a screenshot box of adjustable size and position, the user can adjust the output image and improve the user experience in the case where the foreground is complicated and the segmentation may be inaccurate.
参见图3,是本发明提供的图像处理装置的结构图,包括:3 is a structural diagram of an image processing apparatus provided by the present invention, including:
前景框调用模块1,用于在摄像设备的拍摄界面上显示预先设定的前景框;The foreground frame calls the module 1 for displaying a preset foreground frame on the shooting interface of the imaging device;
图像获取模块2,用于根据所述前景框定位拍摄对象,并拍摄图像;An image acquisition module 2, configured to locate a photographic subject according to the foreground frame, and capture an image;
前景分割模块3,用于根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;The foreground segmentation module 3 is configured to segment a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
输出模块4,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所 述矩形图像生成最终输出的图像。An output module 4, configured to capture, from the captured image, a rectangular image having the smallest area of the foreground, and according to the The rectangular image produces the final output image.
进一步地,所述前景分割模块3包括:Further, the foreground segmentation module 3 includes:
初始化单元,用于以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域;An initializing unit, configured to use the partial image framed in the captured image by the foreground frame as an initial seed region;
前景判断单元,用于按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;a foreground determining unit, configured to determine, according to a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
种子区域更新单元,用于若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;a seed area updating unit, configured to update a current seed area to a set of the foreground pixel and the original seed area if any of the neighboring pixels is a foreground pixel;
分割单元,用于若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。a dividing unit, configured to divide the current seed region as a foreground of the captured image if all of the neighboring pixels are not foreground pixels.
进一步地,所述前景判断单元包括:Further, the foreground determining unit includes:
参数计算单元,用于计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
Figure PCTCN2016113503-appb-000009
xi为所述种子区域的第i个像素的特征值;
a parameter calculation unit, configured to calculate a mean value μ of the feature values of all pixels in the current seed region and a variance σ 2 , wherein
Figure PCTCN2016113503-appb-000009
x i is a feature value of the i-th pixel of the seed region;
概率计算单元,用于计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
Figure PCTCN2016113503-appb-000010
x为所述邻域像素的特征值;
a probability calculation unit, configured to calculate a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
Figure PCTCN2016113503-appb-000010
x is a feature value of the neighboring pixel;
前景确认单元,用于若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;a foreground confirmation unit, configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
前景否定单元,用于若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。The foreground negation unit is configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
优选地,所述特征值为亮度值。Preferably, the characteristic value is a brightness value.
进一步地,所述输出模块4包括:Further, the output module 4 includes:
截图框显示单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点;a screenshot frame display unit, configured to capture a rectangular image having the smallest area of the foreground from the captured image, and display a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a handle for the user to adjust the size and position of the screenshot frame;
调节单元,用于接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;An adjusting unit, configured to receive a movement operation of the control point by the user, and adjust a size and a position of the screenshot frame according to the moving operation;
图像输出单元,用于接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像;An image output unit, configured to receive confirmation information that the user completes the image processing, and the image captured by the screenshot frame is the final output image;
或者,所述输出模块包括:矩形图像输出单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像。 Alternatively, the output module includes: a rectangular image output unit for extracting a rectangular image having the smallest area of the foreground from the captured image, and using the rectangular image as a final output image.
本发明提供的图像处理方法及装置,在拍照时以前景框捕捉图像信息,利用捕捉到的图像信息分割图像的前景,根据包含前景的面积最小的矩形图像获得输出图像,自动去除了背景,只保存了用户感兴趣的内容,节约了电子设备的存储空间,也免去了人工后期编辑的麻烦。The image processing method and device provided by the invention capture image information by foreground frame when photographing, segment the foreground of the image by using the captured image information, obtain an output image according to the rectangular image with the smallest area of the foreground, and automatically remove the background, only The content that is of interest to the user is saved, which saves the storage space of the electronic device and eliminates the trouble of manual editing.
以上是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和变形,这些改进和变形也视为本发明的保护范围。 The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and modifications without departing from the principles of the present invention. The scope of protection of the invention.

Claims (10)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    在摄像设备的拍摄界面上显示预先设定的前景框;Displaying a preset foreground frame on a shooting interface of the imaging device;
    根据所述前景框定位拍摄对象,并拍摄图像;Positioning the subject according to the foreground frame, and capturing an image;
    根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;Delineating a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
    从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像。A rectangular image having the smallest area of the foreground is taken from the captured image, and a final output image is generated based on the rectangular image.
  2. 如权利要求1所述的图像处理方法,其特征在于,所述根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景,具体包括:The image processing method according to claim 1, wherein the segmenting the foreground of the captured image according to the partial image framed by the foreground frame in the captured image comprises:
    以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域;The partial image framed in the captured image by the foreground frame is an initial seed region;
    按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;Determining, by a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
    若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;If any of the neighboring pixels is a foreground pixel, updating the current seed region to the set of the foreground pixel and the original seed region;
    若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。If all of the neighborhood pixels are not foreground pixels, the current seed region is segmented as the foreground of the captured image.
  3. 如权利要求2所述的图像处理方法,其特征在于,所述按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素,具体包括:The image processing method according to claim 2, wherein the determining, by the preset probability algorithm, whether the neighboring pixel of the edge pixel of the current seed region is a foreground pixel, specifically comprising:
    计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
    Figure PCTCN2016113503-appb-100001
    Figure PCTCN2016113503-appb-100002
    xi为所述种子区域的第i个像素的特征值;
    Calculating a mean value μ of the eigenvalues of all pixels in the current seed region and a variance σ 2 , wherein
    Figure PCTCN2016113503-appb-100001
    Figure PCTCN2016113503-appb-100002
    x i is a feature value of the i-th pixel of the seed region;
    计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
    Figure PCTCN2016113503-appb-100003
    x为所述邻域像素的特征值;
    Calculating a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
    Figure PCTCN2016113503-appb-100003
    x is a feature value of the neighboring pixel;
    若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;If the neighboring pixel is a foreground pixel whose probability density value p(x) is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
    若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。If the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
  4. 如权利要求3所述的图像处理方法,其特征在于,所述特征值为亮度值。 The image processing method according to claim 3, wherein the feature value is a brightness value.
  5. 如权利要求1至4任一项所述的图像处理方法,其特征在于,所述从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像,具体包括:The image processing method according to any one of claims 1 to 4, wherein the rectangular image including the foreground having the smallest area is extracted from the captured image, and the final output image is generated based on the rectangular image. Specifically, including:
    从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点;Extracting a rectangular image having the smallest area of the foreground from the captured image, and displaying a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a user for adjusting the The handle of the size and position of the screenshot frame;
    接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;Receiving a movement operation of the control point by the user, and adjusting a size and a position of the screenshot frame according to the moving operation;
    接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像;Receiving confirmation information that the user completes the image processing, and the image intercepted by the screenshot frame is the final output image;
    或者,所述从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像,包括:Alternatively, the capturing a rectangular image having the smallest area of the foreground from the captured image, and generating a final output image according to the rectangular image, includes:
    从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像。A rectangular image having the smallest area including the foreground is taken from the captured image, and the rectangular image is taken as the final output image.
  6. 一种图像处理装置,其特征在于,包括:An image processing apparatus, comprising:
    前景框调用模块,用于在摄像设备的拍摄界面上显示预先设定的前景框;a foreground box calling module, configured to display a preset foreground frame on a shooting interface of the camera device;
    图像获取模块,用于根据所述前景框定位拍摄对象,并拍摄图像;An image acquisition module, configured to locate a photographic subject according to the foreground frame, and capture an image;
    前景分割模块,用于根据所述前景框在所拍摄图像中框选的局部图像,分割出所拍摄图像的前景;a foreground segmentation module, configured to segment a foreground of the captured image according to the partial image framed by the foreground frame in the captured image;
    输出模块,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并根据所述矩形图像生成最终输出的图像。And an output module, configured to intercept a rectangular image having the smallest area of the foreground from the captured image, and generate a final output image according to the rectangular image.
  7. 如权利要求6所述的图像处理装置,其特征在于,所述前景分割模块包括:The image processing device according to claim 6, wherein the foreground segmentation module comprises:
    初始化单元,用于以所述前景框在所拍摄图像中框选的局部图像为初始的种子区域;An initializing unit, configured to use the partial image framed in the captured image by the foreground frame as an initial seed region;
    前景判断单元,用于按预设的概率算法判断当前的种子区域的边缘像素的邻域像素是否为前景像素;a foreground determining unit, configured to determine, according to a preset probability algorithm, whether a neighboring pixel of an edge pixel of a current seed region is a foreground pixel;
    种子区域更新单元,用于若任一邻域像素为前景像素,则将当前的种子区域更新为所述前景像素与原种子区域的集合;a seed area updating unit, configured to update a current seed area to a set of the foreground pixel and the original seed area if any of the neighboring pixels is a foreground pixel;
    分割单元,用于若所有邻域像素均不是前景像素,则分割当前的种子区域作为所述已拍摄图像的前景。 a dividing unit, configured to divide the current seed region as a foreground of the captured image if all of the neighboring pixels are not foreground pixels.
  8. 如权利要求7所述的图像处理装置,其特征在于,所述前景判断单元包括:The image processing device according to claim 7, wherein the foreground determination unit comprises:
    参数计算单元,用于计算当前的种子区域内的所有像素的特征值的均值μ以及方差σ2,其中,
    Figure PCTCN2016113503-appb-100004
    xi为所述种子区域的第i个像素的特征值;
    a parameter calculation unit, configured to calculate a mean value μ of the feature values of all pixels in the current seed region and a variance σ 2 , wherein
    Figure PCTCN2016113503-appb-100004
    x i is a feature value of the i-th pixel of the seed region;
    概率计算单元,用于计算所述种子区域的边缘像素的邻域像素为前景像素的概率密度值p(x);其中,
    Figure PCTCN2016113503-appb-100005
    x为所述邻域像素的特征值;
    a probability calculation unit, configured to calculate a probability density value p(x) of a neighboring pixel of the edge pixel of the seed region as a foreground pixel; wherein
    Figure PCTCN2016113503-appb-100005
    x is a feature value of the neighboring pixel;
    前景确认单元,用于若所述邻域像素为前景像素的概率密度值p(x)大于或等于预设的阈值,则所述邻域像素为前景像素;a foreground confirmation unit, configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is greater than or equal to a preset threshold, the neighboring pixel is a foreground pixel;
    前景否定单元,用于若所述邻域像素为前景像素的概率密度值p(x)小于预设的阈值,则所述邻域像素不是前景像素。The foreground negation unit is configured to: if the probability density value p(x) of the neighboring pixel is a foreground pixel is less than a preset threshold, the neighboring pixel is not a foreground pixel.
  9. 如权利要求8所述的图像处理装置,其特征在于,所述特征值为亮度值。The image processing device according to claim 8, wherein said characteristic value is a luminance value.
  10. 如权利要求6至9任一项所述的图像处理装置,其特征在于,所述输出模块包括:The image processing apparatus according to any one of claims 6 to 9, wherein the output module comprises:
    截图框显示单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,并显示与所述矩形图像对应的截图框在所述已拍摄图像上;其中,所述截图框包含用于供用户调节所述截图框的尺寸和位置的控点;a screenshot frame display unit, configured to capture a rectangular image having the smallest area of the foreground from the captured image, and display a screenshot frame corresponding to the rectangular image on the captured image; wherein the screenshot frame includes a handle for the user to adjust the size and position of the screenshot frame;
    调节单元,用于接收用户对所述控点的移动操作,并根据所述移动操作调节所述截图框的尺寸和位置;An adjusting unit, configured to receive a movement operation of the control point by the user, and adjust a size and a position of the screenshot frame according to the moving operation;
    图像输出单元,用于接收用户对图像处理完成的确认信息,以所述截图框截取的图像为最终输出的图像;An image output unit, configured to receive confirmation information that the user completes the image processing, and the image captured by the screenshot frame is the final output image;
    或者,所述输出模块包括:Alternatively, the output module includes:
    矩形图像输出单元,用于从所拍摄图像中截取包含所述前景的面积最小的矩形图像,将所述矩形图像作为最终输出的图像。 And a rectangular image output unit configured to extract, from the captured image, a rectangular image having the smallest area of the foreground, and use the rectangular image as the final output image.
PCT/CN2016/113503 2016-08-18 2016-12-30 Image processing method and apparatus WO2018032702A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610687861.0A CN106373139A (en) 2016-08-18 2016-08-18 Image processing method and device
CN201610687861.0 2016-08-18

Publications (1)

Publication Number Publication Date
WO2018032702A1 true WO2018032702A1 (en) 2018-02-22

Family

ID=57879494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113503 WO2018032702A1 (en) 2016-08-18 2016-12-30 Image processing method and apparatus

Country Status (2)

Country Link
CN (1) CN106373139A (en)
WO (1) WO2018032702A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062761A (en) * 2017-12-25 2018-05-22 北京奇虎科技有限公司 Image partition method, device and computing device based on adaptive tracing frame
CN108122238A (en) * 2018-01-30 2018-06-05 百度在线网络技术(北京)有限公司 Image processing method, device, equipment and computer readable storage medium
WO2020075483A1 (en) * 2018-10-09 2020-04-16 インターマン株式会社 Portable calendar and notebook
CN112399065A (en) * 2019-08-12 2021-02-23 青岛海信移动通信技术股份有限公司 Method and equipment for adjusting focal length
CN112669328B (en) * 2020-12-25 2023-04-07 人和未来生物科技(长沙)有限公司 Medical image segmentation method
CN114329221A (en) * 2021-12-31 2022-04-12 钻技(上海)信息科技有限公司 Commodity searching method, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458814A (en) * 2007-12-13 2009-06-17 东软集团股份有限公司 Method and apparatus for separating objects interesting region from image
CN104933068A (en) * 2014-03-19 2015-09-23 阿里巴巴集团控股有限公司 Method and device for information searching
WO2015181179A1 (en) * 2014-05-28 2015-12-03 Thomson Licensing Method and apparatus for object tracking and segmentation via background tracking
CN105513050A (en) * 2015-11-25 2016-04-20 北京邮电大学世纪学院 Target image extraction method and apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102456213A (en) * 2010-10-20 2012-05-16 上海无戒空间信息技术有限公司 Photo processing method
CN102103752B (en) * 2010-11-26 2012-07-04 浙江工业大学 Method for detecting color code blocks in human-computer interaction
CN103209291A (en) * 2012-01-17 2013-07-17 百度在线网络技术(北京)有限公司 Method, apparatus and device for controlling automatic image shooting

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458814A (en) * 2007-12-13 2009-06-17 东软集团股份有限公司 Method and apparatus for separating objects interesting region from image
CN104933068A (en) * 2014-03-19 2015-09-23 阿里巴巴集团控股有限公司 Method and device for information searching
WO2015181179A1 (en) * 2014-05-28 2015-12-03 Thomson Licensing Method and apparatus for object tracking and segmentation via background tracking
CN105513050A (en) * 2015-11-25 2016-04-20 北京邮电大学世纪学院 Target image extraction method and apparatus

Also Published As

Publication number Publication date
CN106373139A (en) 2017-02-01

Similar Documents

Publication Publication Date Title
WO2018032702A1 (en) Image processing method and apparatus
US10284789B2 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
WO2016123893A1 (en) Photographing method, device and terminal
US10165201B2 (en) Image processing method and apparatus and terminal device to obtain a group photo including photographer
WO2016127478A1 (en) Image processing method and device, and terminal
US20150117784A1 (en) Image foreground detection
US11776307B2 (en) Arrangement for generating head related transfer function filters
US20160337593A1 (en) Image presentation method, terminal device and computer storage medium
US10176616B2 (en) Automatic capture and refinement of a digital image of a group of people without user intervention
US20070263119A1 (en) Object matting using flash and no-flash images
DE102017126269B4 (en) Apparatus and method for backlit face recognition
WO2018223394A1 (en) Method and apparatus for photographing image
US10594930B2 (en) Image enhancement and repair using sample data from other images
US11917158B2 (en) Static video recognition
US11238302B2 (en) Method and an apparatus for performing object illumination manipulation on an image
KR20150126768A (en) Method for composing image and electronic device thereof
US9179091B2 (en) Avoiding flash-exposed frames during video recording
JP2015126326A (en) Electronic apparatus and image processing method
CN110611768B (en) Multiple exposure photographic method and device
JPWO2019078310A1 (en) Face three-dimensional shape estimation device, face three-dimensional shape estimation method, and face three-dimensional shape estimation program
WO2022145929A1 (en) System and method for automatic video reconstruction with dynamic point of interest
WO2019205566A1 (en) Method and device for displaying image
CN112804451B (en) Method and system for photographing by utilizing multiple cameras and mobile device
CN112949392B (en) Image processing method and device, storage medium and terminal
CN113873160B (en) Image processing method, device, electronic equipment and computer 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: 16913454

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26/04/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16913454

Country of ref document: EP

Kind code of ref document: A1