3D Line Graph manipulation - winforms

I am writing software for a device that would plot a 3D graph/line plot of where someone has traveled. This plotting will be during post-processing of the data, so real time is not a requirement.
My key problem is, I can't find suitable tools or even other CAD software (eg. Autocad) which will plot a line graph (I imagine it would plot it as a 'path'?) from a data file (eg. CSV) which I can then manipulate like a CAD model (ie. move it around, rotate it to view from different angles, etc).
There is a real-time aspect to it where my computer will connect to the device at regular intervals, pull current location data, and store it. The computer will run and communicate through a Windows Forms app but only at the end do I need to plot the graph.
Would you have any suggestions on how to go about this?
Thanks in advance

So much easier than I though it would be.
Basically, generate a new file named points.scr (this is an AutoCAD script file), that contains the following:
._LINE
0,0,0
1,2,4
2,2,4
C
Run this is AutoCAD by typing "scr" into the command prompt and selecting the points.scr file.
http://forums.autodesk.com/t5/AutoCAD-2004-2005-2006/script-to-draw-line/td-p/1219015

Related

Is there a way to store either animation data or arbitrary data in a Collada file from SceneKit?

I'm building a tool to convert an old proprietary mesh+animations file format into Collada DAE files, and so I have been using SceneKit to cheat a bit and just build the geometry and run [scene writeToUrl].
I am able to build correct CABasicAnimations for all the model animations, which are basically sets of morph targets (no bone definitions exist in the original file - only mesh morph targets).
Is there a way to include SceneKit-generated CAAnimationGroup or animations in the file export? Relatedly, is there a way to write and read arbitrary information to and from the export? If I can write and read the total animation duration and the FPS rate then I can reproduce the animations on the game engine side.
All animations should be exported automatically. You can verify that they are correctly exported by opening the Collada file as a xml file. If they are not exporte correctly, then it's a good idea to file a bug.
As for arbitrary data you can maybe use tricks such as using node names to store that information.

Using video/image files in C

I'm trying to look through and find a way to annotate a video in C with polygons bounding boxes, however I'm stuck at a very elementary step.
Assuming I know how to break a .MPEG movie up into multiple JPEG images, how do I manipulate that file in C? The things I'll eventually need to draw on are text, points, and lines, but I am having a hard time figuring out how to get started with this.
If I declare:
FILE* img = fopen('foo.jpeg', 'r');
then what could I do with img? Is there a way to access certain pixels in the drawing?
What you did in your code sample is just opening a file. You didn't even read any data from it yet.
The simplest way to load an image file is to use dedicated library, such as SOIL.
If you weren't able to do it by yourself, however, I really don't think you will be able to accomplish your project goals - it is really advanced stuff you want to create, and you failed, as you already noticed, on the most basic of steps.

Robotic Navigation using Kinect

Till now I have been able to create an application where the Kinect sensor is at one place. I have used speech recognition EmguCV (open cv) and Aforge.NET to help me process an image, learn and recognize objects. It all works fine but there is always scope for improvement and I am posing some problems: [Ignore the first three I want the answer for the fourth]
The frame rate is horrible. Its like 5 fps even though it should be like 30 fps. (This is WITHOUT all the processing) My application is running fine, it gets color as well as depth frames from the camera and displays it. Still the frame rate is bad. The samples run awesome, around 25 fps. Even though I ran the exact same code from the samples it wont just budge. :-( [There is no need for code, please tell me the possible problems.]
I would like to create a little robot on which the kinect and my laptop will be mounted on. I tried using the Mindstorms Kit but the lowtorque motors dont do the trick. Please tell me how will I achieve this.
How do I supply power on board? I know that the Kinect uses 12 volts for the motor. But it gets that from an AC adapter. [I would not like to cut my cable and replace it with a 12 volt battery]
The biggest question: How in this world will it navigate. I have done A* and flood-fill algorithms. I read this paper like a thousand times and I got nothing. I have the navigation algorithm in my mind but how on earth will it localize itself? [It should not use GPS or any kind of other sensors, just its eyes i.e. the Kinect]
Helping me will be Awesome. I am a newbie so please don't expect me to know everything. I have been up on the internet for 2 weeks with no luck.
Thanks A lot!
Localisation is a tricky task, as it depends on having prior knowledge of the environment in which your robot will be placed (i.e. a map of your house). While algorithms exist for simultaneous localisation and mapping, they tend to be domain-specific and as such not applicable to the general case of placing a robot in an arbitrary location and having it map its environment autonomously.
However, if your robot does have a rough (probabilistic) idea of what its environment looks like, Monte Carlo localisation is a good choice. On a high level, it goes something like:
Firstly, the robot should make a large number of random guesses (called particles) as to where it could possibly be within its known environment.
With each update from the sensor (i.e. after the robot has moved a short distance), it adjusts the probability that each of its random guesses is correct using a statistical model of its current sensor data. This can work especially well if the robot takes 360ยบ sensor measurements, but this is not completely necessary.
This lecture by Andrew Davison at Imperial College London gives a good overview of the mathematics involved. (The rest of the course will most likely be very interesting to you as well, given what you are trying to create). Good luck!

How to save R plot image to database?

I'd like to save a plot image directly to the database.
Is the best way in R to do this:
Write the plot image (png) to the filesystem
Read the file that was written
Send the file to the database via query (RODBC)
Ideally I'd like to combine steps 1 and 2 above by simply write the png image to a binary connection. Does R support this?
No, the graphics devices are file-based, so your steps 1-3 are correct. You need a fourth to unlink the temporary file but that is about it.
If you use either lattice or ggplot, you can save the plot object (rather than the image itself) to the database (although I don't know if that meets your requirement). The benefit of that approach is that you can easily recreate/alter the image.
Instead of writing to a regular file, could you write it to a FIFO that would in turn store it in the DB? Will graphics devices write to a FIFO if it's created externally?

How can I store a video with proper indexing

How can I store a video (either in database or file system) so that instead of starting streaming from starting I can start this streaming from any fix index.
Main aim is like I have a large video of roads of New York from one end to other and corresponding map of New York save on a central server. Now a user opens up the website and selects the two points on the map of New York and video of road between those two points starts streaming, not from starting but from first point to second point given by user.
So main requirement is to store a video with its indexes such that I can start streaming from any of the index.
Edited Part :
Actually I am planning how to store video of complete city so I can show it to user whenever he selects it on map.
So Now Main question in my mind is can I merge video for all roads in one video like various linked lists (Roads). Like if there are two turns at particular point then instead of storing two videos from that point for different path can I store them in a single video such that which video you have to play will depend upon starting and ending point selected by user and shortest path between those two points, But can I store video of all roads as a single video.
How can I do this, will it depend on stream mechanism or on storage ?
Thanks,
GG
I guess that this all depends on the capability of your playing/streaming mechanism. I would find out about these before determining how to store the file and/or "index" points. Ask some specific questions about your streaming technology, such as:
can you fast forward to a certain point?
can you stop at a certain point?
can you play one stream after one ends?
another play capabilities that may help solve this?
If you can trigger the playing of your video to fast forward to a certain point, you can store the amount of time or frames to fast forward from the beginning and associate these with your map start. You would also need to "abort" the stream at a certain point, that matches your map end point.
However, if you can not fast forward your stream, you many need to break your video file into smaller segments and start at the proper one based on the map point selected. You would then need to play multiple files until you reach the end point.

Resources