GithubHelp home page GithubHelp logo

isabella232 / clmdraw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from experience-monks/clmdraw

0.0 0.0 0.0 188 KB

CLM Trackr has a built in draw method. This module exposes the ability to draw face parts individually using a custom strokestyle

License: MIT License

JavaScript 100.00%

clmdraw's Introduction

#clmdraw

Example

 // pointsFromCLM are points that were detected by clm of a persons face
 // canvas is a HTMLCanvasElement
 // last property is a colour you'd like to draw with
 clmdraw.draw( pointsFromCLM, canvas, '#OOCAFE' );
 clmdraw.drawLeftEye( pointsFromCLM, canvas, '#FF00FF' );

Members

####clmdraw.draw( clmPositions, canvas, [strokeStyle, doClear ] ) Draw is equivalent to the draw built into clm (draw the entire face) with the exceptions of drawing in a forehead which can be calculated using the module clmutils and having the ability to define a stroke style. When drawing if the forehead points don't exist then they wont be drawn.

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawForehead( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the forehead points if they exist to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawJaw( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the jaw points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawLeftEye( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the left eye points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawLeftEyeBrow( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the left eyebrow points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawLips( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the lip points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawNose( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the nose points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawRightEye( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the right eye points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

####clmdraw.drawRightEyeBrow( clmPositions, canvas, [strokeStyle, doClear ] ) This method will draw just the right eyebrow points to the supplied canvas

Params

  • clmPositions Array - The points returned from clm for the detected face
  • canvas HTMLCanvasElement - The canvas which you want to draw the clm face feature on
  • [strokeStyle] String - How thick and what colour you'd like to draw your lines default is the strokestyle defined by the canvas
  • [doClear] Boolean - Should the canvas context be cleared before draw default is true

clmdraw's People

Contributors

mikkoh avatar

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.