Kinect v2 Save/Load MultiSourceFrames - c#

I would like to know if there is a way to save MultiSourceFrames to disk in such a way that I can load them up to use later.
The reason for this is because I have far too much processing to do on each frame to reasonably perform this live. I have no need to process the frames in real time so, I would like to find a way to save a number of frames to disk (or even to memory?) and perform my processing afterwards.
So far, I have tried storing these in a List<MultiSourceFrame> but, for each frame, I find that I can't then acquire the ColourFrame component (for example), presumably because the whole object structure is not saved.
Potential Solution Idea?
I know that Kinect Studio is able to save .xed files but I really need to be able to do this from code. Moreover, I don't know whether I can turn the .xed file back into a collection of MultiSourceFrames.
I'd be really grateful if anyone can help me out with this problem! I promise to upvote/accept helpful answers!

You can't just save the MultiSourceFrame object. Instead, you should extract the (raw) data you need from the frames and save that.

Related

C# Working with Images - Resources or Imagepath

i am wondering, what's the best way of working with images in c#, in a wpf application.
Someone recommend to pass the path of the image to the application, and someone recommend to use resources.
In my current project i have a listview and whenever i click a button, a image will be added. I am working with a ObservableCollection and whenever i click a button, i add the path of the image to the collection.
So, whenever i start the application i run throug the folder with the images and collect the names in an array. This way i can create the complete path to the image.
After that i use a method to shuffle the array values.
I don't know exactly how i can do that with resources, because i can't access the path of the files, but i can directly access the image.
What would you recommend, using the path or resources, and how would you handle it? What's about the performance?
I searched a lot but didn't find an answer for my "problem", maybe i used the wrong keywords...
For "After that I use a method to shuffle the array values." just use some prefix or similar to root through the resources and throw whatever you need into a collection and apply your shuffling there. All you really need to track is the name. Using Resources will be more space efficient and adds a bit more safety into things.

Real time editor for Cloud Storage System

