Open GoogleCodeExporter opened 9 years ago
Could provide a source file with a `main()` method that I could run here to try
it out? thanks
Original comment by samuel.a...@gmail.com
on 11 Oct 2012 at 9:32
Sure thing Samuel, here you go.
In my own application the callable, and the image operation (loading and
saving) are in their own classes, but for ease of use for you I have rewritten
it so that you have it in one file.
I ran the attached file, and it gives the same error.
I will also mention that its not consistently the first file it breaks on, but
sometimes 2 files or even 3.
Original comment by Stegger....@gmail.com
on 11 Oct 2012 at 9:58
Attachments:
Ah, I think I see what the problem is. The issue doesn't come up on my machine
running Linux, but opencv_highgui doesn't try to protect with a mutex or
something the initialization routines of libtiff here:
http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules
/highgui/src/grfmt_tiff.cpp#L61
We should be able to work around that by calling cvLoadImage() once before
trying to use it in multiple threads simultaneously. Does that do the trick for
your app?
Original comment by samuel.a...@gmail.com
on 11 Oct 2012 at 1:21
No not really, in fact it introduced this at the beginning (Maybe on the
cvLoadImage() before i start threading):
OpenCV Error: Insufficient memory (Failed to allocate 52838420 bytes) in
unknown function, file ..\..\..\src\opencv\modules\core\src\alloc.cpp, line 52
Do you know if this problem also appears on freebsd servers, cause that's where
we intent to run the application?
Original comment by Stegger....@gmail.com
on 11 Oct 2012 at 7:51
Failed to allocate 52 megs? That looks like a Windows problem, doesn't it? BTW,
you should add cvReleaseImage() somewhere in your code to free up some memory
at some point. Maybe that's the problem...
Original comment by samuel.a...@gmail.com
on 12 Oct 2012 at 1:17
Hi Samuel.
I tried running the original project on an Ubuntu installation, and just as
you, I did not have any issues. So I will not be diving more into this issue as
the software is not intended to run on a Windows installation.
Another thing, I would like to give you a personal thanks because of the great
work your doing with javacv. It's very much appreciated.
Original comment by Stegger....@gmail.com
on 12 Oct 2012 at 11:32
BTW, do you know if it behaves like that outside of Java as well, using OpenCV
from native C/C++?
Sure, you're welcome!
Original comment by samuel.a...@gmail.com
on 5 Nov 2012 at 11:43
Hi Samuel
I haven't tried to do any multithreading with OpenCV from native C/C++. I
intend to perform the operations on a lot of images, on a pretty fast server.
So Java's concurrency library came in very handy and really eases up the
development.
So sorry, can't help you there. But my gut feeling tells me that this is simply
Windows beeing a pain :-) and that it would not be an issue in native C/C++.
Original comment by Stegger....@gmail.com
on 5 Nov 2012 at 6:38
Issue 329 has been merged into this issue.
Original comment by samuel.a...@gmail.com
on 18 Jun 2013 at 1:39
BTW, can anyone check if that's been fixed with recent versions of OpenCV?
And if the problem still exist, we should report it upstream. Thanks!
Original comment by samuel.a...@gmail.com
on 29 Apr 2014 at 12:45
Original issue reported on code.google.com by
Stegger....@gmail.com
on 11 Oct 2012 at 7:56