OpenCV Crash when processing in paralelle
Hello,
I use OpenCV (2.4.10) for the detection of the face and eyes in an image.
The treatment is going very well with sequential calls but we begin to make calls in parallel was a crash at the lib (trace PJ).
The concern occurs on linux like wiondows.
Can someone tell me if the lib supports parallelism?
If this is the case, what may come my error ?
thankshs_err_pid30121.tiff
I can't read your tiff... anyway what do you mean for parallel calls ? threads, parallel for, ... please provide your code simplified
OpenCV works very well in parallel processing, except with anything related to GUI management ... are you calling "cv::imshow" and "cv::waitKey" in multiple threads ? If so, you should refrain to use such functions in only one thread.
private void validateFace(Mat matImage) throws URISyntaxException, WrongFaceException, IOException { int faces = openCvService.detectFace(matImage); if(faces != 1){ throw new WrongFaceException(); }
public int detectFace(Mat matImage) throws URISyntaxException, WrongFaceException, IOException { URL urlCascadeFace = OpenCvService.class.getResource(DETECT_FACE_XML); CascadeClassifier visageDetector = new CascadeClassifier(Paths.get(urlCascadeFace.toURI()).toFile().getPath()); MatOfRect faceDetections = new MatOfRect(); Mat matrice = matImage.clone(); //Detection du visage visageDetector.detectMultiScale(matrice, faceDetections); if (faceDetections.toArray().length > 0) { return faceDetections.toArray().length; } else { throw new WrongFaceException(); } }
Parallel calls: simultaneous calls in in perfoormance test
I use OpenCV in a java program
Load library System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
//Conversion image en BufferedImage InputStream inputStreamImage = new ByteArrayInputStream(bytesImageResize); BufferedImage bImageFromConvert = ImageIO.read(inputStreamImage);
did you mean parallel processes (many execution of your executable) ? please edit your question explain it, describe the context providing us yhe error messages and use code formatting.