| 133 | |
| 134 | |
| 135 | void example_auto_pilot() { |
| 136 | GElementPtr lane, car, show = nullptr; |
| 137 | auto pipeline = GPipelineFactory::create(); |
| 138 | |
| 139 | pipeline->registerGElement<LaneDetectorGNode>(&lane, {}, "lane"); |
| 140 | pipeline->registerGElement<CarDetectorGNode>(&car, {}, "car"); |
| 141 | pipeline->registerGElement<ShowGNode>(&show, {lane, car}, "show"); |
| 142 | |
| 143 | pipeline->createGParam<DetectResultGParam>(EXAMPLE_PARAM_KEY); |
| 144 | pipeline->addGDaemon<CameraGDaemon>(1000); // 模拟相机,每间隔1000ms,生成一张图片 |
| 145 | |
| 146 | pipeline->process(10); |
| 147 | GPipelineFactory::clear(); |
| 148 | CGRAPH_CLEAR_MESSAGES() |
| 149 | } |
| 150 | |
| 151 | |
| 152 | int main() { |