The Io.FrameProcessor allows reading and processing of frames from a camera or video file. The FrameProcessor is useful writing code that supports either kind of source, and when you want to manually request frames.
By default nothing is shown. But you can show the canvas FrameProcessor is using to capture frames, or a raw preview.
If you have several cameras, you might need to specify which one. At times you may also want to restrict the frame size, since processing smaller images is faster than large.
fp.useCamera({
// Get camera facing user (other possible value is 'environment')
facingMode:`user`,
// Get a frame size as close to this as possible
ideal: {
width:1024,
height:768
}
})
Camera constraints can also be specified when creating the FrameProcessor instance: