</pre><p><ul><li><strong><span style="color:#000099;">使用 cv::Mat</span></strong></li></ul></p>例如,定义:<p></p><pre name="code" class="cpp">cv::Mat m( 10, 10, cv::F32C2 );
获取单个元素,需要指明类型:m.at< Vec2f >( i0, i1 ) = cv::Vec2f( x, y );
- 使用 cv::Mat_ 类模板的话,at()方法不需要指明类型:
cv::Mat_<Vec2f> m( 10, 10 );
m.at( i0, i1 ) = cv::Vec2f( x, y );
...........
m( i0, i1 ) = cv::Vec2f( x, y );