openCV2中的SCalar的详细用法和用处能介绍下么?

openCV2中的SCalar的详细用法和用处能介绍下么? 


12345678_0001
浏览 1617回答 3
3回答

繁花如伊

cvZero(CvArr* arr)该函数作用主要主要变量arr清零做处避免系统自配值确定性程序影响现预料结与功能相同函数cvSetZero(CvArr* arr)希望能帮助

哆啦的时光机

class Scalar_Template class for a 4-element vector derived from Vec.template<typename _Tp> class CV_EXPORTS Scalar_ : public Vec<_Tp, 4>{public://! various constructorsScalar_();Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);Scalar_(const CvScalar& s);Scalar_(_Tp v0);//! returns a scalar with all elements set to v0static Scalar_<_Tp> all(_Tp v0);//! conversion to the old-style CvScalaroperator CvScalar() const;//! conversion to another data typetemplate<typename T2> operator Scalar_<T2>() const;//! per-element productScalar_<_Tp> mul(const Scalar_<_Tp>& t, double scale=1 ) const;// returns (v0, -v1, -v2, -v3)Scalar_<_Tp> conj() const;// returns true iff v1 == v2 == v3 == 0bool isReal() const;};typedef Scalar_<double> Scalar;Being derived from Vec<_Tp, 4> , Scalar_ and Scalar can be used just as typical 4-element vectors. In addition, they can be converted to/from CvScalar . The type Scalar is widely used in OpenCV to pass pixel values.
打开App,查看更多内容
随时随地看视频慕课网APP