|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#37
|
||||
|
||||
|
Re: Tower Tracker 1.0
Sorry for double post but just making sure you see this...
I would also check for solidity of the target. This makes sure you don't get stray objects even if it passes all other checks. Here is c++ code, very similar to java. Code:
float area = contourArea(contours[i]);
float hull_area = contourArea(hull);
float solidity = (float)area / hull_area;
if (aspect > 1 && rect.area() > 100 && (solidity >= .04 && solidity <= .4)) {
selected.push_back(contours[i]);
}
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|