Using OpenCV cv2.selectROI in Django raises error libc++abi.dylib: terminating with uncaught exception of type NSException

Using OpenCV in a Django app is causing the server to shutdown with following error:

libc++abi.dylib: terminating with uncaught exception of type NSException

Goal:

  • Select ROI from the displayed image in browser

What I am trying:

  • Select an image (using cv2.imread()) and display in the browser <-- Working
  • Select ROI using r = cv2.selectROI(...) <-- At this step the above error happens

Using the code in Python shell works. But when included in Django views.py I am getting the error.

What I am trying to find:

  • Is it possible to use cv2.selectROI in Django?
  • What are the basic requirement to accomplish what I am trying?
Back to Top