25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
618B

  1. #include "cv.h"
  2. #include "highgui.h"
  3. int main(int argc, char **argv) {
  4. CvCapture* cap;
  5. cap=cvCaptureFromCAM(-1);
  6. IplImage* img=cvQueryFrame(cap);
  7. IplImage* img_result=cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1);
  8. IplImage* img_result2=cvCreateImage(cvGetSize(img),IPL_DEPTH_16S,1);
  9. cvCvtColor(img,img_result,CV_RGB2GRAY);
  10. cvSobel(img_result,img_result2,1,1,3);
  11. cvSaveImage("cap.png",img);
  12. cvSaveImage("result.png",img_result2);
  13. // cvAddWeighted(img_result,2./3.,b,1./3.,0,img_result);
  14. // cvSobel(img_result,img_result,1,1,3);
  15. cvReleaseCapture(&cap);
  16. }