Merge energe.
This commit is contained in:
@@ -29,8 +29,8 @@ void ArmorFinder::run(cv::Mat &src) {
|
|||||||
showArmorBox("box", src, armor_box, boxid);
|
showArmorBox("box", src, armor_box, boxid);
|
||||||
cv::waitKey(1);
|
cv::waitKey(1);
|
||||||
}
|
}
|
||||||
stateSearchingTarget(src_use);
|
// stateSearchingTarget(src_use);
|
||||||
return;
|
// return;
|
||||||
switch (state){
|
switch (state){
|
||||||
case SEARCHING_STATE:
|
case SEARCHING_STATE:
|
||||||
if(stateSearchingTarget(src_use)){
|
if(stateSearchingTarget(src_use)){
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ static bool findLightBlobs(const cv::Mat &src, LightBlobs &light_blobs) {
|
|||||||
}else if(src.type() == CV_8UC1){
|
}else if(src.type() == CV_8UC1){
|
||||||
src_gray = src.clone();
|
src_gray = src.clone();
|
||||||
}
|
}
|
||||||
LightBlobs all;
|
|
||||||
std::vector<std::vector<cv::Point> > light_contours;
|
std::vector<std::vector<cv::Point> > light_contours;
|
||||||
cv::findContours(src_gray, light_contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);
|
cv::findContours(src_gray, light_contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);
|
||||||
|
|
||||||
@@ -138,9 +137,7 @@ static bool findLightBlobs(const cv::Mat &src, LightBlobs &light_blobs) {
|
|||||||
if(isValidLightBlob(src_gray, rect)){
|
if(isValidLightBlob(src_gray, rect)){
|
||||||
light_blobs.emplace_back(rect);
|
light_blobs.emplace_back(rect);
|
||||||
}
|
}
|
||||||
all.emplace_back(rect);
|
|
||||||
}
|
}
|
||||||
showContours("all", src, all);
|
|
||||||
return light_blobs.size() >= 2;
|
return light_blobs.size() >= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user