← Back to team overview

openjdk team mailing list archive

[Bug 1273554] [NEW] opencv bindings runtime error

 

Public bug reported:

Hello,

I'm using opencv with java bindings, and when running this code:

public class HumanClassifier {

	public static void main(String[] args) {
		int num = 3;
		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
		CascadeClassifier body_cascade = new CascadeClassifier(
				"haarcascade_fullbody.xml");

		Mat img = Highgui.imread("testImages/img" + num + ".jpeg", Highgui.CV_LOAD_IMAGE_GRAYSCALE);
		
		MatOfRect humans = new MatOfRect();
		body_cascade.detectMultiScale(img, humans);

                List<Rect> humansList = humans.toList();

		for (int i = 0; i < humansList.size(); i++) {
			Rect human = humansList.get(i);
			Point start = new Point(human.x, human.y);
			Point end = new Point(human.x + human.height, human.y + human.width);

			Core.rectangle(img, start, end, new Scalar(0, 0, 255), 2);
			System.out.println("Rect : " + human.x + " " + human.y);
		}

		Highgui.imwrite("detection" + num + ".jpg", img);
	}
}


I am getting this error

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb31497dd, pid=3815, tid=2927622976
#
# JRE version: 6.0_27-b27
# Java VM: OpenJDK Client VM (20.0-b12 mixed mode, sharing linux-x86 )
# Derivative: IcedTea6 1.12.6
# Distribution: Ubuntu 13.04, package 6b27-1.12.6-1ubuntu0.13.04.4
# Problematic frame:
# C  [libopencv_objdetect.so.2.4+0x357dd]  int cv::predictOrdered<cv::HaarEvaluator>(cv::CascadeClassifier&, cv::Ptr<cv::FeatureEvaluator>&, double&)+0xed
#
# An error report file with more information is saved as:
# /home/saka/repositories/r_and_d/test_tgsdgdsg/hs_err_pid3815.log
[thread -1369445568 also had an error]
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
#

This happens unconditionally as i tried to run the same code multiple of
times (with the same input) and it works fine in some cases returning
the correct output.

Thanks!

** Affects: openjdk-6 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: opencv

** Attachment added: "error log"
   https://bugs.launchpad.net/bugs/1273554/+attachment/3960160/+files/hs_err_pid3288.log

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-6 in Ubuntu.
https://bugs.launchpad.net/bugs/1273554

Title:
  opencv bindings runtime error

Status in “openjdk-6” package in Ubuntu:
  New

Bug description:
  Hello,

  I'm using opencv with java bindings, and when running this code:

  public class HumanClassifier {

  	public static void main(String[] args) {
  		int num = 3;
  		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
  		CascadeClassifier body_cascade = new CascadeClassifier(
  				"haarcascade_fullbody.xml");

  		Mat img = Highgui.imread("testImages/img" + num + ".jpeg", Highgui.CV_LOAD_IMAGE_GRAYSCALE);
  		
  		MatOfRect humans = new MatOfRect();
  		body_cascade.detectMultiScale(img, humans);

                  List<Rect> humansList = humans.toList();

  		for (int i = 0; i < humansList.size(); i++) {
  			Rect human = humansList.get(i);
  			Point start = new Point(human.x, human.y);
  			Point end = new Point(human.x + human.height, human.y + human.width);

  			Core.rectangle(img, start, end, new Scalar(0, 0, 255), 2);
  			System.out.println("Rect : " + human.x + " " + human.y);
  		}

  		Highgui.imwrite("detection" + num + ".jpg", img);
  	}
  }

  
  I am getting this error

  #
  # A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0xb31497dd, pid=3815, tid=2927622976
  #
  # JRE version: 6.0_27-b27
  # Java VM: OpenJDK Client VM (20.0-b12 mixed mode, sharing linux-x86 )
  # Derivative: IcedTea6 1.12.6
  # Distribution: Ubuntu 13.04, package 6b27-1.12.6-1ubuntu0.13.04.4
  # Problematic frame:
  # C  [libopencv_objdetect.so.2.4+0x357dd]  int cv::predictOrdered<cv::HaarEvaluator>(cv::CascadeClassifier&, cv::Ptr<cv::FeatureEvaluator>&, double&)+0xed
  #
  # An error report file with more information is saved as:
  # /home/saka/repositories/r_and_d/test_tgsdgdsg/hs_err_pid3815.log
  [thread -1369445568 also had an error]
  #
  # If you would like to submit a bug report, please include
  # instructions how to reproduce the bug and visit:
  #   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
  #

  This happens unconditionally as i tried to run the same code multiple
  of times (with the same input) and it works fine in some cases
  returning the correct output.

  Thanks!

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1273554/+subscriptions


Follow ups

References