This section is intended to guide you through the
necessary steps to use PUC to run your own code on the IQeye3. To be able to
do this tutorial you will first need to download a software for file
transfer such as SW_FTP by
Ipswitch,
and a C compiler such as Borland.
Sample motion detection.
Download the code here
int main ( )
{
img_get_raw_opts(&opts);
/* Gets the raw option. */
img_take();
/* Takes a raw picture. */
p2=im_colorcorrect_keep(p,&opts); /*
Resamples the picture to a smaller image size */
n = img_compare(p2,p1,THRESHOLD,0);
/* Compares new image with the last sampled image taken */
if(p1 != NULL && p2 != NULL)
{
n=img_compare(p2,p1,THRESHOLD,0); /*
compares with treshhold */
printf("%d",n);
/* prints out the number of differences */
if(n > MOTION_SIZE)
/* motion is determined */
{
opts.downsamp=1;
/* generate a full picture */
p=im_colorcorrect_keep(p,&opts);
/* color correct */
if(p != null)
/* if there is no motion, save a jpeg image to "test" file */
{
p=img_jpeg_to_file(p,QUAL_DEFAULT,test);
/* image p is saved into test */
}
}
printf ("Press any key to finish"/n/r);
}
To run the program log into the camera as an
administrator via telnet and enter the PUC by entering cc at the command
prompt. You will see the following screen. You will then type
#include <motion_detect.c> to run the program. At the end you
will have to press any key to exit.

Back