How to specify a color using Scalar class [closed]

asked 2015-03-27 08:32:42 -0600

RB gravatar image

updated 2015-03-27 08:51:56 -0600

berak gravatar image

I do not know how to specifiy a color using Scalar class in the below posted method?

Features2d.drawKeypoints(mKeyPoints_0, mKeyPoints_0, outImage, Scalar color, Features2d.DRAW_RICH_KEYPOINTS);
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-06 12:30:52.170528

Comments

2

new Scalar(200,0,0) ?

berak gravatar imageberak ( 2015-03-27 08:52:22 -0600 )edit

Features2d.drawKeypoints(mKeyPoints_0, mKeyPoints_0, outImage, Scalar(200,0,0), Features2d.DRAW_RICH_KEYPOINTS); should do it, like @berak said. I do not think the new is actually needed.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-27 09:15:38 -0600 )edit
3

^^ java needs it.

(there's no way to create something on the 'stack' there, so new Point(), new Scalar() new Mat(), etc)

berak gravatar imageberak ( 2015-03-27 09:32:02 -0600 )edit

@steven i think @berak is right, i tried to use Scalar(..) without the new operator and it is not allowed

RB gravatar imageRB ( 2015-03-27 10:06:27 -0600 )edit
1

O to bad :D

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-27 14:21:31 -0600 )edit
1

java stiffness :-p....

theodore gravatar imagetheodore ( 2015-03-27 20:36:21 -0600 )edit