WO2020007307A1 - 全景图像的天空滤镜方法及便携式终端 - Google Patents

全景图像的天空滤镜方法及便携式终端 Download PDF

Info

Publication number
WO2020007307A1
WO2020007307A1 PCT/CN2019/094450 CN2019094450W WO2020007307A1 WO 2020007307 A1 WO2020007307 A1 WO 2020007307A1 CN 2019094450 W CN2019094450 W CN 2019094450W WO 2020007307 A1 WO2020007307 A1 WO 2020007307A1
Authority
WO
WIPO (PCT)
Prior art keywords
sky
image
panoramic
ground
area
Prior art date
Application number
PCT/CN2019/094450
Other languages
English (en)
French (fr)
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 深圳岚锋创视网络科技有限公司
Priority to JP2020573130A priority Critical patent/JP7247236B2/ja
Priority to EP19830791.0A priority patent/EP3819859B1/en
Priority to US17/257,582 priority patent/US11887362B2/en
Publication of WO2020007307A1 publication Critical patent/WO2020007307A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/17Image acquisition using hand-held instruments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/16Image acquisition using multiple overlapping images; Image stitching

Definitions

  • the invention belongs to the field of image processing, and particularly relates to a sky filter method for a panoramic image and a portable terminal.
  • the sky filter technology can produce a realistic natural sky effect, so that the sky background of the image is replaced with the desired sky effect, which can create a more realistic picture.
  • the effect of the sky filter technology is closely related to the accuracy of the sky detection algorithm.
  • the current sky recognition algorithm based on color prior is faster, but the recognition accuracy is lower. This is because the sky's color will change significantly in different time periods and different weather conditions, so the color-based sky recognition algorithm cannot adapt to the sky's color change.
  • the sky recognition algorithm based on the gradient prior assumes that the gradient of the sky area is relatively gentle. This algorithm optimizes the construction of an energy function to obtain a continuous region with a smooth gradient in the image, which is the sky region. However, when there are clouds in the sky, there are obvious gradient changes in the sky, and the assumption of the algorithm is no longer valid. Therefore, the gradient-based sky recognition algorithm is not suitable for the presence of clouds, sun and other attachments in the sky. The reason is that the above algorithm only uses limited prior knowledge when detecting the sky, and cannot cover various sky changes.
  • the invention proposes a sky filter method for a panoramic image, a computer-readable storage medium, and a portable terminal.
  • the purpose is to enable the sky in the image to be replaced with a different sky background, to generate a realistic sky that is integrated with the picture, and improve the current sky Defects with low detection accuracy can achieve more realistic sky filter effect.
  • the present invention provides a sky filter method for a panoramic image, the method including:
  • the positive and negative samples of each panoramic image in the data set are sequentially input to the support vector machine SVM for training to obtain the model;
  • a multi-resolution fusion algorithm is used to fuse the panoramic template image of the sky and the test panoramic image to achieve the effect of the sky filter.
  • the pixel value of the sky area in the labeled mask image is marked as 1, and the pixel value of the ground area is marked as 0.
  • the features include: a first feature set and a second feature set, the first feature set includes: an R channel value, a G channel value, a B channel value, and a variance within a local domain window; the second feature The set includes: B / G value, B / R value, and product of row coordinates and variance; mark the first feature set and the second feature set of the sky area as positive samples, and mark the first feature set and the second feature of the ground area Sets are marked as negative samples.
  • removing the misclassified pixels and misclassified regions in the initial mask image to obtain the corresponding accurate mask image is specifically:
  • the method is to set the weight of the pixel (x, y) as p, with:
  • H is the height of the image
  • W is the width of the image
  • removing the misclassified areas in the sky and the ground to obtain an accurate mask image is specifically:
  • the two-pass algorithm is used to detect the connected domain of the initial mask image filtered out of noise.
  • the area of each connected domain in the upper sky area of the image is calculated as S1, and the minimum sky area threshold th1 is set.
  • the value of S 1 can be calculated as the number of pixels in each connected domain of the sky region, and the threshold th1 is 1/40 of the image area;
  • the area of each connected domain in the lower ground area of the statistical image is S2.
  • the minimum ground area threshold th2 is set and divided according to the following formula.
  • the value of S 2 can be calculated as the number of pixels in each connected region of the ground region, and the threshold th2 is 1/2 of the area of the maximum ground connected region;
  • the multi-resolution fusion algorithm is used to fuse the sky panoramic template image and the test panoramic image, so as to achieve the effect of the sky filter:
  • a multi-resolution fusion algorithm is used to construct a Laplacian pyramid for the panoramic template image and the test panoramic image of the sky, a Gaussian pyramid is constructed for the precise mask image, and the Laplacian pyramid is constructed using the constructed Gaussian pyramid.
  • the sky panorama template image and the test panorama image are merged to reconstruct the fused image layer by layer to achieve the effect of the sky filter.
  • the present invention provides a computer-readable storage medium.
  • the steps of the sky filter method for a panoramic image as described above are implemented.
  • the present invention provides a portable terminal, including:
  • One or more processors are One or more processors;
  • One or more computer programs wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, which are implemented when the processors execute the computer programs Steps of the sky filter method for panoramic images as described above.
  • the invention detects the sky area in the panoramic image through a machine learning algorithm, improves the accuracy of automatically detecting the sky, and uses a multi-resolution fusion algorithm to fuse the panoramic sky template image and the panoramic image to achieve a better sky filter effect.
  • FIG. 1 is a process diagram of a sky filter method for a panoramic image provided by Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart of a sky filter method for a panoramic image provided by Embodiment 1 of the present invention.
  • FIG. 3 is a schematic structural diagram of a portable terminal according to a third embodiment of the present invention.
  • a sky filter method for a panoramic image provided by Embodiment 1 of the present invention includes the following steps:
  • panoramic images in the dataset include more than one thousand.
  • the dimensions of the panoramic images are the same. The larger the number of panoramic images, the better.
  • the sky area of each panoramic image in the dataset includes the sky, clouds, and sun.
  • the ground area is outside the sky area.
  • the area of the dataset also includes many different scenes and landscapes. For example, the scenes in time include early morning, noon, and evening.
  • the scenes of different weather conditions include sunny, cloudy, cloudy, light rain, and Smog, etc .;
  • the pixel value of the sky area is marked as 1, and the pixel value of the ground area is marked as 0.
  • the panoramic template image of the sky is a preset panoramic image containing only the sky, and is used as a template for the sky filter.
  • the features include: a first feature set and a second feature set, the first feature set includes: an R channel value, a G channel value, a B channel value, and a variance within a local domain window; the second feature set includes: B / G value, B / R value and the product of row coordinates and variance.
  • the first feature set is an independent feature, and the second feature set is a combined feature.
  • the first feature set and the second feature set of the sky region are labeled as positive samples, and the first feature set and the second feature set of the ground region are labeled as negative samples.
  • Support vector machine (SVM) theory is a feedforward neural network first proposed by Vapnik et al. In 1995. It is a new pattern recognition method developed on the basis of statistical learning theory. The classification model shows many unique advantages in solving small sample, non-linear and high-dimensional pattern recognition problems.
  • the features of the test panoramic image are extracted, and the features here include the first feature set and the second feature set in step S102.
  • the features are input into the trained model, and pixels output by the SVM classifier as 1 are labeled as sky pixels, and pixels output as 0 are labeled as non-sky pixels.
  • An initial mask image labeled with sky pixels and ground pixels is obtained. .
  • S105 may specifically include:
  • S1051. Perform median filtering on the initial mask image. Based on the prior knowledge of the sky above the image and the ground below the image, single pixels that are misclassified are filtered out.
  • W is a window of 3 * 3 or 5 * 5
  • f (mk, nl) is the value at the pixel (mk, nl), (k, l) ⁇ W; the method is to set the pixel (x, y)
  • the weight value is p, which is:
  • H is the height of the image
  • W is the width of the image
  • the two-pass algorithm is used to detect the connected domain of the initial mask image.
  • the area of each connected domain in the upper sky area of the image is calculated as S1, and the minimum sky area threshold th1 is set, which is divided according to the following judgment rules:
  • S 1 is the number of pixels in each connected domain of the sky region, and the minimum area threshold th1 is 1/40 of the image area.
  • the area of each connected domain in the lower ground area of the statistical image is S2. If the minimum ground area threshold th2 is set, it is divided according to the following judgment rules:
  • S 2 is the number of pixels in each connected domain of the ground area
  • the minimum area threshold th2 is 1/2 of the area of the maximum ground connected domain.
  • the misclassified sky area can be removed and an accurate mask image can be obtained.
  • S106 may specifically be:
  • a multi-resolution fusion algorithm is used to construct a Laplacian pyramid for the panoramic template image of the sky and the test panoramic image, construct a Gaussian pyramid for the precise mask image, and use the constructed Gaussian pyramid pair to construct the Laplacian pyramid.
  • the panoramic template image of the sky and the test panoramic image are merged to reconstruct the fused image layer by layer to achieve the effect of the sky filter.
  • the resolution of the panoramic template image and the test panoramic image may be different, but the fusion processing method used is the same.
  • the second embodiment of the present invention provides a computer-readable storage medium.
  • the steps of the sky filter method for a panoramic image provided by the first embodiment of the present invention are implemented.
  • FIG. 3 shows a specific structural block diagram of a portable terminal according to a third embodiment of the present invention.
  • a portable terminal 100 includes: one or more processors 101, a memory 102, and one or more computer programs. 101 and the memory 102 are connected by a bus, the one or more computer programs are stored in the memory 102, and are configured to be executed by the one or more processors 101, the processors 101 executing all When describing the computer program, the steps of a sky filter method for a panoramic image provided by the first embodiment of the present invention are described.
  • the sky area in the panoramic image is detected by a machine learning algorithm, the accuracy of automatic sky detection is improved, and a multi-resolution fusion algorithm is used to fuse the panoramic sky template image and the panoramic image to achieve the effect of a sky filter.
  • the storage media such as ROM / RAM, magnetic disk, optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供了一种全景图像的天空滤镜方法及便携式终端。所述方法包括:获取若干含有天空区域的全景图像作为数据集,并标记出数据集中每幅全景图像的天空区域和地面区域,得到数据集中每幅全景图像对应的标注掩膜图像,获取天空的全景模板图像;根据标注的掩膜图像分别提取数据集中每幅全景图像的天空区域和地面区域的特征,并标记出每幅全景图像的正样本和负样本;依次将数据集中每幅全景图像的正样本和负样本输入支持向量机SVM进行训练,获得模型;提取测试全景图像的特征,输入模型,获得标记了天空像素和地面像素的初始掩膜图像;去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像;针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现天空滤镜的效果。

