Ask Your Question
1

The Difference between Scalar() and cvScalar

asked 2012-10-20 13:00:28 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi Everybody! I have a little problem when creating color chooser using trackbar. when i thresholding color using inRange() function, it gives different result with cvInRangeS(). I believe this because i using different format of Scalar inside inRange() and cvScalar() inside cvInRangeS().

why Scalar(190, 10, 111) gives different result with cvScalar(190, 10, 111) ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-10-20 13:10:25 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

cvScalar is a C function. Scalar is a C++ method.

Scalar have a namespace: cv. Example:

cv::Scalar.

For use only Scalar, declare the namespace.

using namespace cv;

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-20 13:00:28 -0600

Seen: 3,687 times

Last updated: Oct 20 '12