Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #pragma once
- #include "Algoritm.h"
- #include <opencv2/opencv.hpp>
- #include <iostream>
- #define NUMBER_REAL_FIGURE 6
- using namespace std;
- using namespace cv;
- #define FRAME_SIZE_X (8) // вынести
- #define FRAME_SIZE_Y (6) // вынести
- typedef struct {
- unsigned int hMin, hMax, sMin, sMax, vMin, vMax;
- }cv_figure_t;
- const cv_figure_t AllRealFigures[NUMBER_REAL_FIGURE] = {
- { 15, 30, 100, 255, 0, 255 },
- { 190, 10, 100, 255, 0, 255 },
- { 98, 136, 30, 255, 42, 85 },
- { 45, 90, 45, 255, 0, 155 },
- { 160, 185, 90, 255, 0, 255 },
- { 95, 125, 100, 255, 60, 255 }
- };
- const cv_figure_t AllFiguresHoles[NUMBER_REAL_FIGURE] = {
- { 15, 30, 110, 255, 95, 140 },
- { 0, 20, 145, 255, 0, 255 },
- { 110, 123, 85, 145, 0, 255 },
- { 58, 81, 95, 255, 0, 255 },
- { 160, 188, 150, 255, 0, 255 },
- { 100, 120, 135, 255, 0, 255 }
- };
- const cv_figure_t AllFiguresInFrame[NUMBER_REAL_FIGURE] = {
- { 15, 36, 90, 255, 0, 255 },
- { 200, 15, 70, 190, 0, 255 },
- { 100, 123, 101, 255, 0, 255 },
- { 60, 85, 75, 255, 0, 255 },
- { 170, 191, 88, 200, 0, 255 },
- { 103, 112, 115, 255, 0, 255 }
- };
- const cv_figure_t AllFiguresInStack[NUMBER_REAL_FIGURE] = {
- { 18, 28, 160, 255, 0, 255 },
- { 190, 15, 110, 255, 0, 255 },
- { 95, 130, 60, 180, 0, 255 },
- { 55, 100, 55, 170, 0, 255 },
- { 170, 5, 81, 255, 0, 255 },
- { 100, 120, 60, 255, 0, 255 }
- };
- typedef int frame_t[FRAME_SIZE_X][FRAME_SIZE_Y]; // вынести
- const int SupportSideLengthFigure[NUMBER_REAL_FIGURE] = { 40, 55, 55, 40, 40, 55 };
- #define ROBOTOCV_RAMKA 1
- #define ROBOTOCV_STACK 0
- void CalibrationChessboard(Mat img);
- void TestPhoto(char *name);
- figure_t GetFigure(Mat img, Rect *rectFigure);
- // GetFigureFrom(Mat img, const cv_figure_t *AllMasc, int type) замененна на:
- figure_t GetFigureFromStack(Mat img);
- figure_t GetFigureFromFrame(Mat img); //нужно проверить
- //
- Point GetHole(Mat img_start, figure_t figure, Rect rectFigure);
- Point getCenter(Mat img, figure_t figure);
- int AngFigure(Mat img, figure_t figure, double *ang);
- int BuseFrame(Mat img, frame_t frame);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement