energy changed

This commit is contained in:
sun
2019-07-09 13:55:40 +08:00
parent cc508cfec5
commit 6d06b4bf5c
9 changed files with 232 additions and 39 deletions

View File

@@ -41,8 +41,10 @@ private:
int fans_cnt;//图像中的扇叶个数
int armors_cnt;//图像中的装甲板个数
int centerRs_cnt;//图像中可能的风车中心字母R选区个数
int flow_strips_cnt;//图像中的流动条个数
int last_fans_cnt;//上一帧的扇叶个数
int last_armors_cnt;//上一帧的装甲板个数
int last_flow_strips_cnt;//
int gimble_cnt; //经过的帧数
double radius;//大风车半径
float target_polar_angle;//待击打装甲板的极坐标角度
@@ -67,6 +69,7 @@ private:
std::vector<EnergyPart> fans;//图像中所有扇叶
std::vector<EnergyPart> armors;//图像中所有装甲板
std::vector<EnergyPart> centerRs;//风车中心字母R的可能候选区
std::vector<EnergyPart> flow_strips;//图像中所有流动条(理论上只有一个)
cv::Point circle_center_point;//风车圆心坐标
cv::Point target_point;//目标装甲板中心坐标
@@ -85,15 +88,18 @@ private:
int findFan(const cv::Mat src, int &last_fans_cnt);//寻找图中所有扇叶
int findArmor(const cv::Mat src, int &last_armors_cnt);//寻找图中所有装甲板
int findCenterR(const cv::Mat src);//寻找图中可能的风车中心字母R
int findFlowStrip(const cv::Mat src, int &last_flow_strips_cnt);//寻找图中所有流动条
bool isValidFanContour(const vector<cv::Point> fan_contour);//扇叶矩形尺寸要求
bool isValidArmorContour(const vector<cv::Point> armor_contour);//装甲板矩形尺寸要求
bool isValidCenterRContour(const vector<cv::Point> center_R_contour);//风车中心选区尺寸要求
bool isValidFlowStripContour(const vector<cv::Point> flow_strip_contour);//流动条矩形尺寸要求
void showFanContours(std::string windows_name, const cv::Mat src);//显示扇叶
void showArmorContours(std::string windows_name, const cv::Mat src);//显示装甲板
void showBothContours(std::string windows_name, const cv::Mat src);//显示扇叶和装甲板
void showCenterRContours(std::string windows_name, const cv::Mat src);//显示风车中心候选区R
void showFlowStripContours(std::string windows_name, const cv::Mat src);//显示流动条
void getFanPolarAngle();//获取扇叶极坐标角度
void getArmorPolarAngle();//获取装甲板极坐标角度
@@ -103,6 +109,7 @@ private:
void findTargetByPolar();//通过极坐标角度匹配获取目标装甲板的极坐标角度和装甲板中心坐标
void findTargetByIntersection();//通过面积重合度匹配获取目标装甲板的极坐标角度和装甲板中心坐标
bool findTargetInFlowStrip();//在已发现的流动条区域中寻找待击打装甲板
void rotate();//获取预测点位
void stretch(cv::Point point_1, cv::Point2f &point_2);//将像素差转换为实际距离差

View File

@@ -45,6 +45,7 @@ struct EnergyPartParam {
long FAN_CONTOUR_WIDTH_MAX;//扇叶宽边长度最大值
float FAN_CONTOUR_HW_RATIO_MAX;//扇叶长宽比最大值
float FAN_CONTOUR_HW_RATIO_MIN;//扇叶长宽比最小值
float FAN_CONTOUR_AREA_RATIO_MIN;//装甲板轮廓占旋转矩形面积比最小值
long ARMOR_CONTOUR_AREA_MAX;//装甲板面积最大值
long ARMOR_CONTOUR_AREA_MIN;//装甲板面积最小值
@@ -54,6 +55,7 @@ struct EnergyPartParam {
long ARMOR_CONTOUR_WIDTH_MAX;//装甲板宽边长度最大值
float ARMOR_CONTOUR_HW_RATIO_MAX;//装甲板长宽比最大值
float ARMOR_CONTOUR_HW_RATIO_MIN;//装甲板长宽比最小值
float ARMOR_CONTOUR_AREA_RATIO_MIN;//装甲板轮廓占旋转矩形面积比最小值
long CENTER_R_CONTOUR_AREA_MAX;//风车中心R面积最大值
long CENTER_R_CONTOUR_AREA_MIN;//风车中心R面积最小值
@@ -63,13 +65,24 @@ struct EnergyPartParam {
long CENTER_R_CONTOUR_WIDTH_MAX;//风车中心R宽边长度最大值
float CENTER_R_CONTOUR_HW_RATIO_MAX;//风车中心R长宽比最大值
float CENTER_R_CONTOUR_HW_RATIO_MIN;//风车中心R长宽比最小值
float CENTER_R_CONTOUR_AREA_RATIO_MIN;//装甲板轮廓占旋转矩形面积比最小值
long FLOW_LIGHT_CONTOUR_HW_RATIO_MIN;//流动条长宽比最小值_
long FLOW_STRIP_CONTOUR_AREA_MAX;//流动条(待击打)面积最大值
long FLOW_STRIP_CONTOUR_AREA_MIN;//流动条(待击打)面积最小值
long FLOW_STRIP_CONTOUR_LENGTH_MIN;//流动条(待击打)长边长度最小值
long FLOW_STRIP_CONTOUR_WIDTH_MIN;//流动条(待击打)长边长度最大值
long FLOW_STRIP_CONTOUR_LENGTH_MAX;//流动条(待击打)宽边长度最小值
long FLOW_STRIP_CONTOUR_WIDTH_MAX;//流动条(待击打)宽边长度最大值
float FLOW_STRIP_CONTOUR_HW_RATIO_MAX;//流动条(待击打)长宽比最大值
float FLOW_STRIP_CONTOUR_HW_RATIO_MIN;//流动条(待击打)长宽比最小值
float FLOW_STRIP_CONTOUR_AREA_RATIO_MAX;//装甲板轮廓占旋转矩形面积比最小值
float FLOW_STRIP_CONTOUR_AREA_RATIO_MIN;//装甲板轮廓占旋转矩形面积比最小值
float TWIN_ANGEL_MAX;//扇叶和装甲板匹配时极坐标角度差的最大值
long INTERSETION_CONTOUR_AREA_MIN;//扇叶与装甲板匹配时的最小重合面积
long TARGET_CHANGE_DISTANCE_MAX;//目标未更改时,目标装甲板中心与原目标装甲板中心的距离变化最大值
long TWIN_POINT_MAX;//两个点相同时距离最大值
};