调阈值+查看确定中心所用帧数

This commit is contained in:
wanpiqiu123
2019-07-06 17:04:39 +08:00
parent 1929c39d70
commit cec8fe4dad
3 changed files with 10 additions and 9 deletions

View File

@@ -66,7 +66,7 @@ void Energy::initEnergy() {
// 此函数对能量机关参数进行初始化
// ---------------------------------------------------------------------------------------------------------------------
void Energy::initEnergyPartParam() {
energy_part_param_.GRAY_THRESH = 240;
energy_part_param_.GRAY_THRESH = 235;
energy_part_param_.SPLIT_GRAY_THRESH = 60;
energy_part_param_.FAN_GRAY_THRESH = 75;
energy_part_param_.ARMOR_GRAY_THRESH = 80;

View File

@@ -40,18 +40,19 @@ int Energy::runBig(cv::Mat &gimble_src, cv::Mat &chassis_src){
return 0;
}
if(++gimble_cnt==10){
if(++gimble_cnt%8==0){
former_point=circle_center_point;
gimble_cnt=0;
//gimble_cnt=0;
}
if(former_point==predict_point&&gimble_cnt==9&&predict_point!=Point(0,0)) {
if(former_point==predict_point&&gimble_cnt%8==7&&predict_point!=Point(0,0)) {
centered=true;
cout<<"gimble focused!"<<endl;
cout<<"number of framse: "<<gimble_cnt<<endl;
}
predict_point=circle_center_point;
cout<<gimble_cnt<<endl;
cout<<"center:("<<predict_point.x<<','<<predict_point.y<<")\n";
// cout<<gimble_cnt<<endl;
// cout<<"center:("<<predict_point.x<<','<<predict_point.y<<")\n";
gimbleRotation();
// cout<<"send"<<endl;

View File

@@ -26,7 +26,7 @@ using namespace std;
mcu_data mcuData = {
0,
0,
SMALL_ENERGY_STATE,
BIG_ENERGY_STATE,
0,
1,
ENEMY_RED,
@@ -56,8 +56,8 @@ int main(int argc, char *argv[]) {
video_gimble = new CameraWrapper(0/*, "armor"*/);
video_chassis = new CameraWrapper(1/*, "energy"*/);
} else {
video_gimble = new VideoWrapper("/home/sun/项目/energy_video/energy_test.avi");
video_chassis = new VideoWrapper("/home/sun/项目/energy_video/energy_test.avi");
video_gimble = new VideoWrapper("/Users/leo/Desktop/videos/179.avi");
video_chassis = new VideoWrapper("/Users/leo/Desktop/videos/179.avi");
}
if (video_gimble->init()) {
LOGM("video_gimble source initialization successfully.");