Description

全景图像的天空滤镜方法及便携式终端 技术领域
本发明属于图像处理领域,尤其涉及一种全景图像的天空滤镜方法及便携式终端。
背景技术
天空滤镜技术能制作生成逼真的自然天空效果,让图像的天空背景替换成想要的天空效果,能营造较为真实的画面感。天空滤镜技术的实现效果与天空检测算法的准确率密切相关。
目前基于颜色先验的天空识别算法速度较快,但是识别精度较低。这是因为天空在不同时间段、不同天气条件下,天空的颜色会发生显著变化,因此基于颜色的天空识别算法无法适应天空颜色的变化。基于梯度先验的天空识别算法假设天空区域的梯度变化较为平缓。该算法通过构造一个能量函数优化得到图像中梯度较为平滑的连续区域,即为天空区域。但是当天空中存在云彩时,天空中存在明显的梯度变化,该算法的假设不再成立。因此基于梯度的天空识别算法不适用于天空中存在云、太阳等附着物的情况。究其原因,上述算法在检测天空时仅仅利用了有限的先验知识,不能涵盖多样的天空变化。
技术问题
本发明提出一种全景图像的天空滤镜方法、计算机可读存储介质及便携式终端,旨在让图像中天空能替换成不同的天空背景,生成和画面融为一体的逼真的天空,提高目前天空检测的准确率低的缺陷,实现较为逼真的天空滤镜效果。
技术解决方案
第一方面,本发明提供了一种全景图像的天空滤镜方法,所述方法包括:
获取若干含有天空区域的全景图像作为数据集,并标记出数据集中每幅全景图像的天空区域和地面区域,得到数据集中每幅全景图像对应的标注掩膜图 像,获取天空的全景模板图像;
根据标注的掩膜图像分别提取数据集中每幅全景图像的天空区域和地面区域的特征,并标记出每幅全景图像的正样本和负样本;
依次将数据集中每幅全景图像的正样本和负样本输入支持向量机SVM进行训练,获得模型;
提取测试全景图像的特征,输入模型,获得标记了天空像素和地面像素的初始掩膜图像;
去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像;
针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现天空滤镜的效果。
可选地,所述的标注掩膜图像中天空区域的像素值标记为1,地面区域的像素值标记为0。
可选地,所述的特征包括:第一特征集和第二特征集,该第一特征集包括:R通道值,G通道值,B通道值和局部领域窗口内的方差;该第二特征集包括:B/G值,B/R值和行坐标与方差的乘积;将天空区域的第一特征集和第二特征集标记为正样本,将地面区域的第一特征集和第二特征集标记为负样本。
可选地,所述去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像具体为:
对初始掩膜图像进行中值滤波,基于天空在图像上部分,地面在图像下部分的先验知识,滤除误分类的单个像素点,方法为设像素点(x,y)的权重值为p,有:
Figure PCTCN2019094450-appb-000001
其中,H为图像的高度,W为图像的宽度,x∈(0,W-1);
利用权重图进一步对初始掩膜图像先卷积再阈值化,获得滤除噪点的初始掩膜图像;
去除天空和地面中的误分类区域,得到精确掩膜图像。
可选地,所述去除天空和地面中的误分类区域,得到精确掩膜图像具体为:
利用two-pass算法对滤除噪点的初始掩膜图像进行连通域检测,统计图像上部天空区域每个连通域的面积为S1,设定天空最小面积阈值th1,按照以下公式划分,
Figure PCTCN2019094450-appb-000002
其中,S 1的值可计算为天空区域每个连通域中像素的个数,阈值th1为图像面积的1/40;
统计图像下部地面区域每个连通域的面积为S2,设定地面最小面积阈值th2,按照以下公式划分,
Figure PCTCN2019094450-appb-000003
其中,S 2的值可计算为地面区域每个连通域中像素的个数,阈值th2为最大地面连通域面积的1/2;
通过以上划分得到天空区域的精确掩膜图像,完成天空区域的检测。
可选地,所述针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现天空滤镜的效果具体为:
采用多分辨率融合算法分别对天空的全景模板图像和测试全景图像构建拉普拉斯金字塔,对所述的精确掩膜图像构建高斯金字塔,利用构建的高斯金字塔对构建的拉普拉斯金字塔的天空的全景模板图像和测试全景图像进行合并,逐层重建出融合后的图像,实现天空滤镜的效果。
第二方面,本发明提供了一种计算机可读存储介质,所述计算机程序被处理器执行时实现如上述的全景图像的天空滤镜方法的步骤。
第三方面,本发明提供了一种便携式终端,包括:
一个或多个处理器;
存储器;以及
一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述处理器执行所述计算机程序时实现如上述的全景图像的天空滤镜方法的步骤。
有益效果
本发明通过机器学习算法检测全景图像中的天空区域,提高了自动检测天空的准确率,并利用多分辨率融合算法融合全景天空模板图像与全景图像,实现了较好的天空滤镜效果。
附图说明
图1是本发明实施例一提供的全景图像的天空滤镜方法过程图。
图2是本发明实施例一提供的全景图像的天空滤镜方法流程图。
图3是本发明实施例三提供的便携式终端的结构示意图。
本发明的实施方式
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。
实施例一:
请参阅图1和图2,本发明实施例一提供的全景图像的天空滤镜方法包括以下步骤:
S101.获取若干含有天空区域的全景图像作为数据集,并标记出数据集中每幅全景图像的天空区域和地面区域,得到数据集中每幅全景图像对应的标注掩膜图像,获取天空的全景模板图像;
数据集中若干全景图像包括一千张以上,全景图像的尺寸一致,全景图像 的数量越多越好;数据集中每幅全景图像的天空区域具体包含天空、云和太阳等,地面区域是天空区域以外的区域;数据集的种类也包括很多种不同的场景和地貌等,例如在时间上的场景包括清晨、中午、傍晚各个时间段,不同的天气状况的场景包括晴天、阴天、多云、小雨和雾霾等;
所述的标注掩膜图像中天空区域的像素值标记为1,地面区域的像素值标记为0。
所述天空的全景模板图像为预先设定的只含有天空的全景图像,作为天空滤镜的模板。
S102.根据标注的掩膜图像分别提取数据集中每幅全景图像的天空区域和地面区域的特征,并标记出每幅全景图像的正样本和负样本;
所述的特征包括:第一特征集和第二特征集,该第一特征集包括:R通道值,G通道值,B通道值和局部领域窗口内的方差;该第二特征集包括:B/G值,B/R值和行坐标与方差的乘积。第一特征集为独立特征,第二特征集为组合特征。将天空区域的第一特征集和第二特征集标记为正样本,将地面区域的第一特征集和第二特征集标记为负样本。
S103.依次将数据集中每幅全景图像的正样本和负样本输入支持向量机SVM进行训练,获得模型;
支持向量机(support vector machine,简称SVM)理论是Vapnik等人1995年首先提出来的一种前馈神经网络,是在统计学习理论基础上发展而来的一种新的模式识别方法,是一个分类模型,在解决小样本、非线性及高维模式识别问题中表现出许多特有的优势。
S104.提取测试全景图像的特征,输入模型,获得标记了天空像素和地面像素的初始掩膜图像;
提取测试全景图像的特征,此处的特征包括步骤S102中的第一特征集和第二特征集。将所述的特征输入训练好的模型中,将SVM分类器输出为1的像素标记为天空像素,输出为0的像素标记为非天空像素,获得标记了天空像 素和地面像素的初始掩膜图像。
S105.去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像;
S105具体可以包括:
S1051.对初始掩膜图像进行中值滤波,基于天空在图像上部分,地面在图像下部分的先验知识,滤除误分类的单个像素点。
中值滤波是由Turky在1971年提出的,基本思想是:把局部区域的像素按灰度级进行排序,取该领域中灰度的中值作为当前像素的灰度值,用一个窗口W在图像上扫描、排序,像素点(m,n)处的中值g可用公式表示为:
g(m,n)=Median{f(m-k,n-l)}
其中,W为3*3或5*5的窗口,f(m-k,n-l)为像素点(m-k,n-l)处的值,(k,l)∈W;方法为设像素点(x,y)的权重值为p,有:
Figure PCTCN2019094450-appb-000004
其中,H为图像的高度,W为图像的宽度,x∈(0,W-1);
S1052.利用权重图进一步对初始掩膜图像进行卷积运算并阈值化,获得滤除噪点的初始掩膜图像。
S1053.去除天空和地面中的误分类区域,得到精确掩膜图像。
具体为利用two-pass算法对初始掩膜图像进行连通域检测,统计图像上部天空区域每个连通域的面积为S1,设定天空最小面积阈值th1,则按照如下判断规则划分:
Figure PCTCN2019094450-appb-000005
其中,S 1为天空区域每个连通域中像素的个数,最小面积阈值th1为图像面积的1/40。
统计图像下部地面区域每个连通域的面积为S2,设定地面最小面积阈值th2,则按照如下判断规则划分:
Figure PCTCN2019094450-appb-000006
其中,S 2为地面区域每个连通域中像素的个数,最小面积阈值th2为最大地面连通域面积的1/2。
通过以上判断可以去除误分类的天空区域,得到精确掩膜图像。
S106.针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现天空滤镜的效果;
S106具体可以为:
采用多分辨率融合算法分别对天空的全景模板图像和测试全景图像构建拉普拉斯金字塔,对所述的精确掩膜图像构建高斯金字塔,并利用构建的高斯金字塔对构建的拉普拉斯金字塔的天空的全景模板图像和测试全景图像进行合并,逐层重建出融合后的图像,实现天空滤镜的效果。其中全景模板图像和测试全景图像的分辨率有可能不同,但采用的融合处理方法是一样的。
实施例二:
本发明实施例二提供了一种计算机可读存储介质,所述计算机程序被处理器执行时实现如本发明实施例一提供的全景图像的天空滤镜方法的步骤。
实施例三:
图3示出了本发明实施例三提供的便携式终端的具体结构框图,一种便携式终端100包括:一个或多个处理器101、存储器102、以及一个或多个计算机程序,其中所述处理器101和所述存储器102通过总线连接,所述一个或多个计算机程序被存储在所述存储器102中,并且被配置成由所述一个或多个处理器101执行,所述处理器101执行所述计算机程序时实现如本发明实施例一提供的一种全景图像的天空滤镜方法的步骤。
在本发明中,通过机器学习算法检测全景图像中的天空区域,提高了自动 检测天空的准确率,并利用多分辨率融合算法融合全景天空模板图像与全景图像,实现了天空滤镜的效果。
在本发明实施例中,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于一计算机可读取存储介质中,所述的存储介质,如ROM/RAM、磁盘、光盘等。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (9)

  1. 一种全景图像的天空滤镜方法,其特征在于,包括以下步骤:
    获取若干含有天空区域的全景图像作为数据集,并标记出数据集中每幅全景图像的天空区域和地面区域,得到数据集中每幅全景图像对应的标注掩膜图像,获取天空的全景模板图像;
    根据标注的掩膜图像分别提取数据集中每幅全景图像的天空区域和地面区域的特征,并标记出每幅全景图像的正样本和负样本;
    依次将数据集中每幅全景图像的正样本和负样本输入支持向量机SVM进行训练,获得模型;
    提取测试全景图像的特征,输入模型,获得标记了天空像素和地面像素的初始掩膜图像;
    去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像;
    针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现天空滤镜的效果。
  2. 如权利要求1所述的方法,其特征在于:所述的标注掩膜图像中天空区域的像素值标记为1,地面区域的像素值标记为0。
  3. 如权利要求1所述的方法,其特征在于:所述的特征包括:第一特征集和第二特征集,该第一特征集包括:R通道值,G通道值,B通道值和局部领域窗口内的方差;该第二特征集包括:B/G值,B/R值和行坐标与方差的乘积;将天空区域的第一特征集和第二特征集标记为正样本,将地面区域的第一特征集和第二特征集标记为负样本。
  4. 如权利要求1所述的方法,其特征在于:所述去除初始掩膜图像中的误分类像素点和误分类区域,得到对应的精确掩膜图像具体为:
    对初始掩膜图像进行中值滤波,基于天空在图像上部分,地面在图像下部分的先验知识,滤除误分类的单个像素点;
    利用权重图进一步对初始掩膜图像先卷积再阈值化,获得滤除噪点的初始 掩膜图像;
    去除天空和地面中的误分类区域,得到精确掩膜图像。
  5. 如权利要求4所述的方法,其特征在于:所述对初始掩膜图像进行中值滤波,基于天空在图像上部分,地面在图像下部分的先验知识,滤除误分类的单个像素点具体为:
    设像素点(x,y)的权重值为p,有:
    Figure PCTCN2019094450-appb-100001
    其中,H为图像的高度,W为图像的宽度,x∈(0,W-1)。
  6. 如权利要求4所述的方法,其特征在于:所述去除天空和地面中的误分类区域,得到精确掩膜图像具体为:
    利用two-pass算法对滤除噪点的初始掩膜图像进行连通域检测,统计图像上部天空区域每个连通域的面积为S1,设定天空最小面积阈值th1,按照以下公式划分,
    Figure PCTCN2019094450-appb-100002
    其中,S 1的值可计算为天空区域每个连通域中像素的个数,阈值th1为图像面积的1/40;
    统计图像下部地面区域每个连通域的面积为S2,设定地面最小面积阈值th2,按照以下公式划分,
    Figure PCTCN2019094450-appb-100003
    其中,S 2的值可计算为地面区域每个连通域中像素的个数,阈值th2为最大地面连通域面积的1/2;
    通过以上划分得到天空区域的精确掩膜图像,完成天空区域的检测。
  7. 如权利要求1所述的方法,其特征在于:所述针对精确掩膜图像,采用多分辨率融合算法对天空的全景模板图像和测试全景图像进行融合,从而实现 天空滤镜的效果具体为:
    采用多分辨率融合算法分别对天空的全景模板图像和测试全景图像构建拉普拉斯金字塔,对所述的精确掩膜图像构建高斯金字塔,利用构建的高斯金字塔对构建的拉普拉斯金字塔的天空的全景模板图像和测试全景图像进行合并,逐层重建出融合后的图像,实现天空滤镜的效果。
  8. 一种计算机可读存储介质,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的全景图像的天空滤镜方法的步骤。
  9. 一种便携式终端,包括:
    一个或多个处理器;
    存储器;以及
    一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的全景图像的天空滤镜方法的步骤。
