This camera program called “funny camera” uses OpenCV to overlay images on detected faces. It is also fed by a toml file to make it easy to add your own images and put them where you want on peoples faces.

To add more, you have to upload the .png to the PiGlassv2 directory and add an entry in piglass.toml. When you take a picture and faces are detected, the funny image gets generated and then displayed to the wearer for 4 seconds.

The bumpers are zoom in/out
The dpad will cycle the overlay options with up/down
The dpad left/right will pan left/right when zoomed
Hold X button: take a picture
Hold B button: take funny picture
Hold A button: take random funny picture

Hold Y button: reset zoom

The format of the toml file is:
[Title]               is the name you want to display for this option
display_name is what you would call the item as a plural.
file                   is the name of the .png file you want to overlay
location           is a word representing the general location of the image on the face

Locations include: 
top, center, bottom, top-left, top-right, center-left, center-right, bottom-left, bottom-right

There is also a location called face which is scaled differently to replace a face versus fit on it.

display_name = "Slugs"
file = "mask2.png"
location = "top-right"
["brain blender"]
display_name = "Blenders"
file = "mask4.png"
location = "top"
["dum sticker"]
display_name = "Dum"
file = "maskdum.png"
location = "center-right"

This video shows the options and what happens when you select one when no faces are found.

This guide was first published on Apr 05, 2022. It was last updated on Mar 08, 2024.

This page (Funny Camera) was last updated on Mar 08, 2024.

Text editor powered by tinymce.