Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

setResolution(Camera.size) is undefined for cameraBridgeViewBase

I am currently working with OpenCV Tutorial 2 - Mixed Process, and I wanted to call a list with resolutions. The code is:

public boolean onOptionsItemSelected(MenuItem item) { Log.i(TAG, "called onOptionsItemSelected; selected item: " + item);

    if (item == mItemPreviewRGBA) {
        mViewMode = VIEW_MODE_RGBA;
    } else if (item == mItemPreviewGray) {
        mViewMode = VIEW_MODE_GRAY;
    } else if (item == mItemPreviewCanny) {
        mViewMode = VIEW_MODE_CANNY;
    } else if (item == mItemPreviewFeatures) {
        mViewMode = VIEW_MODE_FEATURES;
    } else if (item == mResolutionMenu)
    {
      int id = item.getItemId();
        Size resolution = mResolutionList.get(id);
        mOpenCvCameraView.setResolution(resolution);
        resolution = mOpenCvCameraView.getResolution();
        String caption = Integer.valueOf(resolution.width).toString()

+ "x" + Integer.valueOf(resolution.height).toString();

        Toast.makeText(this, caption, Toast.LENGTH_SHORT).show();
    }

    return true;
}

But Eclipse is giving me the next errors (can't launch the app because of this): The Method setResolution(Camera.size) is undefined for the type CameraBridgeViewBase. These occur for the setResolution() and getResolution().

I have no idea what I'm doing wrong and Google isn't of much help

OpenCV4Android : setResolution(Camera.size) is undefined for cameraBridgeViewBase

I am currently working with OpenCV Tutorial 2 - Mixed Process, and I wanted to call a list with resolutions. The code is:

public boolean onOptionsItemSelected(MenuItem item) { Log.i(TAG, "called onOptionsItemSelected; selected item: " + item);

    if (item == mItemPreviewRGBA) {
        mViewMode = VIEW_MODE_RGBA;
    } else if (item == mItemPreviewGray) {
        mViewMode = VIEW_MODE_GRAY;
    } else if (item == mItemPreviewCanny) {
        mViewMode = VIEW_MODE_CANNY;
    } else if (item == mItemPreviewFeatures) {
        mViewMode = VIEW_MODE_FEATURES;
    } else if (item == mResolutionMenu)
    {
      int id = item.getItemId();
        Size resolution = mResolutionList.get(id);
        mOpenCvCameraView.setResolution(resolution);
        resolution = mOpenCvCameraView.getResolution();
        String caption = Integer.valueOf(resolution.width).toString()

+ "x" + Integer.valueOf(resolution.height).toString();

        Toast.makeText(this, caption, Toast.LENGTH_SHORT).show();
    }

    return true;
}

But Eclipse is giving me the next errors (can't launch the app because of this): The Method setResolution(Camera.size) is undefined for the type CameraBridgeViewBase. These occur for the setResolution() and getResolution().

I have no idea what I'm doing wrong and Google isn't of much help

click to hide/show revision 3
formatting

OpenCV4Android : setResolution(Camera.size) is undefined for cameraBridgeViewBase

I am currently working with OpenCV Tutorial 2 - Mixed Process, Process, and I wanted to call a list with resolutions. The code is:

public boolean
  boolean onOptionsItemSelected(MenuItem item) {
   Log.i(TAG, "called onOptionsItemSelected; selected item:
  item: " + item);

 item);
  if (item == mItemPreviewRGBA) {
     mViewMode = VIEW_MODE_RGBA;
   } else if (item == mItemPreviewGray) {
     mViewMode = VIEW_MODE_GRAY;
   } else if (item == mItemPreviewCanny) {
     mViewMode = VIEW_MODE_CANNY;
   } else if (item == mItemPreviewFeatures) {
     mViewMode = VIEW_MODE_FEATURES;
    } else if (item == mResolutionMenu)
    {
  } else if (item == mResolutionMenu) {
    int id = item.getItemId();
     Size resolution = mResolutionList.get(id);
     mOpenCvCameraView.setResolution(resolution);
     resolution = mOpenCvCameraView.getResolution();
     String caption = Integer.valueOf(resolution.width).toString()

Integer.valueOf(resolution.width).toString() + "x" + Integer.valueOf(resolution.height).toString();

 +
                     Integer.valueOf(resolution.height).toString();
    Toast.makeText(this, caption, Toast.LENGTH_SHORT).show();
   }
   return true;
}

But Eclipse is giving me the next errors (can't launch the app because of this): The Method setResolution(Camera.size) setResolution(Camera.size) is undefined for the type CameraBridgeViewBase. CameraBridgeViewBase. These occur for the setResolution() setResolution() and getResolution(). getResolution().

I have no idea what I'm doing wrong and Google isn't of much help help.