PCT/CN2019/094450 2018-07-03 2019-07-02 全景图像的天空滤镜方法及便携式终端 WO2020007307A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2020573130A JP7247236B2 (ja) 2018-07-03 2019-07-02 パノラマ画像のスカイフィルタ方法及び携帯端末
EP19830791.0A EP3819859B1 (en) 2018-07-03 2019-07-02 Sky filter method for panoramic images and portable terminal
US17/257,582 US11887362B2 (en) 2018-07-03 2019-07-02 Sky filter method for panoramic images and portable terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810711718.X 2018-07-03
CN201810711718.XA CN109003237A (zh) 2018-07-03 2018-07-03 全景图像的天空滤镜方法、装置及便携式终端

Publications (1)

Publication Number Publication Date
WO2020007307A1 true WO2020007307A1 (zh) 2020-01-09

Family

ID=64598093

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/094450 WO2020007307A1 (zh) 2018-07-03 2019-07-02 全景图像的天空滤镜方法及便携式终端

Country Status (5)

Country Link
US (1) US11887362B2 (zh)
EP (1) EP3819859B1 (zh)
JP (1) JP7247236B2 (zh)
CN (1) CN109003237A (zh)
WO (1) WO2020007307A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114022473A (zh) * 2021-11-19 2022-02-08 中国科学院长春光学精密机械与物理研究所 一种基于红外图像的地平线检测方法

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109003237A (zh) 2018-07-03 2018-12-14 深圳岚锋创视网络科技有限公司 全景图像的天空滤镜方法、装置及便携式终端
CN109769110B (zh) 2019-01-22 2020-07-14 影石创新科技股份有限公司 一种3d小行星动态图的生成方法、装置及便携式终端
CN109785397B (zh) * 2019-01-25 2021-04-02 中电健康云科技有限公司 一种图像中色卡颜色提取方法及装置
CN110298813A (zh) * 2019-06-28 2019-10-01 北京金山安全软件有限公司 一种处理图片的方法、装置及电子设备
CN112241753B (zh) * 2019-07-19 2024-05-24 北京京东振世信息技术有限公司 判断物品成新率的方法和装置
CN110363171A (zh) * 2019-07-22 2019-10-22 北京百度网讯科技有限公司 天空区域预测模型的训练方法和识别天空区域的方法
CN111489322B (zh) * 2020-04-09 2023-05-26 广州光锥元信息科技有限公司 给静态图片加天空滤镜的方法及装置
CN113034514A (zh) * 2021-03-19 2021-06-25 影石创新科技股份有限公司 天空区域分割方法、装置、计算机设备和存储介质
CN113051430B (zh) * 2021-03-26 2024-03-26 北京达佳互联信息技术有限公司 模型训练方法、装置、电子设备、介质及产品
CN114241537B (zh) * 2021-12-31 2022-12-23 智慧眼科技股份有限公司 指静脉图像真伪识别方法、装置、计算机设备及存储介质
CN116310851B (zh) * 2023-05-26 2023-08-15 中国科学院空天信息创新研究院 遥感图像变化检测方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8611696B1 (en) * 2008-06-04 2013-12-17 Google Inc. Panoramic image fill
CN105023260A (zh) * 2014-04-22 2015-11-04 Tcl集团股份有限公司 一种全景图像融合方法及融合装置
CN105608667A (zh) * 2014-11-20 2016-05-25 深圳英飞拓科技股份有限公司 一种全景拼接的方法及装置
CN107784629A (zh) * 2017-11-24 2018-03-09 努比亚技术有限公司 全景照片滤镜处理方法及移动终端
CN108093174A (zh) * 2017-12-15 2018-05-29 北京臻迪科技股份有限公司 拍照设备的构图方法、装置和拍照设备
CN109003237A (zh) * 2018-07-03 2018-12-14 深圳岚锋创视网络科技有限公司 全景图像的天空滤镜方法、装置及便携式终端

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7062085B2 (en) 2001-09-13 2006-06-13 Eastman Kodak Company Method for detecting subject matter regions in images
JP2004240732A (ja) 2003-02-06 2004-08-26 Konica Minolta Holdings Inc 画像合成方法、画像合成装置、画像合成プログラム及び画像記録装置
EP1665125A4 (en) * 2003-09-02 2007-10-03 Ludwig Inst Cancer Res DATA-TRIGGER MOTION CORRECTION FOR NUCLEAR IMAGING
US7336819B2 (en) 2003-12-29 2008-02-26 Eastman Kodak Company Detection of sky in digital color images
JP5206209B2 (ja) 2008-08-04 2013-06-12 ソニー株式会社 撮像装置と画像処理装置と撮像方法およびプログラム
CN101425137A (zh) * 2008-11-10 2009-05-06 北方工业大学 基于拉普拉斯金字塔的人脸图像融合方法
JP2010156815A (ja) * 2008-12-26 2010-07-15 Pioneer Electronic Corp 地図情報管理装置、地図情報管理方法及び地図情報管理プログラム
US20120133639A1 (en) * 2010-11-30 2012-05-31 Microsoft Corporation Strip panorama
JP5864937B2 (ja) 2011-07-23 2016-02-17 キヤノン株式会社 画像処理装置、画像処理方法およびプログラム
CN103927720A (zh) * 2014-04-09 2014-07-16 厦门美图之家科技有限公司 一种天空图像的识别及优化方法
JP2016092518A (ja) 2014-10-31 2016-05-23 キヤノン株式会社 画像処理装置、その制御方法、および制御プログラム、並びに撮像装置
CN104683767B (zh) * 2015-02-10 2018-03-06 浙江宇视科技有限公司 透雾图像生成方法及装置
JP6495446B2 (ja) 2015-06-08 2019-04-03 オリンパス株式会社 ぼけ強調画像処理装置、ぼけ強調画像処理プログラム、ぼけ強調画像処理方法
CN105528575B (zh) * 2015-11-18 2019-03-19 首都师范大学 基于上下文推理的天空检测方法
US9858675B2 (en) 2016-02-11 2018-01-02 Adobe Systems Incorporated Object segmentation, including sky segmentation
US10074161B2 (en) * 2016-04-08 2018-09-11 Adobe Systems Incorporated Sky editing based on image composition
CN106875351A (zh) * 2017-01-11 2017-06-20 西南科技大学 一种面向大面积天空区域图像的去雾方法
CN107317967B (zh) * 2017-07-27 2020-03-27 Oppo广东移动通信有限公司 图像处理方法、装置、移动终端及计算机可读存储介质
CN107622280B (zh) * 2017-09-14 2020-06-12 河南科技大学 基于场景分类的模块化处方式图像显著性检测方法
CN107833185B (zh) * 2017-10-13 2020-10-02 西安天和防务技术股份有限公司 图像去雾方法及装置、存储介质、电子设备
GB2583676B (en) * 2018-01-18 2023-03-29 Gumgum Inc Augmenting detected regions in image or video data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8611696B1 (en) * 2008-06-04 2013-12-17 Google Inc. Panoramic image fill
CN105023260A (zh) * 2014-04-22 2015-11-04 Tcl集团股份有限公司 一种全景图像融合方法及融合装置
CN105608667A (zh) * 2014-11-20 2016-05-25 深圳英飞拓科技股份有限公司 一种全景拼接的方法及装置
CN107784629A (zh) * 2017-11-24 2018-03-09 努比亚技术有限公司 全景照片滤镜处理方法及移动终端
CN108093174A (zh) * 2017-12-15 2018-05-29 北京臻迪科技股份有限公司 拍照设备的构图方法、装置和拍照设备
CN109003237A (zh) * 2018-07-03 2018-12-14 深圳岚锋创视网络科技有限公司 全景图像的天空滤镜方法、装置及便携式终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3819859A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114022473A (zh) * 2021-11-19 2022-02-08 中国科学院长春光学精密机械与物理研究所 一种基于红外图像的地平线检测方法
CN114022473B (zh) * 2021-11-19 2024-04-26 中国科学院长春光学精密机械与物理研究所 一种基于红外图像的地平线检测方法

