mirror of https://github.com/CGAL/cgal
Fix conversion warnings
This commit is contained in:
parent
a1df51aafb
commit
566e84f154
|
|
@ -158,14 +158,14 @@ public:
|
||||||
|
|
||||||
std::size_t nb_samples = 0;
|
std::size_t nb_samples = 0;
|
||||||
for (std::size_t i = 0; i < ground_truth.size(); ++ i)
|
for (std::size_t i = 0; i < ground_truth.size(); ++ i)
|
||||||
if (ground_truth[i] != -1)
|
if (int(ground_truth[i]) != -1)
|
||||||
++ nb_samples;
|
++ nb_samples;
|
||||||
|
|
||||||
cv::Mat training_features (int(nb_samples), int(m_features.size()), CV_32FC1);
|
cv::Mat training_features (int(nb_samples), int(m_features.size()), CV_32FC1);
|
||||||
cv::Mat training_labels (int(nb_samples), 1, CV_32FC1);
|
cv::Mat training_labels (int(nb_samples), 1, CV_32FC1);
|
||||||
|
|
||||||
for (std::size_t i = 0, index = 0; i < ground_truth.size(); ++ i)
|
for (std::size_t i = 0, index = 0; i < ground_truth.size(); ++ i)
|
||||||
if (ground_truth[i] != -1)
|
if (int(ground_truth[i]) != -1)
|
||||||
{
|
{
|
||||||
for (std::size_t f = 0; f < m_features.size(); ++ f)
|
for (std::size_t f = 0; f < m_features.size(); ++ f)
|
||||||
training_features.at<float>(int(index), int(f)) = m_features[f]->value(i);
|
training_features.at<float>(int(index), int(f)) = m_features[f]->value(i);
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ public:
|
||||||
std::vector<std::vector<std::size_t> > training_sets (m_labels.size());
|
std::vector<std::vector<std::size_t> > training_sets (m_labels.size());
|
||||||
std::size_t nb_tot = 0;
|
std::size_t nb_tot = 0;
|
||||||
for (std::size_t i = 0; i < ground_truth.size(); ++ i)
|
for (std::size_t i = 0; i < ground_truth.size(); ++ i)
|
||||||
if (ground_truth[i] != -1)
|
if (int(ground_truth[i]) != -1)
|
||||||
{
|
{
|
||||||
training_sets[std::size_t(ground_truth[i])].push_back (i);
|
training_sets[std::size_t(ground_truth[i])].push_back (i);
|
||||||
++ nb_tot;
|
++ nb_tot;
|
||||||
|
|
|
||||||
|
|
@ -202,9 +202,9 @@ void Surface_mesh_item_classification::train
|
||||||
BOOST_FOREACH(face_descriptor fd, faces(*(m_mesh->polyhedron())))
|
BOOST_FOREACH(face_descriptor fd, faces(*(m_mesh->polyhedron())))
|
||||||
{
|
{
|
||||||
training[fd] = m_training[fd];
|
training[fd] = m_training[fd];
|
||||||
if (training[fd] != -1)
|
if (training[fd] != std::size_t(-1))
|
||||||
{
|
{
|
||||||
nb_label[std::size_t(training[fd])] ++;
|
nb_label[training[fd]] ++;
|
||||||
++ nb_total;
|
++ nb_total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue