| 1 | //use the camera to aid the decision to sleep. |
| 2 | //Copyright 2009 Daniel Watson |
| 3 | /* |
| 4 | use a camera to prevent screensaver |
| 5 | Copyright (C) 2009 daniel watson, ozzloy@gmail.com |
| 6 | |
| 7 | This program is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 3 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | /* |
| 21 | This file is part of oble. |
| 22 | |
| 23 | oble is free software: you can redistribute it and/or modify |
| 24 | it under the terms of the GNU General Public License as published by |
| 25 | the Free Software Foundation, either version 3 of the License, or |
| 26 | (at your option) any later version. |
| 27 | |
| 28 | oble is distributed in the hope that it will be useful, |
| 29 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 30 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 31 | GNU General Public License for more details. |
| 32 | |
| 33 | You should have received a copy of the GNU General Public License |
| 34 | along with oble. If not, see <http://www.gnu.org/licenses/>. |
| 35 | |
| 36 | */ |
| 37 | |
| 38 | static time_t t_current = time(NULL); |
| 39 | |
| 40 | // argument for cvFlip(src, dest, FLIP_TYPE) |
| 41 | #define MIRROR 1 |
| 42 | |
| 43 | CvHaarClassifierCascade* load_object_detector(const char* cascade_path); |
| 44 | |
| 45 | void detect_and_draw_objects(IplImage* image, |
| 46 | CvHaarClassifierCascade* cascade, |
| 47 | int do_pyramids); |
| 48 | |
| 49 | void screensave(time_t t_current); |
| 50 | |
| 51 | int parse_opts(int argc, char **argv); |
| 52 | |
| 53 | int do_capture(); |
| 54 | |
| 55 | int get_one_frame(CvCapture* capture, IplImage* &frame); |
| 56 | |
| 57 | void get_frames(CvCapture* capture, CvHaarClassifierCascade* cascade); |
| 58 | |
| 59 | void update_idle(int faces_total); |