本文整理汇总了C++中HeightMap::calcSobel方法的典型用法代码示例。如果您正苦于以下问题:C++ HeightMap::calcSobel方法的具体用法?C++ HeightMap::calcSobel怎么用?C++ HeightMap::calcSobel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeightMap
的用法示例。
在下文中一共展示了HeightMap::calcSobel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
Serial::open();
Camera* camera = new Camera(HD720, 15.0);
ERRCODE code = camera->init(MODE::QUALITY, 0);
if (code != SUCCESS) {
cout << errcode2str(code) << endl;
delete camera;
return 1;
}
int width = camera->getImageSize().width;
int height = camera->getImageSize().height;
PointCloud *cloud = new PointCloud(width, height);
HeightMap *heightMap = new HeightMap(128, 128);
CloudViewer *viewer = new CloudViewer();
PathPlanner *planner = new PathPlanner(heightMap);
int key = ' ';
Mat depth, imLeft;
printf("LET'S GO!\n");
Serial::gas(0.25);
// application quits when user stikes 'q'
while (key != 'q') {
camera->setConfidenceThreshold(98); // parameter is reliability index ~[1,100] with 100 as no filtering
camera->grab(SENSING_MODE::RAW);
depth = camera->retrieveMeasure(MEASURE::DEPTH);
imLeft = camera->retrieveImage(SIDE::LEFT);
cloud->fill(imLeft.data, (float*) depth.data, camera->getParameters());
cloud->fillHeightMap(heightMap);
heightMap->calcSobel(0.6);
planner->calcEdges();
steerToward(planner->getTarget());
viewer->AddData(heightMap);
viewer->AddPlanner(planner);
viewer->AddData(cloud);
// Update the value of key so that we can quit when the user strikes 'q'
key = viewer->getKey();
}
printf("quitting\n");
delete camera;
delete cloud;
delete viewer;
return 0;
}