Coder Social home page Coder Social logo

Comments (4)

jaaronkot avatar jaaronkot commented on August 17, 2024

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.

dsxlong avatar dsxlong commented on August 17, 2024

@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.

jaaronkot avatar jaaronkot commented on August 17, 2024

TextureBounds FrameBounds{502.5, 710, 262.5, 167.5}和FrameBounds{395, 520, 489, 209} 这两组值是固定的,是嘴巴和腮部在人脸上的位置和区域。是因为计算的坐标是按照一张固定的标准人脸或者说平均人脸来确定的,标准人脸图可以由设计师来创建,确定人脸上各个点的坐标。然后转换为纹理采样的坐标,范围在[0, 1] 之间。

from gpupixel.

WoYang avatar WoYang commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.