I am working on cloud storage system in ASP.Net MVC5. In which I made a file manager that handles cut,copy,download multiple files,edit and preview of files, but I want to edit documents like word files in real time (collaborative editing)..is there any api that can help me accordingly.
Thank you in advance.
you should use Signal R for real time applications...it may be possible with the help of application user interface but its better to write your own code according to your choice...
[http://signalr.net/][1]
dev_express and syncfusion may be your solution..try these..
This is turning into a huge comment, so I'll just explain my point of view in an answer. I'll remove it, if I see an actual answer appears.
I am suggesting you start writing your own code for collaborative editing and the reason is quite simple. You need at least slightly different processing for almost each file type, which suggests there will never be a single API to support collaborative editing for all file types, unless somebody makes it their goal to maintain it and keep up with every one created.
Start it simple, text (or hex) editing. Define how changes are made and implemented on other clients and then work your way to add as many file types (and methods that go with them) as you need.
You could use source code of 1 of these open source collaborative text editors (you'll have to find download / Github links on their websites) to get a general idea how to do it, but you will still have to put in some work and won't go far without creating your own code.
Collaborative editing requires user 1's (who just started editing) client to send either one of these:
Data pointing to changes made in file
Full file, and user 2's client (or central "server") should be able to calculate the changes made from there and implement them.
One of the problems is to overwrite only that portion of the file changes were made to (and avoid overwriting the other user 2's work).
And the biggest problem (the reason you can't have "1 for all" method/API) is each file type has its own structure meaning that different file types will have different data representing changes in file. If you try to write raw data it might work, but you'd still need to calculate and lock away specific portions of file, that contain general information, rather than data of your file.

Path Finding Using Building Maps

Hi everyone,
I'm working on a path finding application in C# and I've run into a problem before I even start looking into coding the path finding aspect. The application will allow a user to place a marker on the map of the building then show the user the nearest exit from that position. I have the maps of the building I need but I'm not sure if I can use them straight away as jpeg images.
Would I be able to use the maps as they are or would it be better to remake them in a grid format so its all split up into squares? I'm thinking it may be easier to code the path finding aspect if the maps were made up of squares in a grid but it may take some time to remake the maps in this format.
Any advice is greatly appreciated, I do have experience in C# but path finding is a fairly new subject to me so I'm not sure of the best format for the maps to be in.
Thanks in advance!
Well, if you can afford some manual data processing, the best way would be to simply build a graph of the aisles and store it. You can then use simple graph search algorithms to find the nearest exit. Even spliting it into a grid is an overkill.
I've used this before to build graphs of aisles and stores in commerce buildings, and it's very useful and simple to implement.

How does Gmap.net cache works?

I´m using the GMAP.net library in a project and I found it was a powerful tool. It´s cache facility made it a real profit to my project. Anyway, I need if someone can tell me a little bit of how that cache works. As far as I tested it, I can see that it pre-allocates space (in my case about 200 mb on SQLITE file), so I started doing some test seeing how it worked, and it turns out it works really well, but in some cases I have been viewing maps that haven´t been cached. I don´t know if I have to spent some time with the position on the map so It can be cached or something like that. Does the tile cache file size increases with the time?, or it just keeps the prealocated size?.
Thanks in advance for any possible answer.
I've been doing some research on this same topic. I learned that the application by default has a gmdb of 256mb. This doesnt mean that there is 256mb of cached map. It just creates room for the cache data. Look at this post by Radio man for more clarity. Hope this helps. If you find more info post if for others because there is a lot of missing info on this topic.
http://greatmaps.codeplex.com/discussions/274628

Full HTML code from iframes using webbrowser

I need get the html code this site (with C#):
http://urbs-web.curitiba.pr.gov.br/centro/defmapalinhas.asp?l=n (only works with IE8)
Using the WebClient class, or HttpWebResquest, or any other library, I do not have access to the html code generated dynamically.
So my only solution (I guess) would be to use the WebBrowser Control (WPF).
I was trying and trying, using mshtml.HTMLDocument and SHDocVw.IWebBrowser2
but it is a mess, I can not find what I want on it
it seems there are many "iframe", and inside there are more "iframe".
I do not know, I tried:
IHTMLElementCollection elcol = htmlDoc.getElementsByTagName("iframe");
var test = htmlDoc.getElementsByTagName("HTML");
var test2 = doc.all;
but had no progress, does anyone know how to help me?
Observation / trivia: This is the site that shows where all bus pass in my city. This site is horrible, and only works in IE8 has serious problems. I would like to use this information to try to create a better service, using google maps or bing maps posteriorly.
The site that I was trying to get the information is no longer available, the idea to get dynamic html source code was abandoned and I cannot found the solution using a WebBrowser Control for WPF.
I believe that today there are other ways to solve this problem.
You need to use the "Frames" object in the WebBrowser control, this object collection will return all frames and iframes if I recall correctly, and you need to look at the frames collection for each newly discovered frame you find on the page, get me? So, it’s like a recursive discovery loop that you need to run, you add each frame you find to your array or collection, and for each "unsearched" frame, you must look at that frames ".Frames" collection (they will all have a .Count etc, just a typical collection) and you do this for every newly discovered frame that you find, until of course, there are no longer any newly discovered frames that haven't had their ".Frames" collection searched.
So, the function, if done as per above, will allow for infinitely nested frames to be discovered, as I've done this in a VB6 project (I'm happy to give you the source for it if you would like it). However, the nesting is not preserved in my example, but that is ok since the nesting structure isn't important and you should figure out which was what by the order of the frames that are added to the collection since the order is related to the hierarchy of the frames being added.
Once you do that, getting the html source on this is pretty straight forward and I’m sure you know how to do, probably a .DocumentText depending on the version of the WB control you are using.
Also, you say it is not possible to use the HTTP clients to directly grab the source code? I must disagree, since once you have the frame objects, you can get the URLs from each frame object and do a URL2String type call to get the URL and turn it into a string from any httpclient-like class or framework. The only way it may be prevented on their behalf if if they accept requests only from a particular referrer (ie: the referrer must be from their domain name on some of their files etc), or the USER_AGENT where if it isn't one of the specified browsers, then it is technically possible that they will reject and not return data, unlikely but possible.
However, both referrer and user_agent can be changed in the httpclient you are using, so if they are imposing limits based on this sort of stuff, you can spoof them very easily and give them the data that they expect. Once again, this is low probability stuff, but it is possible they may have set things up this way especially if their data is proprietary.
PS: My first visit to the site ended up in IE crashing and reopening that tab :), terrible site I agree.

Categories