本文整理汇总了C++中image_geometry::PinholeCameraModel::getDeltaX方法的典型用法代码示例。如果您正苦于以下问题:C++ PinholeCameraModel::getDeltaX方法的具体用法?C++ PinholeCameraModel::getDeltaX怎么用?C++ PinholeCameraModel::getDeltaX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image_geometry::PinholeCameraModel
的用法示例。
在下文中一共展示了PinholeCameraModel::getDeltaX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glutDisplay
//.........这里部分代码省略.........
if( now_time > save_timer_ ){
ROS_WARN_STREAM("[bk_skeletal_tracker] Say Cheezbuger");
save_timer_ = now_time + ros::Duration(60*60*24);
g_bSaveFrame = true;
}
if( g_bSaveFrame )
{
time_t t = ros::WallTime::now().sec;
char buf[1024] = "";
struct tm* tms = localtime(&t);
strftime(buf, 1024, "%Y-%m-%d-%H-%M-%S", tms);
std::string prefix = ( boost::format("capture_%s_user%d") % buf % this_user.uid ).str();
cv::Mat rgb_masked;
rgb.copyTo(rgb_masked, this_mask);
saveMat(rgb_masked , prefix + "_rgb" );
saveMat(this_mask , prefix + "_mask" );
saveMat(this_user.pc.getHist() , prefix + "_hist" );
saveMat(this_user.pc.getImage(), prefix + "_himg" );
}
// Mean depth
this_user.meandepth = cv::mean(depth_image, this_mask)[0];
this_user.silhouette_area = 0;
// Find the area of the silhouette in cartesian space
for( int i=0; i<this_mask.rows; i++) {
for( int j=0; j<this_mask.cols; j++ ) {
if( this_mask.at<uchar>(i,j) != 0 )
{
pixel_area = cam_model_.getDeltaX(1, depth_image.at<float>(i,j))
* cam_model_.getDeltaY(1, depth_image.at<float>(i,j));
this_user.silhouette_area += pixel_area;
}
}
}
// Find the center in 3D
g_UserGenerator.GetCoM(this_user.uid, center_mass);
this_user.center3d.point = vecToPt(center_mass);
ROS_DEBUG_STREAM(boost::format("User %d: area %.3fm^2, mean depth %.3fm")
% (unsigned int)this_user.uid % this_user.silhouette_area % this_user.meandepth);
// Screen out unlikely users based on area
if( this_user.meandepth > min_dist_ && this_user.silhouette_area < max_area_ && this_user.silhouette_area > min_area_ )
{
ROS_INFO_STREAM(boost::format("User %d new: %.0f --- orig: %.0f")
% ((int)this_user.uid) % (100*similarity) % (100*sim_to_orig) );
/*ROS_INFO_STREAM(boost::format("EMD new: %.2f --- orig: %.2f")
% (emd) % (emd_to_orig) );*/
if( similarity > PersonCal::getMatchThresh() ) {
user_cal_.update(rgb, this_mask);
}
else{
if( sim_to_orig > PersonCal::getMatchThresh() ) {
ROS_WARN_STREAM("Reset to original calibration");
user_cal_ = original_cal_;
}
}
std::stringstream window_name;
window_name << "user_" << ((int)this_user.uid);