Skip to content

Commit

Permalink
Removed some compilation warnings from people module.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmunaro committed Jul 4, 2013
1 parent e570d3c commit c2d5383
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
3 changes: 3 additions & 0 deletions people/include/pcl/people/hog.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#ifndef PCL_PEOPLE_HOG_H_
#define PCL_PEOPLE_HOG_H_

#include <math.h>
#include <string.h>

#if defined(__SSE2__)
#include <pcl/common/impl/sse.hpp>
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::compute (std::vector<pcl::pe
top /= top(2);
Eigen::Vector3f bottom = intrinsics_matrix_ * (it->getTBottom());
bottom /= bottom(2);
it->setPersonConfidence(person_classifier_.evaluate(rgb_image_, bottom, top, centroid, intrinsics_matrix_, vertical_));
it->setPersonConfidence(person_classifier_.evaluate(rgb_image_, bottom, top, centroid, vertical_));
}

return (true);
Expand Down
5 changes: 2 additions & 3 deletions people/include/pcl/people/impl/person_classifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ pcl::people::PersonClassifier<PointT>::copyMakeBorder (PointCloudPtr& input_imag
int y_end_in = std::min(int(input_image->height-1), ymin+height-1);

int x_start_out = std::max(0, -xmin);
int x_end_out = x_start_out + (x_end_in - x_start_in);
//int x_end_out = x_start_out + (x_end_in - x_start_in);
int y_start_out = std::max(0, -ymin);
int y_end_out = y_start_out + (y_end_in - y_start_in);
//int y_end_out = y_start_out + (y_end_in - y_start_in);

for (unsigned int i = 0; i < (y_end_in - y_start_in + 1); i++)
{
Expand Down Expand Up @@ -283,7 +283,6 @@ pcl::people::PersonClassifier<PointT>::evaluate (PointCloudPtr& image,
Eigen::Vector3f& bottom,
Eigen::Vector3f& top,
Eigen::Vector3f& centroid,
Eigen::Matrix3f intrinsics_matrix,
bool vertical)
{
float pixel_height;
Expand Down
3 changes: 1 addition & 2 deletions people/include/pcl/people/person_classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,12 @@ namespace pcl
* \param[in] bottom Theoretical bottom point of the cluster projected to the image.
* \param[in] top Theoretical top point of the cluster projected to the image.
* \param[in] centroid Theoretical centroid point of the cluster projected to the image.
* \param[in] intrinsics_matrix Image intrinsic parameters.
* \param[in] vertical If true, the sensor is considered to be vertically placed (portrait mode).
* \return The person confidence.
*/
double
evaluate (PointCloudPtr& image, Eigen::Vector3f& bottom, Eigen::Vector3f& top, Eigen::Vector3f& centroid,
Eigen::Matrix3f intrinsics_matrix, bool vertical);
bool vertical);
};
} /* namespace people */
} /* namespace pcl */
Expand Down
10 changes: 5 additions & 5 deletions people/src/hog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
*/

#include <pcl/people/hog.h>
#include <math.h>
#include <string.h>

/** \brief Constructor. */
pcl::people::HOG::HOG ()
Expand Down Expand Up @@ -169,6 +167,8 @@ pcl::people::HOG::gradHist( float *M, float *O, int h, int w, int bin_size, int
O1=(int*)alMalloc(h*sizeof(int),16); M1=(float*) alMalloc(h*sizeof(float),16);

// main loop
float xb = 0;
float init = 0;
for( x=0; x<w0; x++ ) {
// compute target orientation bins for entire column - very fast
gradQuantize( O+x*h, M+x*h, O0, O1, M0, M1, n_orients, nb, h0, sInv2 );
Expand All @@ -187,7 +187,7 @@ pcl::people::HOG::gradHist( float *M, float *O, int h, int w, int bin_size, int
} else {
// interpolate using trilinear interpolation
#if defined(__SSE2__)
float ms[4], xyd, xb, yb, xd, yd, init; __m128 _m, _m0, _m1;
float ms[4], xyd, yb, xd, yd; __m128 _m, _m0, _m1;
bool hasLf, hasRt; int xb0, yb0;
if( x==0 ) { init=(0+.5f)*sInv-0.5f; xb=init; }
hasLf = xb>=0; xb0 = hasLf?(int)xb:-1; hasRt = xb0 < wb-1;
Expand Down Expand Up @@ -220,7 +220,7 @@ pcl::people::HOG::gradHist( float *M, float *O, int h, int w, int bin_size, int
#undef GHinit
#undef GH
#else
float ms[4], xyd, xb, yb, xd, yd, init;
float ms[4], xyd, yb, xd, yd;
bool hasLf, hasRt; int xb0, yb0;
if( x==0 ) { init=(0+.5f)*sInv-0.5f; xb=init; }
hasLf = xb>=0; xb0 = hasLf?(int)xb:-1; hasRt = xb0 < wb-1;
Expand Down Expand Up @@ -442,7 +442,7 @@ pcl::people::HOG::gradQuantize (float *O, float *M, int *O0, int *O1, float *M0,
}

// compute trailing locations without sse
for( i; i<n; i++ ) {
for( ; i<n; i++ ) {
o=O[i]*oMult; m=M[i]*norm; o0=(int) o; od=o-o0;
o0*=nb; o1=o0+nb; if(o1==oMax) o1=0;
O0[i]=o0; O1[i]=o1; M1[i]=od*m; M0[i]=m-M1[i];
Expand Down

0 comments on commit c2d5383

Please sign in to comment.