Ask Your Question
0

image tracking node python

asked 2018-09-12 10:39:45 -0500

Spyros gravatar image

I am using Ubuntu 16.04, ROS Kinetic and Python 2.7.12. I want to run a complicated code in python, which can read an avi document frame by frame, apply some filters, and export three csv documents and one new avi document. I am new in ROS and I am not sure how exactly is going to be. Can I make it only by creating a publisher node in Python? Do I have to publish in a different topic in the same node, for every different type of my data? (for example avi anf csv documents) Any possible solution or a guideline would be appreciated.

edit retag flag offensive close merge delete

Comments

1

If you are just reading and writing to avi and csv, why do you need ROS ?

Choco93 gravatar image Choco93  ( 2018-09-13 01:54:06 -0500 )edit

This will be a part of a bigger project, which will combine different applications controlled under a common platform (ROS)

Spyros gravatar image Spyros  ( 2018-09-13 06:45:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-13 07:04:16 -0500

You'll want to use OpenCV for reading the video, processing it and writing the new video to a file. This can be integrated well with ROS later because it has very close integration with OpenCV.

If you want to store the output of your code in files then you do not want to use any ROS publishers or ROS at all, they would simply publish data to other nodes not store it in specific file types.

These tutorials show you how to read and save a video file. Weather this works with your AVI file will depend on the exact video codec used.

If you're using numpy to process arrays then you can save the CSV files simply using the numpy.savetxt function as below

numpy.savetxt('myfile.csv', my_numpy_array, delimiter=',')

Hope this gets you started.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-12 10:39:45 -0500

Seen: 111 times

Last updated: Sep 13 '18