Advertisement
DanilaG

Untitled

Aug 18th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.06 KB | None | 0 0
  1. #pragma once
  2. #pragma once
  3. #include "Algoritm.h"
  4. #include <opencv2/opencv.hpp>
  5. #include <iostream>
  6. #define NUMBER_REAL_FIGURE 6
  7. using namespace std;
  8. using namespace cv;
  9.  
  10. #define FRAME_SIZE_X (8) // вынести
  11. #define FRAME_SIZE_Y (6) // вынести
  12.  
  13. typedef struct {
  14.     unsigned int hMin, hMax, sMin, sMax, vMin, vMax;
  15. }cv_figure_t;
  16.  
  17. const cv_figure_t AllRealFigures[NUMBER_REAL_FIGURE] = {
  18.     { 18, 28, 92, 255, 0, 255 },
  19.     { 0, 15, 100, 255, 0, 255 },
  20.     { 75, 127, 35, 255, 37, 255 },
  21.     { 50, 65, 100, 255, 0, 255 },
  22.     { 160, 188, 135, 255, 0, 155 },
  23.     { 85, 115, 85, 255, 0, 255 }
  24. };
  25.  
  26. const cv_figure_t AllFiguresHoles[NUMBER_REAL_FIGURE] = {
  27.     { 15, 30, 110, 255, 95, 140 },
  28.     { 0, 20, 145, 255, 0, 255 },
  29.     { 110, 123, 85, 145, 0, 255 },
  30.     { 58, 81, 95, 255, 0, 255 },
  31.     { 160, 188, 150, 255, 0, 255 },
  32.     { 100, 120, 135, 255, 0, 255 }
  33. };
  34.  
  35. const cv_figure_t AllFiguresInFrame[NUMBER_REAL_FIGURE] = {
  36.     { 15, 30, 90, 255, 0, 255 },
  37.     { 0, 20, 100, 255, 0, 255 },
  38.     { 100, 255, 50, 255, 0, 255 },
  39.     { 44, 70, 110, 255, 0, 255 },
  40.     { 170, 5, 90, 255, 0, 255 },
  41.     { 100, 120, 60, 255, 0, 255 }
  42. };
  43.  
  44. const cv_figure_t AllFiguresInStack[NUMBER_REAL_FIGURE] = {
  45.     { 18, 28, 92, 255, 0, 255 },
  46.     { 5, 15, 100, 255, 0, 255 },
  47.     { 75, 127, 35, 85, 37, 255 },
  48.     { 50, 65, 100, 255, 0, 255 },
  49.     { 170, 5, 135, 255, 0, 255 },
  50.     { 85, 115, 85, 255, 70, 120 }
  51. };
  52.  
  53. typedef int frame_t[FRAME_SIZE_X][FRAME_SIZE_Y]; // вынести
  54. const int SupportSideLengthFigure[NUMBER_REAL_FIGURE] = { 40, 55, 55, 40, 40, 55 };
  55.  
  56. #define ROBOTOCV_RAMKA 1
  57. #define ROBOTOCV_STACK 0
  58. void CalibrationChessboard(Mat img);
  59. void TestPhoto(char *name);
  60. figure_t GetFigure(Mat img, Rect *rectFigure);
  61. // GetFigureFrom(Mat img, const cv_figure_t *AllMasc, int type) замененна на:
  62. figure_t GetFigureFromStack(Mat img);
  63. figure_t GetFigureFromFrame(Mat img); //нужно проверить
  64. //
  65. Point GetHole(Mat img_start, figure_t figure, Rect rectFigure);
  66. Point getCenter(Mat img, figure_t figure);
  67. int AngFigure(Mat img, figure_t figure, double *ang);
  68. int BuseFrame(Mat img, frame_t frame);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement