在Android应用程序中,OpenCV在短时间内崩溃

时间:2016-02-02 09:30:43

标签: android opencv opencv3.0 opencv4android tegra

我有一个应用程序执行一些图像拼接并使用OpenCV。它曾经工作,但突然间它(随机?)一直崩溃。我不知道为什么会发生这种情况,我没有更改代码,但也没有尝试过几周的功能。在我的Nvidia Shield上可能还有Android更新。

它曾经与OpenCV 2.4.10一起使用,但由于它不再适用于该版本,我试图切换到显示相同行为的OpenCV 3.0.0。

我的设置:

  • Nvidia Shield with Android 5.1.1
  • 已安装OpenCV_3.0.0_manager_3.00_armeabi-v7a.apk经理
  • 构建目标是Android 5.1.1
  • 将Android SDK中的OpenCV 3.0库集成到我的Android项目中。在SDK中,这是库的路径:%path-to-sdk%/OpenCV3-android-sdk/sdk/java

我的应用程序表现如下:它似乎成功加载并初始化OpenCV,甚至开始捕获并拼接一些图像。三四张图像后,它会崩溃。以下是崩溃期间记录的Android日志:

02-01 13:07:55.172: I/AudioFlinger(209): AUDIO_OUTPUT_FLAG_FAST accepted: frameCount=11258 mFrameCount=512
02-01 13:07:55.321: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:07:55.582: E/Error(209): configureSensor: cannot find a sensor mode for 2592x1944
02-01 13:07:56.391: W/Camera2-ZslProcessor3(209): getCandidateTimestampLocked: ZSL queue has no metadata frames
02-01 13:07:56.391: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:07:56.653: E/Error(209): configureSensor: cannot find a sensor mode for 2592x1944
02-01 13:07:56.745: I/ActivityManager(632): Process com.google.android.partnersetup (pid 22851) has died
02-01 13:07:57.301: W/Camera2-ZslProcessor3(209): getCandidateTimestampLocked: ZSL queue has no metadata frames
02-01 13:07:57.301: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:07:57.640: E/Error(209): configureSensor: cannot find a sensor mode for 2592x1944
02-01 13:07:58.134: I/ActivityManager(632): Process com.google.android.calendar (pid 23255) has died
02-01 13:07:58.139: E/lowmemorykiller(174): Error writing /proc/22747/oom_score_adj; errno=22
02-01 13:07:58.146: I/BackgroundMemoryTrimmer(22823): Trimming objects from memory, since app is in the background.
02-01 13:07:58.173: I/PersonalGridService(22885): onTrimMemory called with level: 5
02-01 13:07:58.174: I/ActivityManager(632): Process android.process.acore (pid 22747) has died
02-01 13:07:58.271: W/Camera2-ZslProcessor3(209): getCandidateTimestampLocked: ZSL queue has no metadata frames
02-01 13:07:58.271: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:07:58.322: I/ActivityManager(632): Process com.android.providers.calendar (pid 23231) has died
02-01 13:07:58.364: I/ActivityManager(632): Process com.google.android.apps.plus (pid 23125) has died
02-01 13:07:58.365: E/lowmemorykiller(174): Error writing /proc/23104/oom_score_adj; errno=22
02-01 13:07:58.369: I/PersonalGridService(22885): onTrimMemory called with level: 10
02-01 13:07:58.381: I/ActivityManager(632): Process com.android.chrome (pid 23104) has died
02-01 13:07:58.400: I/ActivityManager(632): Process com.google.android.apps.photos (pid 23029) has died
02-01 13:07:58.407: I/PersonalGridService(22885): onTrimMemory called with level: 15
02-01 13:07:58.432: I/ActivityManager(632): Process com.google.process.gapps (pid 22637) has died
02-01 13:07:58.433: E/lowmemorykiller(174): Error opening /proc/22823/oom_score_adj; errno=2
02-01 13:07:58.434: I/ActivityManager(632): Process com.google.android.googlequicksearchbox:search (pid 22823) has died
02-01 13:07:58.566: E/Error(209): configureSensor: cannot find a sensor mode for 2592x1944
02-01 13:07:58.608: I/ActivityManager(632): Process org.opencv.engine:OpenCVEngineProcess (pid 22529) has died
02-01 13:07:59.175: W/Camera2-ZslProcessor3(209): getCandidateTimestampLocked: ZSL queue has no metadata frames
02-01 13:07:59.175: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:07:59.277: I/ActivityManager(632): Process com.google.android.talk (pid 22787) has died
02-01 13:07:59.277: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.talk/com.google.android.libraries.hangouts.video.CallService in 1000ms
02-01 13:07:59.280: I/ActivityManager(632): Process android.process.media (pid 22454) has died
02-01 13:07:59.280: W/ActivityManager(632): Scheduling restart of crashed service com.android.providers.media/.MtpService in 1000ms
02-01 13:07:59.291: I/ActivityManager(632): Process com.nvidia.penapplauncher (pid 22972) has died
02-01 13:07:59.291: W/ActivityManager(632): Scheduling restart of crashed service com.nvidia.penapplauncher/com.nvidia.quickMenu.QuickMenuService in 10988ms
02-01 13:07:59.365: I/ActivityManager(632): Process com.nvidia.tegrazone3 (pid 22477) has died
02-01 13:07:59.365: W/ActivityManager(632): Scheduling restart of crashed service com.nvidia.tegrazone3/com.nvidia.tegrazone.account.AccountService in 20915ms
02-01 13:07:59.365: E/lowmemorykiller(174): Error opening /proc/22616/oom_score_adj; errno=2
02-01 13:07:59.366: I/ActivityManager(632): Process com.google.android.gms (pid 22616) has died
02-01 13:07:59.366: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/.analytics.service.AnalyticsService in 30914ms
02-01 13:07:59.441: E/Error(209): configureSensor: cannot find a sensor mode for 2592x1944
02-01 13:07:59.510: I/ActivityManager(632): Start proc 23500:com.nvidia.tegrazone3/u0a65 for service com.nvidia.tegrazone3/com.nvidia.tegrazone.account.AccountService
02-01 13:07:59.671: I/ActivityManager(632): Process com.nvidia.tegrazone3:PersonalGridService (pid 22885) has died
02-01 13:07:59.671: W/ActivityManager(632): Scheduling restart of crashed service com.nvidia.tegrazone3/com.nvidia.grid.PersonalGridService.pgService in 20609ms
02-01 13:07:59.966: W/Camera2-ZslProcessor3(209): getCandidateTimestampLocked: ZSL queue has no metadata frames
02-01 13:07:59.966: E/Camera2-ZslProcessor3(209): pushToReprocess: Could not find good candidate for ZSL reprocessing
02-01 13:08:00.020: I/ActivityManager(632): Process com.google.android.inputmethod.latin (pid 22923) has died
02-01 13:08:00.020: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME in 30260ms
02-01 13:08:00.100: I/ActivityManager(632): Process com.google.android.gms.persistent (pid 22659) has died
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.internal.PendingIntentCallbackService in 40180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/.common.stats.GmsCoreStatsService in 50180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/.backup.BackupTransportService in 60180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.fused.FusedLocationService in 70180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/.deviceconnection.service.DeviceConnectionServiceBroker in 80180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.network.NetworkLocationService in 90180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.geofencer.service.GeofenceProviderService in 100180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/.gcm.GcmService in 110180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.geocode.GeocodeService in 120180ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerService in 130179ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.internal.server.GoogleLocationService in 140179ms
02-01 13:08:00.100: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.contextmanager.service.ContextManagerService in 150179ms
02-01 13:08:00.101: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.gms/com.google.android.location.reporting.service.DispatchingService in 160179ms
02-01 13:08:00.116: I/WindowState(632): WIN DEATH: Window{1026bdfe u0 com.nvidia.ControllerMapper}
02-01 13:08:00.341: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.343: W/InputDispatcher(632): channel '3438de7d mobileBRDF.Renderer/mobileBRDF.ImageProcessing.ImageProcessingActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
02-01 13:08:00.343: E/InputDispatcher(632): channel '3438de7d mobileBRDF.Renderer/mobileBRDF.ImageProcessing.ImageProcessingActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
02-01 13:08:00.378: W/CameraService(209): Disconnecting camera client 0xae447290 since the binder for it died (this pid 209)
02-01 13:08:00.379: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.379: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.379: E/Camera3-OutputStream(209): getBufferLocked: Stream 0: Can't dequeue next output buffer: Broken pipe (-32)
02-01 13:08:00.379: E/Camera3-Device(209): RequestThread: Can't get output buffer, skipping request: Broken pipe (-32)
02-01 13:08:00.379: E/Camera2ClientBase(209): Error condition 3 reported by HAL, requestId 30000005
02-01 13:08:00.383: W/InputDispatcher(632): channel '24b71005 mobileBRDF.Renderer/mobileBRDF.HDR.EnvMapCaptureActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
02-01 13:08:00.383: E/InputDispatcher(632): channel '24b71005 mobileBRDF.Renderer/mobileBRDF.HDR.EnvMapCaptureActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
02-01 13:08:00.396: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.396: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.396: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.415: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.415: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.415: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.431: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.431: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.431: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.518: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.518: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.518: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.571: E/Surface(209): queueBuffer: error queuing buffer to SurfaceTexture, -32
02-01 13:08:00.571: E/Camera3-OutputStream(209): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
02-01 13:08:00.571: E/Camera3-Device(209): Can't return buffer to its stream: Broken pipe (-32)
02-01 13:08:00.610: I/WindowState(632): WIN DEATH: Window{2fbeaa8b u0 SurfaceView}
02-01 13:08:00.844: I/WindowState(632): WIN DEATH: Window{24b71005 u0 mobileBRDF.Renderer/mobileBRDF.HDR.EnvMapCaptureActivity}
02-01 13:08:00.844: W/InputDispatcher(632): Attempted to unregister already unregistered input channel '24b71005 mobileBRDF.Renderer/mobileBRDF.HDR.EnvMapCaptureActivity (server)'
02-01 13:08:00.912: I/WindowState(632): WIN DEATH: Window{3438de7d u0 mobileBRDF.Renderer/mobileBRDF.ImageProcessing.ImageProcessingActivity}
02-01 13:08:00.912: W/InputDispatcher(632): Attempted to unregister already unregistered input channel '3438de7d mobileBRDF.Renderer/mobileBRDF.ImageProcessing.ImageProcessingActivity (server)'
02-01 13:08:00.912: W/WindowManager(632): Force-removing child win Window{d2dcab1 u0 SurfaceView} from container Window{3438de7d u0 mobileBRDF.Renderer/mobileBRDF.ImageProcessing.ImageProcessingActivity}
02-01 13:08:00.953: W/WindowManager(632): Failed looking up window
02-01 13:08:00.953: W/WindowManager(632): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@821958 does not exist
02-01 13:08:00.953: W/WindowManager(632):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8559)
02-01 13:08:00.953: W/WindowManager(632):   at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8550)
02-01 13:08:00.953: W/WindowManager(632):   at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1142)
02-01 13:08:00.953: W/WindowManager(632):   at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
02-01 13:08:00.953: I/WindowState(632): WIN DEATH: null
02-01 13:08:00.955: I/ActivityManager(632): Process com.google.android.googlequicksearchbox:interactor (pid 23335) has died
02-01 13:08:00.955: W/ActivityManager(632): Scheduling restart of crashed service com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService in 942128ms
02-01 13:08:00.956: I/ActivityManager(632): Process com.nvidia.ControllerMapper (pid 22589) has died
02-01 13:08:00.956: W/ActivityManager(632): Scheduling restart of crashed service com.nvidia.ControllerMapper/.MapperService in 159324ms
02-01 13:08:00.957: I/ActivityManager(632): Process com.nvidia.stats (pid 22508) has died
02-01 13:08:00.957: W/ActivityManager(632): Scheduling restart of crashed service com.nvidia.stats/.StatsService in 169323ms
02-01 13:08:00.983: W/InputMethodManagerService(632): Session failed to close due to remote exception
02-01 13:08:00.983: W/InputMethodManagerService(632): android.os.DeadObjectException
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.os.BinderProxy.transactNative(Native Method)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.os.BinderProxy.transact(Binder.java:496)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.internal.view.IInputMethodSession$Stub$Proxy.finishSession(IInputMethodSession.java:305)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.InputMethodManagerService.finishSessionLocked(InputMethodManagerService.java:1420)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.InputMethodManagerService.clearClientSessionLocked(InputMethodManagerService.java:1411)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.InputMethodManagerService.clearCurMethodLocked(InputMethodManagerService.java:1437)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.InputMethodManagerService.onServiceDisconnected(InputMethodManagerService.java:1456)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1213)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1227)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.os.Handler.handleCallback(Handler.java:739)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.os.Handler.dispatchMessage(Handler.java:95)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at android.os.Looper.loop(Looper.java:135)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.SystemServer.run(SystemServer.java:269)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.server.SystemServer.main(SystemServer.java:170)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at java.lang.reflect.Method.invoke(Native Method)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at java.lang.reflect.Method.invoke(Method.java:372)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
02-01 13:08:00.983: W/InputMethodManagerService(632):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
02-01 13:08:00.998: I/stats(632): onServiceDisconnected
02-01 13:08:00.998: I/stats(632): onServiceDisconnected
02-01 13:08:01.054: I/ActivityManager(632): Start proc 23521:android.process.media/u0a5 for service com.android.providers.media/.MtpService
02-01 13:08:01.057: I/ActivityManager(632): Process mobileBRDF.Renderer (pid 22471) has died
02-01 13:08:01.058: W/ActivityManager(632): Force removing ActivityRecord{1e7f649b u0 mobileBRDF.Renderer/mobileBRDF.HDR.EnvMapCaptureActivity t1990}: app died, no saved state

这种行为可能是什么原因?

可能是因为我在配置过程中遗漏了一些东西吗? (有关OpenCV经理的事可能吗?)

我可以采取哪些措施来缩小错误范围?

更新

我仍然无法弄清楚Nvidia Shield上的问题。它只是在OpenCV内的某个地方崩溃了。在2个不同的Nvidia Shield设备上测试=>两者都崩溃了。相同的构建+相同的配置运行而不会崩溃在具有相同GPU(Nvidia K1)的Google Nexus 9上。疯狂的时候!

0 个答案:

没有答案