当前位置:网站首页>Description of octomap averagenodecolor function
Description of octomap averagenodecolor function
2022-07-06 07:37:00 【Blue feather birds】
averageNodeColor yes ColorOcTreeNode The function in , Parameter is x,y,z,r,g,b
But the official website didn't say how this function works average color Of , So we have to start with the source code
According to the tips on the official website , This function is in the Definition at line 144 of file ColorOcTree.h.
00144 ColorOcTreeNode* averageNodeColor(const float& x, const float& y,
00145 const float& z, const unsigned char& r,
00146 const unsigned char& g, const unsigned char& b) {
00147 OcTreeKey key;
00148 if (!this->coordToKeyChecked(point3d(x,y,z), key)) return NULL;
00149 return averageNodeColor(key,r,g,b);
00150 }
You can see the call averageNodeColor(key, r, g, b), So look at the code of this overloaded function
00145 ColorOcTreeNode* ColorOcTree::averageNodeColor(const OcTreeKey& key,
00146 const unsigned char& r,
00147 const unsigned char& g,
00148 const unsigned char& b) {
00149 ColorOcTreeNode* n = search (key);
00150 if (n != 0) {
00151 if (n->isColorSet()) {
00152 ColorOcTreeNode::Color prev_color = n->getColor();
00153 n->setColor((prev_color.r + r)/2, (prev_color.g + g)/2, (prev_color.b + b)/2);
00154 }
00155 else {
00156 n->setColor(r, g, b);
00157 }
00158 }
00159 return n;
00160 }
You can see that every new color comes (r, g, b), Just average the previous color with the new color , It is equivalent to averaging all colors at this point .
边栏推荐
- [MySQL learning notes 29] trigger
- xpath中的position()函数使用
- 洛谷P4127 [AHOI2009]同类分布 题解
- How Navicat imports MySQL scripts
- word删除括号里内容
- C intercept string
- word中把帶有某個符號的行全部選中,更改為標題
- [online problem processing] how to kill the corresponding process when the MySQL table deadlock is caused by the code
- Key value judgment in the cycle of TS type gymnastics, as keyword use
- Scala语言学习-08-抽象类
猜你喜欢

数字IC设计笔试题汇总(一)

Generator Foundation

In the era of digital economy, how to ensure security?

Google可能在春节后回归中国市场。

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
![[CF Gym101196-I] Waif Until Dark 网络最大流](/img/66/6b339fc23146b5fbdcd2a1fa0a2349.png)
[CF Gym101196-I] Waif Until Dark 网络最大流

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
![[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps](/img/57/ee979a7db983ad56f0df7345dbc91f.jpg)
[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics

剪映的相关介绍
随机推荐
继电反馈PID控制器参数自整定
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
Ali's redis interview question is too difficult, isn't it? I was pressed on the ground and rubbed
合规、高效,加快药企数字化转型,全新打造药企文档资源中心
How can word delete English only and keep Chinese or delete Chinese and keep English
opencv学习笔记九--背景建模+光流估计
成为优秀的TS体操高手 之 TS 类型体操前置知识储备
Simulation of Michelson interferometer based on MATLAB
Iterator Foundation
位运算异或
Opencv learning notes 8 -- answer sheet recognition
学go之路(二)基本类型及变量、常量
C语言 简单易懂的高精度加法
leecode-C语言实现-15. 三数之和------思路待改进版
[MySQL learning notes 32] mvcc
js對象獲取屬性的方法(.和[]方式)
[1. Delphi foundation] 1 Introduction to Delphi Programming
Go learning -- implementing generics based on reflection and empty interfaces
navicat如何导入MySQL脚本
Key value judgment in the cycle of TS type gymnastics, as keyword use