How to use #include cvcam.h in opencv 3.0?
I am trying to run a program that includes the header cvcam.h
. It was made with opencv 2.4 but now i am trying to run it with opencv 3.0. For the header #include "highgui.h"
, i changed it to #include "opencv2/highgui/highgui.hpp"
. I am not quite sure on how to do it for cvcam.h
. I hope someone can help. Thanks! =)
#ifdef _CH_
#pragma package <opencv>
#endif
#ifndef _EiC
#include "cv.h"
#include "cvcam.h"
#include "highgui.h"
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#endif
IplImage *image = 0, *hsv = 0, *hue = 0, *mask = 0, *backproject = 0, *histimg = 0, *plot = 0, *display = 0, *clone = 0;
CvHistogram *hist = 0;
int backproject_mode = 0;
int select_object = 0;
int track_object = 0;
int show_hist = 1;
const int eye_origin = 160;
// Width of boxex across eye
int col5_left = 0;
int col5_right = 0;
int col4_left = 0; //310;
int col4_right = 0; //325;
int col3_left = 0; //330;
int col3_right = 0; //345;
int col2_left = 0; //355;
int col2_right = 0; //370;
int col1_left = 0; //375;
int col1_right = 0; //390;
// Height of boxes across eye
int row1_upper = 0; //262; //317
int row1_lower = 0; //254; //279
int row2_upper = 0; //254; //269
int row2_lower = 0; //246; //231
int row3_upper = 0; //246; //221
int row3_lower = 0; //238; //183
int row4_upper = 0;
int row4_lower = 0;
//Display numbers
int display_col1 = 10;
int display_col2 = 110;
int display_col3 = 210;
int display_col4 = 310;
int display_col5 = 410;
int display_row1 = 120;
int display_row2 = 240;
int display_row3 = 360;
int display_row4 = 480;
//Display boxes
int box_width = 80;
int box_height = 110;
int box_gapX = 20;
int box_gapY = 10;
//Camera-to-screen ratio
float ratio = 0.118; //camera to eye dist = 6cm, screen to eye dist = 51cm, ratio = 6/51
float scale_width = 0, scale_height = 0, scale_gapX = 0, scale_gapY = 0;
int refresh = 0;
int calibrate = 1;
int EyeCenter_pre = 0;
float scalingX = 1.32; //1.32 for 19", 1 for 15"
float scalingY = 1.13;// 1.13 for 19"
// Data writing
float f;
FILE * pFile;
clock_t delay, time1, time2, time3, time4, timediff_from3, timediff_from2, timediff_from1, track_time;
clock_t time5, time6, time7, time8, time9, time10, time11, time12, time13, START;
clock_t last_time1,last_time2,last_time3,last_time4,last_time5,last_time6,last_time7,last_time8,last_time9,last_time10,last_time11,last_time12,last_time13;
int blank1=1,blank2=1,blank3=1,blank4=1,blank5=1,blank6=1,blank7=1,blank8=1,blank9=1,blank10=1,blank11=1,blank12=1,blank13=1;
float frequency1=2,frequency2=4,frequency3=2,frequency4=8,frequency5=3,frequency6=2,frequency7=9,frequency8=2,frequency9=11,frequency10=4,frequency11=7,frequency12=3,frequency13=1;
time_t rawtime;
clock_t run_start,run_stop;
int running_time=0;
struct tm * timeinfo;
int new_num = 0, pre_num = 0;
const int eye_threshold = 2;
// get capture parameters.
int width, height, fps;
// create video writer for the output.
CvVideoWriter* writer = NULL;
int isColor = 1;
int fps = 5; // or 30
int frameW = 640; // 744 for firewire cameras
int frameH = 480; // 480 for firewire cameras
CvPoint plot_pos;
CvPoint origin;
CvRect selection;
CvRect track_window;
CvBox2D track_box;
CvConnectedComp track_comp;
CvFont font, font1;
CvPoint NewEyeCenter;
CvPoint EllipseCenter;
CvPoint Center;
CvPoint EyeCenter;
int hdims = 16;
float ...
it's gone. and though that code was probably still running with opencv2.4, it must be using code from opencv1.0, which is a long time ago. (and probably a bad idea tying to use it today)
can you post the code ? maybe someone can help you to adapt / re-write it.
Hello! Wil it be okay to post the code? As i am not so familiar with how things work in this forum.
edit your question, and append
Alright! thanks! Will do just that
you could get it to compile, if you change the headers to:
(you don't need cvcam at all)
thanks berak! i shall try that!