MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / toCvMat

Method toCvMat

IPL/src/IPLImage.cpp:183–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183cv::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
210uchar* IPLImage::rgb32()
211{

Callers 15

processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
processInputDataMethod · 0.80
robertsMethod · 0.80
sobelMethod · 0.80
cubicSplineMethod · 0.80

Calls

no outgoing calls

Tested by 1

processInputDataMethod · 0.64