Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling OpenCV projects on Google Glass #3

Open
Anonym0u5 opened this issue Apr 22, 2014 · 7 comments
Open

Compiling OpenCV projects on Google Glass #3

Anonym0u5 opened this issue Apr 22, 2014 · 7 comments

Comments

@Anonym0u5
Copy link

Hello,
when I compile your project (or all other project using opencv) on my Google Glass, Eclipse says this on console: "OpenCV Library - 2.4.8] Could not find OpenCV Library - 2.4.8.apk!"

Full message is:

[2014-04-22 11:57:17 - ImageManipulation] Android Launch!
[2014-04-22 11:57:17 - ImageManipulation] adb is running normally.
[2014-04-22 11:57:17 - ImageManipulation] Performing com.space150.android.glass.opencvimagemanipulation.MainActivity activity launch
[2014-04-22 11:57:17 - ImageManipulation] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-04-22 11:57:19 - ImageManipulation] Uploading ImageManipulation.apk onto device '015DB7590800200D'
[2014-04-22 11:57:19 - ImageManipulation] Installing ImageManipulation.apk...
[2014-04-22 11:57:21 - ImageManipulation] Success!
[2014-04-22 11:57:21 - OpenCV Library - 2.4.8] Could not find OpenCV Library - 2.4.8.apk!
[2014-04-22 11:57:21 - ImageManipulation] Starting activity com.space150.android.glass.opencvimagemanipulation.MainActivity on device 015DB7590800200D
[2014-04-22 11:57:22 - ImageManipulation] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.space150.android.glass.opencvimagemanipulation/.MainActivity }

On android device I know that I have to install the OpenCV Manager directly from the Google Play...... but on Google Glass what I have to do?

Thanks

@Anonym0u5
Copy link
Author

Ok.. I solved this problem, but now I see only this:
http://answers.opencv.org/upfiles/13935781384748768.png
Do you know why?

@lnanek
Copy link
Contributor

lnanek commented Apr 23, 2014

You need to call setPreviewFpsRange. See my pull request here:
#2

@Anonym0u5
Copy link
Author

thank you

@harryhow
Copy link

Hi @lnanek

Thanks for your solution. However, I'm trying to integrate this example, however, I have problem to get mCamera. What I've tried is to use mCamera = Camera.open() in surfaceChanged(). check my gist also...

@lnanek
Copy link
Contributor

lnanek commented Apr 30, 2014

I don't see any call to open in that gist you linked. Have you tried specifying a camera ID? Like here:
https://github.com/lnanek/MedViewGlass/blob/master/src/com/neatocode/medviewglass/activity/CameraSurfaceView.java#L105

@harryhow
Copy link

harryhow commented May 1, 2014

Sorry I didn't post Camera.open() call in my previous gist, please check this again.

I put Camera.open() in surfaceCreated(), set cam parameters in surfaceChanged().
I also try to put 0 or -1 as parameter to open camera but still without good luck.

What I suspect from the log is this example using OpenCV's CameraBridgeViewBase as a client bridge between Android Cam and Open CV to init camera. That means if we open camera before BaseLoaderCallback(), the mOpenCvCameraView.enableView() in BaseLoaderCallback() won't work because camera resource has been occupied. :/

Any thoughts?

@lnanek
Copy link
Contributor

lnanek commented May 1, 2014

Honestly, camera in use problems are a nightmare on Google Glass even
without involving libraries. I think swiping away from an app doesn't seem
to kill it, or even run as many life cycle events as you would expect.
Often when testing I do a full uninstall and reinstall of the app each
test, then to release a demo I usually have lots of code to kill the
process ASAP when the screen isn't foreground, use a launchMode that won't
give you multiple instances if it is started differently, etc.. It's kind
of like audio development where sometimes your process is killed and the
audio hardware still reports in use or keeps playing stuff until reboot.

On Wed, Apr 30, 2014 at 8:25 PM, Harry Chen [email protected]:

Sorry I didn't post Camera.open() call in my previous gist, please check
this https://gist.github.com/harryhow/c8f7bc3d48842b5fe362 again.

I put Camera.open() in surfaceCreated(), set cam parameters in
surfaceChanged().
I also try to put 0 or -1 as parameter to open camera but still without
good luck.

What I suspect from the log is this example using OpenCV's
CameraBridgeViewBase as a client bridge between Android Cam and Open CV to
init camera. That means if we open camera before BaseLoaderCallback(), the
mOpenCvCameraView.enableView() in BaseLoaderCallback() won't work because
camera resource has been occupied. :/

Any thoughts?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-41870741
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants