Skip to content

Commit

Permalink
avoid casting int to float when dealing with rgb field
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@4979 a9d63959-f2ad-4865-b262-bf0e56cfafb6
  • Loading branch information
bouffa committed Mar 8, 2012
1 parent 0ef1046 commit edf89f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tracking/include/pcl/tracking/impl/hsv_color_coherence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace pcl
unsigned char Red; // Red channel
};
float float_value;
long long_value;
int int_value;
} RGBValue;

/** \brief Convert a RGB tuple to an HSV one.
Expand Down Expand Up @@ -149,8 +149,8 @@ namespace pcl
{
// convert color space from RGB to HSV
RGBValue source_rgb, target_rgb;
source_rgb.float_value = static_cast<float> (source.rgba);
target_rgb.float_value = static_cast<float> (target.rgba);
source_rgb.int_value = source.rgba;
target_rgb.int_value = target.rgba;

float source_h, source_s, source_v, target_h, target_s, target_v;
RGB2HSV (source_rgb.Red, source_rgb.Blue, source_rgb.Green,
Expand Down

0 comments on commit edf89f7

Please sign in to comment.