No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

camera.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2018 dimercur
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __CAMERA_H__
  18. #define __CAMERA_H__
  19. #include <opencv2/highgui/highgui.hpp>
  20. #include <opencv2/imgproc/imgproc.hpp>
  21. #include "img.h"
  22. enum captureSize {xs, sm, md, lg};
  23. class Camera {
  24. public:
  25. Camera(int size);
  26. bool Open();
  27. void Close();
  28. int GetWidth() const;
  29. int GetHeight() const;
  30. bool IsOpen();
  31. void SetSize(int size);
  32. Img Grab();
  33. private:
  34. cv::VideoCapture cap;
  35. int size = sm;
  36. int width;
  37. int height;
  38. };
  39. #endif //__CAMERA_H__