Also Published As

Publication number Publication date
US11887362B2 (en) 2024-01-30
JP7247236B2 (ja) 2023-03-28
EP3819859B1 (en) 2024-02-21
EP3819859A1 (en) 2021-05-12
JP2021528784A (ja) 2021-10-21
US20210272245A1 (en) 2021-09-02
EP3819859A4 (en) 2022-03-16
CN109003237A (zh) 2018-12-14

Similar Documents

Publication Publication Date Title
WO2020007307A1 (zh) 全景图像的天空滤镜方法及便携式终端
WO2019169895A1 (zh) 抗侧脸干扰的人脸快速检测方法
CN109154978B (zh) 用于检测植物疾病的系统和方法
Wang et al. Image segmentation of overlapping leaves based on Chan–Vese model and Sobel operator
WO2018076212A1 (zh) 基于反卷积神经网络的场景语义分割方法
Yang et al. Graph-regularized saliency detection with convex-hull-based center prior
CN104143079B (zh) 人脸属性识别的方法和系统
CN105740780B (zh) 人脸活体检测的方法和装置
CN106650737B (zh) 图像自动裁剪方法
CN107133943A (zh) 一种防震锤缺陷检测的视觉检测方法
CN108304873A (zh) 基于高分辨率光学卫星遥感影像的目标检测方法及其系统
CN107749052A (zh) 基于深度学习神经网络的图像去雾方法及系统
CN107203990A (zh) 一种基于模板匹配与图像质量评估的标贴破损检测方法
CN107066916B (zh) 基于反卷积神经网络的场景语义分割方法
CN104050471A (zh) 一种自然场景文字检测方法及系统
CN108446707B (zh) 基于关键点筛选及dpm确认的遥感图像飞机检测方法
CN102332092A (zh) 一种基于视频分析的火焰检测方法
CN107944403A (zh) 一种图像中的行人属性检测方法及装置
WO2018090355A1 (zh) 图像自动裁剪方法
CN110363196B (zh) 一种倾斜文本的文字精准识别的方法
CN110390228A (zh) 基于神经网络的交通标志图片识别方法、装置及存储介质
CN107392251A (zh) 一种使用分类图片提升目标检测网络性能的方法
CN109460767A (zh) 基于规则的凸印银行卡卡号分割与识别方法
CN106339665A (zh) 一种人脸的快速检测方法
CN106485226A (zh) 一种基于神经网络的视频行人检测方法

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: 19830791

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020573130

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019830791

Country of ref document: EP

Effective date: 20210203