mdyusuf000 / javacv

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

opencv_core$IplImage.create error when creating cvSize structure. #280

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. The problem does not happen consistently. The steps to reproduce the problem 
are not known.

below is stack trace from Java Console:
at com.googlecode.javacv.cpp.opencv_core.cvReleaseImage(Native Method)
at 
com.googlecode.javacv.cpp.opencv_core$IplImage$ReleaseDeallocator.deallocate(ope
ncv_core.java:544)
at com.googlecode.javacpp.Pointer$DeallocatorReference.clear(Pointer.java:157)
at com.googlecode.javacpp.Pointer.deallocateReferences(Pointer.java:166)
at com.googlecode.javacpp.Pointer.deallocator(Pointer.java:217)
at com.googlecode.javacpp.Pointer.init(Pointer.java:87)
at com.googlecode.javacv.cpp.opencv_core$CvSize.allocate(Native Method)
at com.googlecode.javacv.cpp.opencv_core$CvSize.<init>(opencv_core.java:2537)
at com.googlecode.javacv.cpp.opencv_core.cvSize(opencv_core.java:2571)
at com.googlecode.javacv.cpp.opencv_core$IplImage.create(opencv_core.java:419)
at 
com.uprr.mech.tim.utils.OpenCvHelper.getImg_UPK12UC1_to_8UC1(OpenCvHelper.java:9
2)
at com.uprr.mech.tim.utils.OpenCvHelper.<init>(OpenCvHelper.java:179)
at 
com.uprr.mech.tim.business.ImageRequestProcessor.<init>(ImageRequestProcessor.ja
va:29)

What is the expected output? What do you see instead?
This is part of a program that reads raw gray image pixel bytes from a large 
image and creates a .jpg image to the requested portion of the large image. For 
example say the large image has width 208000 (scan lines) and height is 2048, 
the ImageRequestProcessor takes the ImageData ( raw pixel data) and create a 
IplImage and does some operations like resize/scale and returns the image in 
.jpg encoded form.

What version of the product are you using? On what operating system?
JavaCV 0.2 and OpenCV 2.4.3 on Redhat Linux. The code seems to be working for 
some requests and fails with some requests and then works for some again. Some 
times the code also crashes JVM and from core we can only tell the process 
cored because of SIGABRT no symbols on core.

Note same problem appeared when tried with JavaCV 0.3 with version OpenCV 2.4.3 
on Linux.
Same problem appeared with JavaCV 0.2 and OpenCV 2.4.2 on windows 7 64-bit too.

java.lang.RuntimeException: 
/privdir/isig030/OpenCV-2.4.3/modules/core/src/array.cpp:996: error: (-5) 
unrecognized or unsupported array type in function cvReleaseData

        at com.googlecode.javacv.cpp.opencv_core.cvReleaseImage(Native Method)
        at com.googlecode.javacv.cpp.opencv_core$IplImage$ReleaseDeallocator.deallocate(opencv_core.java:550)
        at com.googlecode.javacpp.Pointer$DeallocatorReference.clear(Pointer.java:193)
        at com.googlecode.javacpp.Pointer.deallocateReferences(Pointer.java:202)
        at com.googlecode.javacpp.Pointer.deallocator(Pointer.java:253)
        at com.googlecode.javacpp.Pointer.init(Pointer.java:78)
        at com.googlecode.javacv.cpp.opencv_core$CvSize.allocate(Native Method)
        at com.googlecode.javacv.cpp.opencv_core$CvSize.<init>(opencv_core.java:2561)
        at com.googlecode.javacv.cpp.opencv_core.cvSize(opencv_core.java:2598)
        at com.googlecode.javacv.cpp.opencv_core$IplImage.create(opencv_core.java:425)
        at com.uprr.mech.tim.utils.OpenCvHelper.getImg_UPK12UC1_to_8UC1(OpenCvHelper.java:98)
        at com.uprr.mech.tim.utils.OpenCvHelper.<init>(OpenCvHelper.java:187)
        at com.uprr.mech.tim.business.ImageRequestProcessor.<init>(ImageRequestProcessor.java:29)
        at com.uprr.mech.tim.controller.ImageRequestHandler.handleRequest(ImageRequestHandler.java:67)
        at com.uprr.mech.tim.controller.ImageRequestListener.onMessage(ImageRequestListener.java:59)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
        at java.lang.Thread.run(Thread.java:722)

Please provide any additional information below.
Attached file wraps all the JavaCV calls used.

Original issue reported on code.google.com by srihari....@gmail.com on 14 Feb 2013 at 8:49

Attachments:

GoogleCodeExporter commented 9 years ago
As mentioned in the README.txt file, you shouldn't call `cvReleaseImage()` on 
images allocated with `IplImage.create()`. Does that fix the issue?

If you have other questions, please ask on the mailing list if possible, thank 
you!

Original comment by samuel.a...@gmail.com on 17 Feb 2013 at 12:51