kallyani1989 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

cvDrawChessboardCorners : EXCEPTION_ACCESS_VIOLATION on opencv_calib3d231.dll #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load an image containing chessboard
2. Compute chessboard extraction
3. Use cvDrawChessboardCorners to add found points to image

What is the expected output? What do you see instead?
Expected output is a valid image with color cross at corner point.
Instead, program crashed with fatal error.

What version of the product are you using? On what operating system?
Running OpenCV 2.3.1 with JavaCV 2011 10 01 on Windows 7 32 bits.

Please provide any additional information below.

Code used :

IplImage image = IplImage.createFrom(ToBufferedImage(data.getImage()));
CvPoint2D32f p = new CvPoint2D32f();
int [] res = {0};
CvSize patternsize = cvSize(7, 7);
int found = cvFindChessboardCorners(image, patternsize, p, res, 
CV_CALIB_CB_NORMALIZE_IMAGE);
cvDrawChessboardCorners(image, patternsize, p, res[0], found);  
CanvasFrame cvFr = new CanvasFrame("N/A");
cvFr.showImage(image);

Error given :

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x63417967, pid=4284, tid=1112
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode windows-x86 )
# Problematic frame:
# C  [opencv_calib3d231.dll+0x7967]
#
# An error report file with more information is saved as:
# C:\Users\********\workspace\*********\hs_err_pid4284.log
#
# If you would like to submit a bug report, ...

Log file is avaible in attachment.

Hope, this will help.

Original issue reported on code.google.com by jc.dev...@gmail.com on 10 Oct 2011 at 8:35

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ok, my mistake.
This not an issue : CvPoint2D32f p hasn't the right size.

Perhaps it should be usefull to have more security to prevent fatal error.
I know you're using C version of openCV but... Java is supposed to work with 
exceptions.

Thank you for your work !
JC Devaux.

Original comment by jc.dev...@gmail.com on 10 Oct 2011 at 1:40

GoogleCodeExporter commented 8 years ago
Right, but it would require a complete rehaul of the whole API, and it would 
not look very much like OpenCV anymore either... the C++ API of OpenCV works 
with std::vector and such to allocate memory, but that is not very Java 
friendly either...

Original comment by samuel.a...@gmail.com on 19 Oct 2011 at 3:09