title: Python3 & Opencv3 & Multiprocessing raise System Error
body: <p>I'm currently using OpenCV 3 with python 3.4. My machine is a MacBook Pro with OS X 10.10 (Yosemite) and I'm having problems when using some functions from OpenCV combined with the multiprocessing Library. Here is a (very) simplified sample code which reproduce the error:</p>
  
  <pre><code>import multiprocessing
  import numpy
  import cv2
  
  
  class Sample():
      def __init__(self):
          self.mask = []  # Testing
  
      def experiment(self):
  
          img = cv2.imread("/Users/luigolas/PycharmProjects/PyReid/tests/test_resources/P2/cam1/P2_001_cam1_1.png")
          self.mask.append(segment(img))
          print("Segmented!")
          processes = [multiprocessing.Process(target=self._func) for i in range(3)]
          _ = [p.start() for p in processes]
          _ = [p.join() for p in processes]
  
      def _func(self):
          img = cv2.imread("/Users/luigolas/PycharmProjects/PyReid/tests/test_resources/P2/cam2/P2_001_cam2_1.png")
          cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
          print("Done!!")
  
  
  def segment(image):
      bgdmodel = numpy.zeros((1, 65), numpy.float64)
      fgdmodel = numpy.zeros((1, 65), numpy.float64)
      mask_source = "/Users/luigolas/PycharmProjects/PyReid/resources/masks/OptimalMask.txt"
      mask = numpy.loadtxt(mask_source, numpy.uint8)
      cv2.grabCut(image, mask, None, bgdmodel, fgdmodel, 2, cv2.GC_INIT_WITH_MASK)
  
      mask = numpy.where((mask == 2) | (mask == 0), 0, 1).astype('uint8')
  
      return mask
  
  
  if __name__ == '__main__':
      t = Sample()
      t.experiment()
  </code></pre>
  
  <p>The problem is that it never gets to the "Done!!" print, as it breaks showing an OS X error message. The full error message is in this <a href="https://gist.github.com/Luigolas/c35f325020b634fbabdc" rel="nofollow">GIST</a></p>
  
  <p>I've been stuck with this for a while and haven't been able to find the exact reason of this error. If I don't run the "cvtcolor" command there is no problem at all. As well as if the "grabcut" command is not run...</p>
  
  <p><strong>UDATE:</strong>
  In the _func method if I add a print or create a file as the first instruction it is printed and created, meaning that the process is launched.
  The problem appears when both the grabcut (in segment function) and cvtcolor are executed. If one of those is not executed, there is no problem at all. How can it be related at all?</p>
  
  <p>I also tried using <code>multiprocessing.dummy.Process</code> and it worked.
  A problem with OpenCV maybe?</p>