Ask Your Question
0

Record/Store constant refreshing coordinates points into notepad

asked 2012-07-16 20:41:33 -0600

Colin gravatar image

Hi all!

i would like to thank whoever that read this thread first! :D

Let's go into details...

i have done all tracking purposes for my project, thresholding, canny, getting my center coordinates for my tracking object. But there is one big hurdle that i am facing for a long period of time, it is how do you Record those constantly refreshing points into note pad?

i have tried, ostream. but my output has only one coordinate! not more. is there any way i can constantly record the ever changing of coordinates point?

Thanks a lot! Regards Colin

edit retag flag offensive close merge delete

Comments

1

What do you mean by notepad? Do you want to see some output on a console window? Or do you want to create a text file? Are you aware of the FileStorage:http://docs.opencv.org/modules/core/doc/xmlyamlpersistence.html?highlight=filestorage#FileStorage ?

Kirill Kornyakov gravatar imageKirill Kornyakov ( 2012-07-17 02:23:44 -0600 )edit

i am aware of filestorage. what i mean by notepad is textfiles. i know how to create a textfile, but what i am facing is that i only can write out the latest coordinate point.

okay, an overview of my project.

currently i am doing this project to track and analyst the step size of physically handicapped patients. i have completed all steps, now at my final phase. which is to store ALL data. but with ostream or even filestorage, i can only manage to store the latest coordinate. Do you have any solution?

thank you!

Colin gravatar imageColin ( 2012-07-17 20:02:52 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-07-18 02:34:52 -0600

Kirill Kornyakov gravatar image

updated 2012-07-18 02:35:46 -0600

Sorry if I still don't understand your problem, but here is what I usually do. You create an std::vector (or several) of required type and push_back there measurements from every iteration. Then, when you have significant amount of data (i.e. 1000 measurements), you can dump it to the filesystem. C++ provides you with several ways to do so.

You can even try to keep ALL data in the memory till the very end, if its size is small. But usually it is better to dump it periodically. You simply open a text file, append your data to the end, then close it until you have another potion.

edit flag offensive delete link more

Comments

Yes, i guess that somehow he is always rewriting the file, instead of appending.

Rui Marques gravatar imageRui Marques ( 2012-07-18 04:22:45 -0600 )edit

Question Tools

Stats

Asked: 2012-07-16 20:41:33 -0600

Seen: 3,229 times

Last updated: Jul 18 '12