调阈值+查看确定中心所用帧数
This commit is contained in:
@@ -66,7 +66,7 @@ void Energy::initEnergy() {
|
|||||||
// 此函数对能量机关参数进行初始化
|
// 此函数对能量机关参数进行初始化
|
||||||
// ---------------------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------------------
|
||||||
void Energy::initEnergyPartParam() {
|
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_.SPLIT_GRAY_THRESH = 60;
|
||||||
energy_part_param_.FAN_GRAY_THRESH = 75;
|
energy_part_param_.FAN_GRAY_THRESH = 75;
|
||||||
energy_part_param_.ARMOR_GRAY_THRESH = 80;
|
energy_part_param_.ARMOR_GRAY_THRESH = 80;
|
||||||
|
|||||||
@@ -40,18 +40,19 @@ int Energy::runBig(cv::Mat &gimble_src, cv::Mat &chassis_src){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(++gimble_cnt==10){
|
if(++gimble_cnt%8==0){
|
||||||
former_point=circle_center_point;
|
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;
|
centered=true;
|
||||||
cout<<"gimble focused!"<<endl;
|
cout<<"gimble focused!"<<endl;
|
||||||
|
cout<<"number of framse: "<<gimble_cnt<<endl;
|
||||||
}
|
}
|
||||||
predict_point=circle_center_point;
|
predict_point=circle_center_point;
|
||||||
cout<<gimble_cnt<<endl;
|
// cout<<gimble_cnt<<endl;
|
||||||
cout<<"center:("<<predict_point.x<<','<<predict_point.y<<")\n";
|
// cout<<"center:("<<predict_point.x<<','<<predict_point.y<<")\n";
|
||||||
gimbleRotation();
|
gimbleRotation();
|
||||||
|
|
||||||
// cout<<"send"<<endl;
|
// cout<<"send"<<endl;
|
||||||
|
|||||||
6
main.cpp
6
main.cpp
@@ -26,7 +26,7 @@ using namespace std;
|
|||||||
mcu_data mcuData = {
|
mcu_data mcuData = {
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
SMALL_ENERGY_STATE,
|
BIG_ENERGY_STATE,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
ENEMY_RED,
|
ENEMY_RED,
|
||||||
@@ -56,8 +56,8 @@ int main(int argc, char *argv[]) {
|
|||||||
video_gimble = new CameraWrapper(0/*, "armor"*/);
|
video_gimble = new CameraWrapper(0/*, "armor"*/);
|
||||||
video_chassis = new CameraWrapper(1/*, "energy"*/);
|
video_chassis = new CameraWrapper(1/*, "energy"*/);
|
||||||
} else {
|
} else {
|
||||||
video_gimble = new VideoWrapper("/home/sun/项目/energy_video/energy_test.avi");
|
video_gimble = new VideoWrapper("/Users/leo/Desktop/videos/179.avi");
|
||||||
video_chassis = new VideoWrapper("/home/sun/项目/energy_video/energy_test.avi");
|
video_chassis = new VideoWrapper("/Users/leo/Desktop/videos/179.avi");
|
||||||
}
|
}
|
||||||
if (video_gimble->init()) {
|
if (video_gimble->init()) {
|
||||||
LOGM("video_gimble source initialization successfully.");
|
LOGM("video_gimble source initialization successfully.");
|
||||||
|
|||||||
Reference in New Issue
Block a user