| 181 | } |
| 182 | |
| 183 | cv::Mat IPLImage::toCvMat() |
| 184 | { |
| 185 | cv::Mat mat(_height, _width, CV_8UC4, rgb32()); |
| 186 | |
| 187 | // slower float version |
| 188 | /* |
| 189 | cv::Mat mat(_height, _width, CV_32FC3); |
| 190 | for(int y = 0; y<_height; y++) |
| 191 | { |
| 192 | for(int x = 0; x<_width; x++) |
| 193 | { |
| 194 | float r = _planes[0]->p(x,y); |
| 195 | float g = _planes[1]->p(x,y); |
| 196 | float b = _planes[2]->p(x,y); |
| 197 | |
| 198 | cv::Vec3f value; |
| 199 | value.val[0] = b; |
| 200 | value.val[1] = g; |
| 201 | value.val[2] = r; |
| 202 | |
| 203 | mat.at<cv::Vec3f>(y, x) = value; |
| 204 | } |
| 205 | }*/ |
| 206 | |
| 207 | return mat; |
| 208 | } |
| 209 | |
| 210 | uchar* IPLImage::rgb32() |
| 211 | { |
no outgoing calls