importing installed python module x.features2d from Opencv
<p>I have installed Opencv3 module on my Ubuntu 14.04 system and the installation of sub-modules done without problem. But when I called x.features2d in my code after importing cv2, as shown in the code below</p>

<pre><code>import sys
import cv2
import cv2.xfeatures2d
import numpy as np
sys.path.append('/usr/local/lib/python2.7/site-packages')
img_bgr=cv2.imread('sc2.png')
img_gray=cv2.cvtColor(img_bgr,cv2.COLOR_BGR2GRAY)
template=cv2.imread('template.png',0)
w, h=template.shape[::-1]
res=cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
threshold=0.7
loc = np.where(res &gt;= threshold)
for pt in zip(*loc[::-1]):
 cv2.rectangle(img_bgr, pt, (pt[0]+w, pt[1]+h), (0,255,0), 2)
freakExtractor=cv2.xfeatures2d.FREAK_create()
keypoints,descriptors=freakExtractor.compute(img_bgr,keypoints)
cv2.imshow('detected', img_bgr)
cv2.waitKey(0)
</code></pre>

<p>it gives me the error of not being able to find x.features2d module as below</p>

<pre><code>Traceback (most recent call last):
File "test.py", line 3, in &lt;module&gt;
import cv2.xfeatures2d
ImportError: No module named xfeatures2d
</code></pre>

<p>I tried to re-install it again and also installed opencv-contrib, but same problem happened. 
Any idea to solve it?</p>