Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

adding rotation axis to CvCameraViewListener2

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

adding rotation axis to CvCameraViewListener2

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).

adding rotation axis to CvCameraViewListener2

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 :-)