为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

12345678_0001 2019-02-07 11:07:22
openCV2中的SCalar的详细用法和用处能介绍下么? 
查看完整描述

3 回答

?
繁花如伊

TA贡献2012条经验 获得超12个赞

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

查看完整回答
反对 回复 2019-03-15
?
哆啦的时光机

TA贡献1779条经验 获得超6个赞

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 constructors
Scalar_();
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 v0
static Scalar_<_Tp> all(_Tp v0);
//! conversion to the old-style CvScalar
operator CvScalar() const;

//! conversion to another data type
template<typename T2> operator Scalar_<T2>() const;

//! per-element product
Scalar_<_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 == 0
bool 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.



查看完整回答
反对 回复 2019-03-15
  • 3 回答
  • 0 关注
  • 1602 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信