Comments (4)
In the future, I will write a dedicated series of articles explaining the principles of the SDK. However, my resources are limited, so please be patient and wait for it. Thank you.
from gpupixel.
@leon4app 你好,有研究出TextureBounds的原理吗?
auto mouth = SourceImage::create("mouth.png");
lipstick_filter_ = FaceMakeupFilter::create();
lipstick_filter_->setImageTexture(mouth);
lipstick_filter_->setTextureBounds(FrameBounds{502.5, 710, 262.5, 167.5});
auto blusher = SourceImage::create("blusher.png");
blusher_filter_ = FaceMakeupFilter::create();
blusher_filter_->setImageTexture(blusher);
blusher_filter_->setTextureBounds(FrameBounds{395, 520, 489, 209});
from gpupixel.
TextureBounds FrameBounds{502.5, 710, 262.5, 167.5}和FrameBounds{395, 520, 489, 209} 这两组值是固定的,是嘴巴和腮部在人脸上的位置和区域。是因为计算的坐标是按照一张固定的标准人脸或者说平均人脸来确定的,标准人脸图可以由设计师来创建,确定人脸上各个点的坐标。然后转换为纹理采样的坐标,范围在[0, 1] 之间。
from gpupixel.
TextureBounds FrameBounds{502.5, 710, 262.5, 167.5}和FrameBounds{395, 520, 489, 209} 这两组值是固定的,是嘴巴和腮部在人脸上的位置和区域。是因为计算的坐标是按照一张固定的标准人脸或者说平均人脸来确定的,标准人脸图可以由设计师来创建,确定人脸上各个点的坐标。然后转换为纹理采样的坐标,范围在[0, 1] 之间。
@gezhaoyou Hi,这里把纹理坐标重新进行了计算对齐到顶点坐标,这个转换原理没有看懂,原理是什么呀?
for (int i = 0; i < point_count; i++) {
textureCoordinates[i * 2 + 0] =(coord[i * 2 + 0] * 1280 - texture_bounds_.x) / texture_bounds_.width;
textureCoordinates[i * 2 + 1] =(coord[i * 2 + 1] * 1280 - texture_bounds_.y) / texture_bounds_.height;
}
from gpupixel.
Related Issues (20)
- 我在linux上运行,想把结果保存到本地,怎么实现? HOT 2
- 我在linux上运行,想把结果保存到本地,发现问题
- [BUG] hue_filter出错
- [BUG]centos上无法安装对应的依赖库 HOT 1
- 使用windows自带的测试,换了一个demo.png就闪退了。是图片有什么特别的要求吗 HOT 3
- [BUG]在iOS工程中导入相关framework后,图片出现反色现象 HOT 3
- A simple python wrapper for gpupixel using SourceRawDataInput and TargetRawDataOutput. HOT 1
- 这么好的东西,大佬能发布成flutter插件吗?一定很受欢迎 HOT 2
- [Feature Request] HOT 3
- msvc编译器如何编译 HOT 6
- glad问题 HOT 1
- Filters flickering
- [BUG] 任何一张其他的图片都会在这里报错,是图片格式问题吗,图片美颜功能在iOS上无法使用 HOT 1
- linux demo cmake failed HOT 4
- [BUG]编译报错 HOT 1
- [Feature Request] API Only HOT 4
- 处理视频数据报错!
- [BUG] 在android7.1的手机上预览图象是黑白的,应该怎么解决
- Python support [Feature Request]
- [Feature Request] 请问 WebAssembly 接下来有何计划吗?我们我看到 wasm.toolchain.cmake 已经存在了,但是还没对外发布。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpupixel.