Ask Your Question
0

this code giving me error of c1083 cannot open source file cv.h ...iam using open cv 2.4.8

asked 2016-08-18 08:13:44 -0600

#include<iostream>

include "opencv2\highgui\highgui.hpp"

include "opencv\cv.hpp"

include "opencv\cv.h"

using namespace std; using namespace cv; CvCapture* g_capture=NULL; int g_postion=0; void ontrackbar(int pos) { cvSetCaptureProperty(g_capture,CV_CAP_PROP_POS_FRAMES,pos);

}

int main() { char str[100]; cin>>str; namedWindow("goku",CV_WINDOW_FREERATIO); g_capture=cvCreateFileCapture(str); int frames=(int)cvGetCaptureProperty(g_capture,CV_CAP_PROP_FRAME_COUNT); if(frames) { cvCreateTrackbar("position",str,&g_postion,frames,ontrackbar);

  }
  IplImage* frame;
  while(1)
  {
      frame=cvQueryFrame(g_capture);
      if(!frame)break;
      cvShowImage("goku",frame);
      char c=waitKey(17);
      if(c==27)break;
  }
  cvReleaseImage(&frame);
  destroyWindow("goku");

}

edit retag flag offensive close merge delete

Comments

yea, that'S from outdated opencv1. DO NOT USE THIS CODE (or any, that has IplImage in it)

berak gravatar imageberak ( 2016-08-18 08:24:16 -0600 )edit

please tell us - what are you trying to achieve ? then we can point you to a more modern sample.

berak gravatar imageberak ( 2016-08-18 09:35:15 -0600 )edit

Tried this still same error:

enter code here

import cv2 import sys import os

cascPath = sys.argv[1]

cascPath = 'face.xml' faceCascade = cv2.CascadeClassifier(cascPath) print faceCascade video_capture = cv2.VideoCapture('http://user:[email protected]/videostream.cgi')

while True: # Capture frame-by-frame ret, frame = video_capture.read()

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
#This
faces = faceCascade.detectMultiScale(
    frame,
    scaleFactor=1.1,
    minNeighbors=5,
    minSize=(30, 30),
    flags=cv2.cv.CV_HAAR_SCALE_IMAGE
        )
cv2.cv
# Draw a rectangle around the faces
for (x, y, w, h) in faces:
    cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)

# Display the resulting frame
cv2.imshow('Video', frame)
chrisbr gravatar imagechrisbr ( 2016-08-18 11:35:29 -0600 )edit

please, ignore that post, it's not a solution to your problem. another noob got it wrong entirely.

(python, not c++)

berak gravatar imageberak ( 2016-08-18 11:40:01 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-08-18 21:33:02 -0600

chrisbr gravatar image

Got it figured out. Thanks for the help.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-18 08:13:44 -0600

Seen: 421 times

Last updated: Aug 18 '16