Fixed warnings
This commit is contained in:
parent
e6b2467f44
commit
832b0a69e8
@ -291,14 +291,14 @@ void MeasuringImpl::extract_features()
|
|||||||
// point happened to be inside the segment. The discrimination of too small segments
|
// point happened to be inside the segment. The discrimination of too small segments
|
||||||
// will follow, so we need a complete picture before that.
|
// will follow, so we need a complete picture before that.
|
||||||
if (circles_idxs.size() > 1
|
if (circles_idxs.size() > 1
|
||||||
&& circles_idxs.back().second == angles.size()-1
|
&& circles_idxs.back().second == (int)angles.size()-1
|
||||||
&& circles_idxs.front().first == 0) {
|
&& circles_idxs.front().first == 0) {
|
||||||
// Possibly the same circle. Check that the angle and length criterion holds along the combined segment.
|
// Possibly the same circle. Check that the angle and length criterion holds along the combined segment.
|
||||||
bool same = true;
|
bool same = true;
|
||||||
double last_len = -1.;
|
double last_len = -1.;
|
||||||
double last_angle = 0.;
|
double last_angle = 0.;
|
||||||
for (int i=circles_idxs.back().first + 1; i != circles_idxs.front().second; ++i) {
|
for (int i=circles_idxs.back().first + 1; i != circles_idxs.front().second; ++i) {
|
||||||
if (i == angles.size())
|
if (i == (int)angles.size())
|
||||||
i = 1;
|
i = 1;
|
||||||
if (last_len == -1.) {
|
if (last_len == -1.) {
|
||||||
last_len = lengths[i];
|
last_len = lengths[i];
|
||||||
@ -347,12 +347,12 @@ void MeasuringImpl::extract_features()
|
|||||||
for (int i=int(circles_idxs.size())-1; i>=0; --i) {
|
for (int i=int(circles_idxs.size())-1; i>=0; --i) {
|
||||||
const auto& [start, end] = circles_idxs[i];
|
const auto& [start, end] = circles_idxs[i];
|
||||||
int N = start >= 0
|
int N = start >= 0
|
||||||
? end - start + (start == 0 && end == border.size()-1 ? 0 : 1) // last point is the same as first
|
? end - start + (start == 0 && end == (int)border.size()-1 ? 0 : 1) // last point is the same as first
|
||||||
: end + (border.size() + start);
|
: end + (border.size() + start);
|
||||||
if (N < 5) {
|
if (N < 5) {
|
||||||
circles.erase(circles.begin() + i);
|
circles.erase(circles.begin() + i);
|
||||||
circles_idxs.erase(circles_idxs.begin() + i);
|
circles_idxs.erase(circles_idxs.begin() + i);
|
||||||
} else if (N <= 8 && start == 0 && end == border.size()-1) {
|
} else if (N <= 8 && start == 0 && end == (int)border.size()-1) {
|
||||||
// This is a regular 5-8 polygon. Add the edges as edges with a special
|
// This is a regular 5-8 polygon. Add the edges as edges with a special
|
||||||
// point and remove the circle. Leave the indices in circles_idxs, so
|
// point and remove the circle. Leave the indices in circles_idxs, so
|
||||||
// the edges are not picked up again later.
|
// the edges are not picked up again later.
|
||||||
|
Loading…
Reference in New Issue
Block a user