adding rotation axis to CvCameraViewListener2

asked 2014-03-28 10:26:29 -0600

damiannelus gravatar image

updated 2014-03-28 11:08:08 -0600

Hi there,

i've question related to usage of CvCameraViewListener2.

I would like to add two axis (x and y) to showed camera preview. To ilustrate it should look like this: image description

Is it possible? How i can do it? Ofcourse axis are dynamically generated

[EDIT]

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
    mRgba = inputFrame.rgba();

    lx = new Point(0.0, (float)mRgba.rows()/2);
    rx = new Point((float)mRgba.cols(), (float)mRgba.rows()/2);
    ty = new Point((float)mRgba.cols()/2, 0.0);
    by = new Point((float)mRgba.cols()/2, (float)mRgba.rows());

    Core.line(mRgba, lx, rx, new Scalar(0, 0, 255, 255));
    Core.line(mRgba, ty, by, new Scalar(255, 0, 0, 255));
    return mRgba;
}

Code posted above gives horizontal line (lx, rx) but no vertical (ty, by).

[EDIT 2]

And here is the answear: thickness

    Core.line(mRgba, lx, rx, new Scalar(0, 0, 255, 255), **3**);
    Core.line(mRgba, ty, by, new Scalar(255, 0, 0, 255), **3**);

makes it visible.

Sometimes it's really helpful to ask the question :-)

edit retag flag offensive close merge delete

Comments

how would that be different from just drawing a red and a green line ?

berak gravatar imageberak ( 2014-03-28 10:33:37 -0600 )edit