Bug #1500
closedRCT feature-finding libCV error
0%
Description
We recently updated leginon on the linux workstations connected to the microscopes to:
16170
myami-2.1
/opt/qb3/myami-2.1/leginon
Now when the feature finding algorithm runs for RCT or OTR, we get this error:
============ Craig stuff ============
libcv.MatchImages failed
Bad libcv result: bad tilt in matrix: tiltang = 90.00, rotation = 0.00, shift = 0.00,0.00
Tilt libCV FAILED
libcv.FindRegions failed
Any idea what is going on?
Files
Updated by Anchi Cheng almost 13 years ago
- Assignee changed from Anchi Cheng to Gabriel Lander
Gabe,
I don't see any recent change in rct or libcv at all in branch 2.1. Are you talking about trunk? There is a change in r16069. It was done to fix the bug reported in #1291 If it is causing problem for you, we might have to revert it back. Craig wasn't able to fix the infinite loop problem with his more optimized algorithm for #1291 so he revert it to use another one that he thought safe to use. I tested it out and did not have problem with test images but I guess it does work right for you.
Please revert it back and see if it goes away. Does this happen all the time or just with some images?
Updated by Gabriel Lander almost 13 years ago
Hi Anchi,
We're running leginon from the trunk now, yes. This error happens for every image that uses Craig's feature finder, including simulated images. I'll coordinate some microscope time with our sys admin to try reverting & testing for this problem.
Updated by Anchi Cheng almost 13 years ago
- Category set to Leginon subsystem
- Assignee changed from Gabriel Lander to Anonymous
- Target version set to Appion/Leginon 2.2.0
- Affected Version changed from Appion/Leginon 2.1.0 to Appion/Leginon 2.2.0 (trunk)
Updated by Gabriel Lander almost 13 years ago
Forgot to update this - reverting back to "SeparableAffineTransform" & rerunning the setup.py fixed the problem.
Updated by Jian Shi over 11 years ago
- File RCT_libCV_failure.png RCT_libCV_failure.png added
- Affected Version changed from Appion/Leginon 2.2.0 (trunk) to Appion/Leginon 2.2.0
I am running latest r17745 for RCT, but still have the same problem. I don't understand what Gabe's solution means.
Updated by Gabriel Lander over 11 years ago
I think we had to revert to an older version of the libCV and rerun the "setup.py" script that was in that directory. My memory of this is very hazy.
Updated by Jian Shi over 11 years ago
- File libCV_err2.png libCV_err2.png added
- Assignee changed from Anonymous to Anchi Cheng
- Priority changed from High to Urgent
Hi,
I installed latest trunk, 17823, but still got the same problem.
In csfit.c, I found the line 127 also has one more 'AffineTransformImage' and I changed it also to "SeparableAffineTransform" and reinstall libCV. But still got the same problem.
BTW, the libCV is installed in /usr/lib64/python2.6/site-packages/libcv since my PC is 64bit. I don't if it matters.
THX Jian,
Updated by Anchi Cheng over 11 years ago
- Target version changed from Appion/Leginon 2.2.0 to Appion/Leginon 3.0.0
- Affected Version changed from Appion/Leginon 2.2.0 to Appion/Leginon 3.0.0
Your screen shot of the terminal running Leginon does not show the same error the original Issue has. This might not be a bug but a parameter settings issue.
Please take screen shots of RCT node during setup like the ones shown in RCT_node_set-up. It will help with diagnosis. Take the screen shot like the last one you did, with both Leginon gui and terminal where some libcv info would be printed out. Make sure your grid is at Eucentric height, too.
Updated by Anchi Cheng over 11 years ago
- Status changed from New to Assigned
- Assignee changed from Anchi Cheng to Jian Shi
Updated by Anchi Cheng over 11 years ago
One more thing,
I see that the Leginon code does not stop you if libcv is not imported. Try import it from python command line with
python import libcv libcv
The last line will give you where it is imported from. Maybe python is having problem there.
Updated by Jian Shi over 11 years ago
- File libCV_err3.png libCV_err3.png added
Python seems import libcv from right place:
<module 'libcv' from '/usr/lib64/python2.6/site-packages/libcv/__init__.pyc'>
I followed the RCT_node setup page and I got a "libcv.FindRegions failed" error. I went through the C source files in libCV module and didn't find any function named FindRegions, but only a similar one is FindMSERegions.
Updated by Anchi Cheng over 11 years ago
PyFindRegions is the function in libcv/mserpy.c
See if the following will raise the real exception;
In leginon/libCVwrapper.py, find where it has these lines:
except: print "libcv.FindRegions failed"
Have it raise the exception. Maybe the traceback there will have more informative.
Updated by Jian Shi about 11 years ago
- File RCT_libCVErr.png RCT_libCVErr.png added
- File RCT_Settings.png RCT_Settings.png added
Anchi,
I freshly install a new CentOS PC and latest version of Leginon, 17921. However I am still plagued by this libCV.MatchImages error. Can you take a look at it?
Many Thanks,
Jian
Updated by Anchi Cheng about 11 years ago
Jian,
Where is the tilt axis on your image? More horizontal or vertical?
To look at this, I will need example pair of images that failed.
Did you get any useful exception by raising it as in reply#12 ?
Updated by Jian Shi about 11 years ago
- File hl_untilt.mrc hl_untilt.mrc added
- File hl_tilt.mrc hl_tilt.mrc added
The tilt axis is horizontal in Leginon, but vertical in DM.
Attached a pair of images. I ran runlibCV.py with them, it finished and gives results
[ 4.25937500e+01 8.17187500e+00 3.90625000e-03 2.00781250e+00
7.81250000e-03 2.34375000e-02 6.25000000e-02 1.21093750e-01
3.90625000e-03 9.76562500e-02]
Total: 5.309375 +/- 12.6616438159
I also try following code:
[cbis@spirit libcv]$ python
Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import leginon.libCVwrapper
import pyami.mrc
tl = pyami.mrc.read('hl_tilt.mrc')
utl = pyami.mrc.read('hl_untilt.mrc')
result = leginon.libCVwrapper.MatchImages(tl, utl, 50, 0.8)
Image min and max are 0 402929
Image 1: keypoints: 1102; descriptors: 1657
Image min and max are 0 375920
Image 2: keypoints: 1447; descriptors: 2241
Found 482 matches between images
Found matrix that fit 20 out of the 482 matches.
Freeing all mem
1.38 0.03 0.00
-0.01 1.00 0.00
-183.59 -16.46 1.00
I put raise, or raise PublishError(e) or print e in the exception, but nothing printed out.
The MatchImages error occurs after first tilted parent image was taken. I don't understand where I did wrong.
Updated by Jian Shi about 11 years ago
The issue come out of pyami.timeproc.call, but I don't understand why there is permission issue yet:
result = pyami.timedproc.call('leginon.libCVwrapper', 'MatchImages', args=(tl, utl, 50, 0.8), timeout=300)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/pyami/timedproc.py", line 23, in call
sub = subprocess.Popen([executable, 'call'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "/usr/lib64/python2.6/subprocess.py", line 642, in init
errread, errwrite)
File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Updated by Jian Shi about 11 years ago
Hi, here is more update. I changed the mode to 755 of all py in pyami, the pyami.timedproc.call() runs OK, otherwise I got the permission error in subprocess. I got some results out leginon.libCVwrapper.MatchImages methods. Hopefully it will work also in RCT application.
result=pyami.timedproc.call('leginon.libCVwrapper', 'MatchImages',args=(tl,utl,50,0.8), timeout=300)
/usr/lib/python2.6/site-packages/pyami/timedproc.py
Image min and max are 0 1269364
Image 1: keypoints: 3104; descriptors: 6396
Image min and max are 0 1024213
Image 2: keypoints: 7232; descriptors: 16023
Found 1765 matches between images
Found matrix that fit 14 out of the 1765 matches.
Freeing all mem
-1.02 0.04 0.00
0.30 -1.15 0.00
731.99 1234.05 1.00
Updated by Anchi Cheng about 7 years ago
- Status changed from Assigned to Closed
Jian's solution worked.