Closed GoogleCodeExporter closed 8 years ago
I went through the error again in detail, I summarize my progress below:
- I confirm that with the exception of find_obj.py all of the above seem to
work under Ubuntu 64-bit.
- I've attached a small patch for find_obj.py to get it to work with the latest
svn version of pyopencv
- With the mac there appear to be a few issues:
1. createTrackbar appears to be broken - this seems to be the main culprit in
the above not working.
2. VideoCapture is broken on the mac. retrieveframe (which >> is a synonym
for) always returns False and the mat argument is always empty. I'm not sure
though why capture.py segfaults.
3. capturing video from a file does seem to work.
4. with the patch to find-obj I do get some strange garbage pixels below the
upper bostoncini box that does not appear there in the C++ version of the code
I have confirmed that my installation of OpenCV is ok and that the C++ examples
that come with the OpenCV distribution work.
Original comment by aber...@gmail.com
on 24 Aug 2010 at 4:34
Forgot to attach the new version of find_obj.py. Here it is.
Original comment by aber...@gmail.com
on 24 Aug 2010 at 4:35
Attachments:
Issue 4 above with the strange garbage pixels also happens with Ubuntu so it
might be that some array is not zero-d out.
It appears that the Mac OS X and the Ubuntu version differ in that
createTrackbar and VideoCapture do not work. Could this somehow be an
endiannes issue?
Original comment by aber...@gmail.com
on 24 Aug 2010 at 5:04
Many thanks, Daniel. I will include the new version of find_obj.py once I have
tested it on my Windows box and my Ubuntu box.
VideoCapture on my Ubuntu is not working either. On Windows, I have to delete
OpenCV's ffmpeg shared library to get VideoCapture to work. I suspect the bug
has something to do with OpenCV's ffmpeg version rather than from an endianness
issue, but I have not got time to figure out. Does VideoCapture work when you
run one of the C++ examples on Ubuntu?
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 24 Aug 2010 at 5:33
Hi, abergou. Sorry I miscalled you as Daniel. :)
I have tested your new version of find_obj.py and it is working well. I have
included it in the demo package. I have also fixed the garbage pixels by
initializing the 'correspond' image with zeros.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 24 Aug 2010 at 5:41
Thanks for fixing those two issues.
As far as VideoCapture: i can open a file under both Linux and Mac without
problems with pyopencv. Using VideoCapture with a webcam doesn't work with it.
Under Mac the same webcam works fine with the c, c++, and python bindings. I
couldn't try it yet under Linux. By the way: under both Mac and Linux I don't
think opencv comes with it's own ffmpeg but instead uses the one installed on
the system.
Any idea what the problem might be with the track bar?
Thanks very much:
Attila
Thanks:
Attila
Original comment by aber...@gmail.com
on 24 Aug 2010 at 5:56
Thanks for the update, Attila. So the VideoCapture problem I am facing must
come from my own system. I am not too sure about the track bar problem yet
because the track bar is working on both my Windows box and my 32-bit Ubuntu
box. I will test it on my 64-bit Ubuntu box when I get to my office today.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 24 Aug 2010 at 6:07
I have a fix for createTrackbar: the problem actually can affect linux as
well, not only Mac OS X and is related to a 32-bit vs. 64-bit issue.
The problem occurs in highgui_ext.main.cpp and is due to the int * being cast
to an unsigned int. To be 64-bit compatible the cast should be to a unsigned
long. Attached is a patch file to highgui_ext.main.cpp, which I've verified
fixes createTaskbar under Mac OS X (and should also fix it under 64-bit linux -
though it does happen to work there most of the time due to the address space
being different).
Original comment by aber...@gmail.com
on 25 Aug 2010 at 3:26
Attachments:
Update on this issue:
With the patch in comment 8, all examples work under mac os x with the webcam
is not used.
Accessing the webcam through VideoCapture still fails - not sure why this
happens.
Original comment by aber...@gmail.com
on 25 Aug 2010 at 3:35
Many thanks, Attila. I've updated your patch for the createTrackbar issue.
Also, instead of casting the pointer to 'unsigned long', I cast it to
'Py_intptr_t', which is of the same size as 'void *' for every platform.
I will try to analyse the issue with accessing the webcam through VideoCapture
later today on my 64-bit Ubuntu platform.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 25 Aug 2010 at 6:44
Hi Attila,
I've tested accessing my Logitech webcam through VideoCapture on my 64-bit
Ubuntu platform. It works.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 25 Aug 2010 at 12:31
Hi Minh-Tri,
Thanks for testing it. I went back and it turns out that this is not a bug in
pyopencv - it is in fact a known bug in the OpenCV C++ bindings for the mac.
It does not affect the c and (defult) python bindings strangely enough. In any
case it is corrected in the svn version of OpenCV.
So I can officially say that pyopencv now works on the mac (as well as opencv
itself allows it to). So this issue can be closed (and you can update your FAQ
to say that it also has been tested under Mac OS X 10.6.
Thanks for all the work - these bindings are going to be super useful. I hope
they get adopted as the default.
Attila
PS. Not sure if you've looked at Opencv SVN, but it looks like a lot of stuff
is getting added to it!
Original comment by aber...@gmail.com
on 25 Aug 2010 at 3:55
Hi Attila,
Thank you for your time in testing and fixing PyOpenCV on Mac and on Ubuntu as
well. Your help is greatly appreciated.
Meanwhile, I will try to fix the 'ldconfig' issue and other minor matters
before announcing a release.
I haven't got time to look at OpenCV SVN. But I believe OpenCV 2.1.1 will be
released soon. In the past, it only took me a few days to migrate PyOpenCV from
OpenCV 2.0 to OpenCV 2.1. I just want to wait for a sufficiently stable
version/snapshot of OpenCV before doing the migration.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 25 Aug 2010 at 7:34
Glad to help out!
I'll also take a look at the ldconfig issue, but am going to be busy for the
next few days.
As an aside for anyone who comes across this thread - the patch found at
https://code.ros.org/trac/opencv/changeset/3018#file2 fixes the issue with
camera capture using the c++ interface. Once opencv is recompiled with this
patch in place all the demos work under mac os x as well.
Original comment by aber...@gmail.com
on 25 Aug 2010 at 7:55
Original issue reported on code.google.com by
aber...@gmail.com
on 20 Aug 2010 at 6:54