npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@arilotter/clmutils

v3.0.0

Published

A collection of utility functions to work with CLM Trackr data.

Downloads

12

Readme

clmutils

experimental

This is a set of utility functions which can be used to decipher CLM Trackr

Usage

NPM

You can consume these utility functions in the following two ways:

var utils = require('clmutils');

utils.faceOrientation
utils.getFaceSize
utils.textureCapture
utils.forehead
utils.halo

or

var faceOrientation = require('clmutils/faceOrientation');
var getFaceSize = require('clmutils/getFaceSize');
var textureCapture = require('clmutils/textureCapture');
var forehead = require('clmutils/forehead');
var halo = require('clmutils/halo');

Here are examples as to how to use these utility functions:

var faceOrientation = require('clmutils/faceOrientation');
var getFaceSize = require('clmutils/getFaceSize');
var textureCapture = require('clmutils/textureCapture');
var forehead = require('clmutils/forehead');
var halo = require('clmutils/halo');

// clmPositions would be the positions of vertices from clm

// returns aproximated y and z rotations of face in degrees
var rotationDegrees = faceOrientation(clmPositions); 
console.log(rotationDegrees.z); // z rotation of face
console.log(rotationDegrees.y); // y rotation of face

// an object containing 2d width and height of face is returned
var size = getFaceSize(clmPositions);
console.log(size.width); // width of face
console.log(size.height); // height of face

// add 10 points to create an approximate forehead (original array is modified) since the CLM positions do not include one
forehead(clmPositions, 10); 
// create a halo (original array is modified) if you want extra padding around the face
halo(clmPositions); 

// textureCapture returns UV coordinates based on the clmPositions and can optionally extract a texture from the image or video element onto a canvas2d context.
var texOptions = {
	outContext: null, //an optional canvas2d context if you want a texture rendered from options.image or options.video
	options.video: null, //an optional video element that was used to generate the CLM points
	options.image: null, //an optional image element that was used to generate the CLM points
	options.forehead: false, //include or exclude the points that make up the forehead
	options.halo: false, //include or exclude the points that make up the halo
};
var uvs = textureCapture(clmPositions, texOptions);

License

MIT, see LICENSE.md for details.