Comments (3)
@1gen100 this might help: https://docs.opencv.org/master/d7/d6f/tutorial_kinect_openni.html
You may need to change the argument passed to the VideoCapture
constructor for getting the Kinect feed.
from stereo-calibration.
Hey @sourishg,
Thanks I have tried this but with no succes, I think it's because it uses OPENNI that works for Kinect V1, but not for Kinect V2.
from stereo-calibration.
I didn't have time to wait so I made this code, but it's not that good and effective.
Could you help me with this?
#!/usr/bin/python
import roslib
import rospy
import** cv2
import sys
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
class PositionTracker:
def __init__(self):
# subscribe to kinect image messages
self.sub = rospy.Subscriber("kinect2/hd/image_color", Image, self.image_callback, queue_size=1)
self.bridge = CvBridge()
def image_callback(self,data):
try:
cv_image = self.bridge.imgmsg_to_cv2(data)
except CvBridgeError as e:
print(e)
cv_image=cv2.resize(cv_image,(640,360))
cv2.imshow("Image window", cv_image)
c=cv2.waitKey(10)
#print(c)
click=0
if c ==108:
print("Insert left image num:")
click= input()
print("Saving img pair", click)
filename1 = "%sleft%d.%s" % ("../c-camera/", click, "jpg")
cv2.imwrite(filename1, cv_image)
if c ==114:
print("Insert right image num:")
click= input()
print("Saving img pair", click)
filename1 = "%sright%d.%s" % ("../c-camera/", click, "jpg")
cv2.imwrite(filename1, cv_image)
#time.sleep(3)
def main(args):
ic = PositionTracker()
rospy.init_node('kinect_tracker')
try:
rospy.spin()
except KeyboardInterrupt:
print("Shutting down")
cv2.destroyAllWindows()
if __name__ == '__main__':
main(sys.argv)
from stereo-calibration.
Related Issues (17)
- popt.h not available in Windows HOT 3
- do not use popt HOT 2
- Documentation not clear
- error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'CvtHelper' HOT 1
- Any image pair for testing? HOT 1
- Error converting BGR to GRAY HOT 2
- Question about vectors in calib_stereo.cpp
- Error when using calibration HOT 2
- calib-stereo.cpp: Use Mat for T
- calibrate two cameras with different resolutions
- Visualize checkerboard points HOT 1
- Implement stereo calibration using AprilTags HOT 2
- GUI
- Stereo calibration using user-specified correspondences
- Visualizing camera and checkerboard poses
- Statistical analysis of calibration HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stereo-calibration.