| 198 | } |
| 199 | |
| 200 | void Segmentation::_destaggerCloud(const Cloud::Ptr cloud, Cloud::Ptr& outCloud){ |
| 201 | bool col_valid = true; |
| 202 | |
| 203 | for(auto irow = 0; irow < _img_h; irow++){ |
| 204 | for(auto icol = 0; icol < _img_w; icol++){ |
| 205 | auto im_col = icol; |
| 206 | // Ouster data needs a shift every other row |
| 207 | if(irow % 2 == 0){ |
| 208 | im_col += 32; |
| 209 | if(im_col < 0 || im_col > _img_w){ |
| 210 | col_valid = false; |
| 211 | im_col = im_col % _img_w; |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | if(col_valid){ |
| 216 | const auto& pt = cloud->points[irow * _img_w + icol]; |
| 217 | auto& outPt = outCloud->points[irow * _img_w + im_col]; |
| 218 | // const auto& pt = cloud->at(icol, irow); |
| 219 | // auto& outPt = outCloud->at(im_col, irow); |
| 220 | outPt.x = pt.x; |
| 221 | outPt.y = pt.y; |
| 222 | outPt.z = pt.z; |
| 223 | } |
| 224 | |
| 225 | col_valid = true; |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | void Segmentation::maskCloud(const Cloud::Ptr cloud, |
| 231 | cv::Mat mask, |
nothing calls this directly
no outgoing calls
no test coverage detected