cv::viz::viz3d Crashes soon after Mouse Interaction OS X

asked 2016-04-15 12:01:24 -0600

I'm am trying to run a cv::viz thread outside of my main thread to visualize a stream of 3D points. cv::viz Window

Notice that missing are the typical 3 buttons for close, minimize, and expand. The main loop looks as follows:

  cv::viz::Viz3d vizWindow( "Coordinate Frame" );

  while( isActive() && !vizWindow.wasStopped() )
  {
    points3dFrame = m_points3dBuffer.waitNewFrame( lastTimepoint );
    lastTimepoint = points3dFrame->timepoint;

    std::vector<cv::Vec4f> cloud = filterCloudByDepth( points3dFrame );

    if( cloud.empty() ) { continue; }

    auto cloudWidget = cv::viz::WCloud( cloud, cv::viz::Color::green() );
    cloudWidget.setRenderingProperty( cv::viz::POINT_SIZE, 2 );

    vizWindow.showWidget( "Depth", cloudWidget );

    vizWindow.spinOnce( 30, true );
  }

This runs as desired when built with VS2012 and run on windows. However, when I try to run this built with Xcode 7.2 tool on OS X 10.11.4 it will crash soon after I try to interact with the window using my mouse, with warning logged to the console before crashing.

Any idea why this fails? Do I really need to put this in my main thread? Why is it ok not to do so on Windows?

Errors to console:

Viewer3d Start
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const: conn 0x244a7 token 0x34fffffffffd8c48
Apr 15 12:52:19  augen[8908] <Warning>: Backtrace (at 33554.3):
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  0   CoreGraphics                        0x00007fff9ca45a99 CGSDisableUpdateToken + 210
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  1   AppKit                              0x00007fff9b385524 ___disable_updates_sync_block_invoke_2 + 17
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  2   libdispatch.dylib                   0x00007fff8fcff40b _dispatch_client_callout + 8
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  3   libdispatch.dylib                   0x00007fff8fd009f2 _dispatch_barrier_sync_f_invoke + 74
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  4   AppKit                              0x00007fff9b3853f2 NSCGSDisableUpdates + 213
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  5   AppKit                              0x00007fff9b385228 NSCGSTransactionRunPreCommitActionsForOrder_ + 156
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  6   AppKit                              0x00007fff9b38516f NSCGSTransactionRunPreCommitActions_ + 21
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  7   AppKit                              0x00007fff9bb33d84 -[_NSCGSTransaction synchronize] + 33
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  8   AppKit                              0x00007fff9bb33ff9 NSCGSTransactionSynchronize + 76
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  9   AppKit                              0x00007fff9b91f065 -[NSSurface syncSurfaceWantsExtendedDynamicRange] + 150
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  10  AppKit                              0x00007fff9b4573d1 -[NSSurface _createSurface] + 677
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  11  AppKit                              0x00007fff9b456d2c -[NSSurface setFrame:] + 785
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  12  AppKit                              0x00007fff9b91f16b __38-[NSSurface syncToViewUnconditionally]_block_invoke + 154
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  13  AppKit                              0x00007fff9b374429 NSPerformVisuallyAtomicChange + 147
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  14  AppKit                              0x00007fff9b456650 -[NSSurface syncToViewUnconditionally] + 100
Apr 15 12:52:19  augen[8908] <Warning>: void CGSUpdateManager::log() const:  15  AppKit                              0x00007fff9b91f204 __37-[NSSurface orderSurface:relativeTo:]_block_invoke + 44
Apr 15 12:52:19  augen[8908] <Warning ...
(more)
edit retag flag offensive close merge delete