CN106485723B - 游戏引擎实时抠像方法 - Google Patents

游戏引擎实时抠像方法 Download PDF

Info

Publication number
CN106485723B
CN106485723B CN201610919253.8A CN201610919253A CN106485723B CN 106485723 B CN106485723 B CN 106485723B CN 201610919253 A CN201610919253 A CN 201610919253A CN 106485723 B CN106485723 B CN 106485723B
Authority
CN
China
Prior art keywords
edge
module
image
value
scratching
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610919253.8A
Other languages
English (en)
Other versions
CN106485723A (zh
Inventor
李锐
陶澍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Virtual Reality Technology Co Ltd
Original Assignee
Chongqing Virtual Reality Technology Co Ltd
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 Chongqing Virtual Reality Technology Co Ltd filed Critical Chongqing Virtual Reality Technology Co Ltd
Priority to CN201610919253.8A priority Critical patent/CN106485723B/zh
Publication of CN106485723A publication Critical patent/CN106485723A/zh
Application granted granted Critical
Publication of CN106485723B publication Critical patent/CN106485723B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/20112Image segmentation details
    • G06T2207/20132Image cropping

Landscapes

  • Image Processing (AREA)

Abstract

一种游戏引擎实时抠像方法,其中所述的游戏引擎实时抠像方法,通过抠像模块接收原始图像数据并利用抠像范围、抠像强度、抠像蓝色补偿等参数控制抠像效果,边缘模块接收抠像模块处理后的图像数据通过边缘缩进强度、边缘模糊度、边缘分散度来对抠像边缘进行处理去除黑边现象,颜色模块对图像颜色值进行处理去除绿色色彩溢出。本发明通过抠像模块,边缘模块,颜色模块,三个整合解决了游戏引擎实时抠像中的黑边、绿色色彩溢出等问题,同时本发明合理优化计算量达到实时处理抠像要求。

Description

游戏引擎实时抠像方法
技术领域:
本发明涉及一种游戏引擎实时抠像方法。
背景技术:
本发明公开了一种游戏引擎实时抠像方法。现有的游戏引擎内没有原生的抠像方法,而目前通过插件实现的算法非常简单,只能单纯的通过色彩范围算法去除颜色,在选定的去除颜色上设定一个扩展范围和抠像强度,范围越广抠像的内容越多,抠像强度越大,抠像的边缘越锐利,这样导致抠像的物体边缘要么有黑边,要么边缘非常锐利。同时在整个緑布范围影响下,物体整体偏绿,抠像后无法融合,只能整体降低饱和度,去除绿色偏移,这样整体色彩会有损失,无法还原真实效果。
发明内容:
鉴于此,本发明实施例提供一种游戏引擎实时抠像方法,以实现实时抠像无黑边,去除绿色色彩溢出,同时本发明合理优化计算量达到实时处理抠像要求。
提供了一种游戏引擎实时抠像方法,所述方法包括:
抠像模块,边缘模块,颜色模块。
进一步地,抠像模块接收图像数据,利用抠像范围参数Average、抠像强度参数percent、抠像蓝色补偿参数Bpercent分别控制抠像范围、抠像强度和抠像蓝色补偿等实现对抠像效果的控制;
核心算法计算c.a=clamp(((((1-clamp((c.g-(c.r*(1-_Bpercent)+c.b*_Bpercent)),0,1)))-_Average)*(tan((45+44*_percent)/180*3.1459))+_Average),0,1);
c.r、c.b、c.g、c.a分别为图像数据的RGBA通道Clamp(floatvalue,float min,float max)这个函数的意思是比较value值,如果在这俩值之间就返回value,如果大于max返回max,小于min返回min,得到图像的alpha通道值。
进一步地,边缘模块接收抠像模块处理好的抠像图像数据,通过边缘缩进强度intensity、边缘模糊度softness、边缘分散度spread来控制抠像边缘;边缘模糊度softness用来控制模糊算法对整体图像的模糊处理;边缘分散度spread通过对模糊图像进行迭代重复计算,即重复模糊次数,每进行一次迭代,模糊度扩大1倍,且这样增加spread分散度设置可得到更大的模糊度而不增加多余的计算量;边缘缩进强度intensity通过边缘叠加次数控制边缘缩进强度,通过得到的模糊图片进行反相再减去原始没有模糊的图像则得到一个有模糊的边缘,通过对此边缘的叠加得到完整边缘,再通过原始图像减去边缘图像可去除黑边。
进一步地,颜色模块计算图像像素的绿色通道数值,如果大于红色和蓝色的平均值则此像素绿色通道的数值改为红色和蓝色的平均值,否则不变,最终达到去除绿色色彩溢出的效果。
附图说明
图1示出了游戏引擎实时抠像方法流程。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
如图1所示,一种游戏引擎实时抠像方法,包括:抠像模块、边缘模块和颜色模块。
在步骤S101中,抠像模块接收图像数据,利用抠像范围参数Average、抠像强度参数percent、抠像蓝色补偿参数Bpercent分别控制抠像范围、抠像强度和抠像蓝色补偿等实现对抠像效果的控制;通过核心算法计算c.a=clamp(((((1-clamp((c.g-(c.r*(1-_Bpercent)+c.b*_Bpercent)),0,1)))-_Average)*(tan((45+44*_percent)/180*3.1459))+_Average),0,1),其中c.r、c.b、c.g、c.a分别为图像数据的RGBA通道,通过Clamp(floatvalue,float min,float max)这个函数比较value值,如果在max、min这俩值之间就返回value,如果大于max返回max,小于min返回min,得到图像的alpha通道值。
在步骤S102中,边缘模块接收抠像模块处理好的抠像图像数据,通过边缘缩进强度intensity、边缘模糊度softness、边缘分散度spread来控制抠像边缘;边缘模糊度softness用来控制模糊算法对整体图像的模糊处理;边缘分散度spread通过对模糊图像进行迭代重复计算,即重复模糊次数,每进行一次迭代,模糊度扩大1倍,且这样增加spread分散度设置可得到更大的模糊度而不增加多余的计算量;边缘缩进强度intensity通过边缘叠加次数控制边缘缩进强度,通过得到的模糊图片进行反相再减去原始没有模糊的图像则得到一个有模糊的边缘,通过对此边缘的叠加得到完整边缘,再通过原始图像减去边缘图像可去除黑边。
在步骤S103中,颜色模块计算图像像素的绿色通道数值,如果大于红色和蓝色的平均值则此像素绿色通道的数值改为红色和蓝色的平均值,否则不变,最终达到去除绿色色彩溢出的效果。
本领域的普通技术人员可以意识到,结合本文中所公开的实施例描述的示例的步骤,能够以计算机软件来实现。

Claims (3)

1.一种游戏引擎实时抠像系统,其特征在于:包括抠像模块、边缘模块和颜色模块;所述抠像模块接收图像数据,利用抠像范围、抠像强度、抠像蓝色补偿参数控制抠像效果;所述边缘模块接收抠像模块处理后的图像数据,通过边缘缩进强度、边缘模糊度、边缘分散度来对抠像边缘进行处理去除黑边;所述颜色模块对边缘模块处理后的图像颜色值进行处理去除绿色色彩溢出;
所述抠像模块通过抠像范围参数Average、抠像强度参数percent、抠像蓝色补偿参数Bpercent控制抠像效果,核心算法计算c.a=clamp(((((1‐clamp((c.g‐(c.r*(1‐Bpercent)+c.b*Bpercent)),0,1)))‐Average)*(tan((45+44*percent)/180*3.1459))+Average),0,1);
c.r、c.b、c.g、c.a分别为图像数据的RGBA通道,Clamp(float value,float min,floatmax)这个函数的意思是比较value值,如果在max和min俩值之间就返回value,如果大于max返回max,小于min返回min,该计算最后得到图像的alpha通道值。
2.如权利要求1所述的游戏引擎实时抠像系统,其特征在于:所述边缘模块通过边缘缩进强度intensity、边缘模糊度softness、边缘分散度spread来控制抠像边缘;所述边缘模糊度softness用来控制模糊算法对整体图像的模糊处理;所述边缘分散度spread通过对模糊图像进行迭代重复计算,即重复模糊次数,每进行一次迭代,模糊度扩大1倍;所述边缘缩进强度intensity通过边缘叠加次数控制边缘缩进强度,通过得到的模糊图像进行反相再减去抠像模块处理后的图像数据则得到一个有模糊的边缘,通过对此边缘的叠加得到完整边缘图像,再通过原始图像减去完整边缘图像可去除黑边。
3.如权利要求1所述的游戏引擎实时抠像系统,其特征在于:所述颜色模块计算边缘模块处理后的图像像素的绿色通道数值,当大于红色和蓝色的平均值则此像素绿色通道的数值改为红色和蓝色的平均值,否则不变,达到去除绿色色彩溢出的效果。
CN201610919253.8A 2016-10-21 2016-10-21 游戏引擎实时抠像方法 Active CN106485723B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610919253.8A CN106485723B (zh) 2016-10-21 2016-10-21 游戏引擎实时抠像方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610919253.8A CN106485723B (zh) 2016-10-21 2016-10-21 游戏引擎实时抠像方法

Publications (2)

Publication Number Publication Date
CN106485723A CN106485723A (zh) 2017-03-08
CN106485723B true CN106485723B (zh) 2019-02-19

Family

ID=58270387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610919253.8A Active CN106485723B (zh) 2016-10-21 2016-10-21 游戏引擎实时抠像方法

Country Status (1)

Country Link
CN (1) CN106485723B (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307163B (zh) * 2018-02-07 2019-11-19 重庆虚拟实境科技有限公司 图像数据处理方法及装置、计算机装置及可读存储介质
CN108492303B (zh) * 2018-04-08 2021-03-30 重庆虚拟实境科技有限公司 实时抠像方法及装置、终端装置
CN109190542B (zh) * 2018-08-24 2021-08-13 重庆虚拟实境科技有限公司 基于图像的人体边框识别方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103366364A (zh) * 2013-06-07 2013-10-23 太仓中科信息技术研究院 一种基于颜色差异的抠图方法
CN105678724A (zh) * 2015-12-29 2016-06-15 北京奇艺世纪科技有限公司 图像的背景替换方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8611699B2 (en) * 2008-11-05 2013-12-17 Shachar Carmi Apparatus and method for chroma-key processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103366364A (zh) * 2013-06-07 2013-10-23 太仓中科信息技术研究院 一种基于颜色差异的抠图方法
CN105678724A (zh) * 2015-12-29 2016-06-15 北京奇艺世纪科技有限公司 图像的背景替换方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
解析AVID的SpectraMatte特效;郭晓娴;《计算机光盘软件与应用》;20130415;计算机光盘软件与应用

Also Published As

Publication number Publication date
CN106485723A (zh) 2017-03-08

Similar Documents

Publication Publication Date Title
WO2016206087A1 (zh) 一种低照度图像处理方法和装置
CN106485723B (zh) 游戏引擎实时抠像方法
KR100916073B1 (ko) 영상의 콘트라스트를 향상시키는 히스토그램 스트레칭 장치및 방법
CN108765342A (zh) 一种基于改进暗通道的水下图像复原方法
CN104318535B (zh) 图像去雾的方法、装置及移动终端
CN106570838A (zh) 一种图像亮度优化方法及装置
KR102182697B1 (ko) 영상 처리 장치 및 방법
CN109325918B (zh) 一种图像处理的方法、装置及计算机存储介质
CN110689504B (zh) 一种基于二次引导透射图的水下图像复原方法
CN104766284A (zh) 水下彩色模糊图像的复原方法
CN113034509A (zh) 图像处理方法及装置
CN113706393A (zh) 视频增强方法、装置、设备及存储介质
CN114037641A (zh) 一种低照度图像增强方法、装置、设备及介质
KR20120103878A (ko) 영상에서의 잡음 제거 방법
KR101089902B1 (ko) 디지털 이미지의 에지 영역 판단 장치 및 방법
Sethi et al. Local enhancement of SLIC segmented underwater images using gray world based algorithm
Azizi et al. Noise-aware texture-preserving low-light enhancement
CN117541502A (zh) 图像去雾方法和视频去雾方法
Terai et al. Color image contrast enhancement by retinex model
CN107103321B (zh) 道路二值化图像的生成方法及生成系统
CN110148188B (zh) 一种基于最大差值图像估计低照度图像光照分布的方法
Kurihara et al. Low-light image enhancement via adaptive shape and texture prior
Yoshida et al. Underwater Image Enhancement by Independent Processing Scheme of Brightness and Chromaticity
Yoshida et al. Image Quality Improvement of Underwater Images in Ideal HSI Color Space
Goto et al. Blind image restoration for blurred images implemented on GPU

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 400053 No. 129 Huanghuoping Street, Jiulongpo District, Chongqing (3rd floor, No. 2 Building, 501 Art Base)

Patentee after: CHONGQING IVREAL TECHNOLOGY CO.,LTD.

Address before: 401120 the office space of Chongqing advertising industry park, Yubei District Food City Avenue, Chongqing, 15-3-2-1

Patentee before: CHONGQING IVREAL TECHNOLOGY CO.,LTD.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Real time matting method of game engine

Effective date of registration: 20221102

Granted publication date: 20190219

Pledgee: Chongqing Longshang financing Company Limited by Guarantee

Pledgor: CHONGQING IVREAL TECHNOLOGY CO.,LTD.

Registration number: Y2022500000092

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20231018

Granted publication date: 20190219

Pledgee: Chongqing Longshang financing Company Limited by Guarantee

Pledgor: CHONGQING IVREAL TECHNOLOGY CO.,LTD.

Registration number: Y2022500000092