Perl 6 - the future is here, just unevenly distributed

IRC log for #openframeworks, 2015-03-24

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:03 tedesco joined #openframeworks
01:27 nononono joined #openframeworks
01:29 ar_tama joined #openframeworks
01:30 admsyn joined #openframeworks
01:30 ar_tama joined #openframeworks
01:39 pizthewiz joined #openframeworks
02:01 ar_tama_ joined #openframeworks
02:26 marcocanc joined #openframeworks
06:20 notjosh joined #openframeworks
07:13 yandil joined #openframeworks
07:33 Beliq joined #openframeworks
08:30 notjosh joined #openframeworks
08:44 Beliq joined #openframeworks
08:54 mhashmi joined #openframeworks
09:13 notjosh joined #openframeworks
09:36 notjosh joined #openframeworks
11:49 sebllll_ joined #openframeworks
12:08 Sembei joined #openframeworks
13:03 Beliq joined #openframeworks
14:15 ar_tama joined #openframeworks
14:43 reqshark_ joined #openframeworks
14:54 Beliq joined #openframeworks
15:13 admsyn joined #openframeworks
15:16 reqshark joined #openframeworks
15:37 mhashmi joined #openframeworks
15:56 reqshark joined #openframeworks
16:50 tantalum joined #openframeworks
16:55 notjosh joined #openframeworks
17:06 reqshark_ joined #openframeworks
17:07 notjosh joined #openframeworks
17:12 GuidovanPossum joined #openframeworks
17:14 GuidovanPossum joined #openframeworks
17:15 GuidovanPossum joined #openframeworks
17:36 HarryHaaren joined #openframeworks
17:39 cbtriplec joined #openframeworks
17:40 cbtriplec Anyone around that can help me with a mesh.draw() problem?
17:47 jacres cbtriplec: sure, what's going on?
17:48 cbtriplec hey, thanks!  we are using ofMesh to display a point cloud that is captured by the KinectV2 camera.  The problem we are having is that way to many points are being displayed and we are getting a very very slow frame rate
17:49 cbtriplec Is there a way to skip points in the mesh - say every second point and just display those?
17:50 HarryHaaren yep, "remove duplicates" is the term you're looking for IIRC
17:50 HarryHaaren cbtriplec, more specifically ofMesh::mergeDuplicateVertices()
17:51 jacres cbtriplec: if there's too many points, the best thing to do is to reduce the number of points before drawing.. How are the points generated?
17:51 jacres which KinectV2 addon are you using?
17:52 cbtriplec we are using 'ofxKinectForWindows2' (@elliotwoods) right now.  I will try the mergeDuplicateVertices() but i dont think they would be duplicates as they are all unique. Would this still work?
17:53 cbtriplec Points are being generated by - mesh = kinect.getDepthSource()->getMesh(true, ofxKinectForWindows2::Source::Depth::PointClo​udOptions::TextureCoordinates::ColorCamera);
17:55 reqshark joined #openframeworks
17:58 cbtriplec jacres: Another thing we could do that might help would be to delete mesh points with values less than X value.  Only showing vertices that are being picked up by the camera between a specific area.  You think that might help?
18:03 cbtriplec HarryHaaren: looks like ofMesh::mergeDuplicateVertices() doesn't really help.  the Vertices are not duplicates - we just have to many :-(
18:04 HarryHaaren cbtriplec, ah ok. In that case you want to look at removing "similar" rather than duplicate. I don't think the ofMesh class has a function for that...
18:05 HarryHaaren are you re-building the point-cloud per frame? Or is it OK to take some time to loop through each vertex?
18:06 cbtriplec HarryHaren: We are taking it at each frame.  Do you know of a way we can just removed every second vertix (or mesh point)?
18:08 HarryHaaren yeah sure, you can use ofMesh::removeVertex()
18:08 HarryHaaren I don't know if that's going to be faster than drawing it...
18:09 HarryHaaren you could build a new mesh using each 2nd vertex of the original.. depending on how the internals of ofMesh::addVertex() are implemented, it might be possible to make that faster..
18:09 HarryHaaren look at http://openframeworks.cc/documentat​ion/3d/ofMesh.html#show_addVertices
18:10 cbtriplec mmmm... worth a try.  Thank you!
18:10 HarryHaaren cbtriplec, are you a techie coder? There's some optimizations you can achieve with the ofMesh::addVertices() call, like calling reserve() to allocate enough space for the array
18:11 HarryHaaren vector<ofVec3f> array;    array.reserve( 100000 );   // array allocates space for 100000 ofVec3f's at once, saves lots of time
18:12 HarryHaaren then "build" the mesh inside that array in a loop like so:    array[i] = kinectVertexVector[i*2];
18:12 HarryHaaren to skip by every 2nd vertex
18:12 HarryHaaren cbtriplec, something like above should work...
18:14 cbtriplec HarryHaaren: not a techie at all... :-(
18:14 cbtriplec we had something like this implemented before with V1 camera: for (int y = 10; y < h; y += step) { for (int x = 10; x < w; x += step) { if (kinect.getDistanceAt(x, y) > 0) { mesh.addColor(kinect.getColorAt(x, y)); mesh.addVertex(kinect.getWorldCoordinateAt(x, y)); } } }
18:14 cbtriplec the step would be the skip count for drawing, and then just mesh.draw would be called.
18:15 cbtriplec that make any sense?
18:15 cbtriplec I'll look into removeVertex() and see how it goes first.
18:16 HarryHaaren cbtriplec, no no, stick with generating only the vertexes you want
18:16 HarryHaaren this is a much better approach
18:16 HarryHaaren than generating way too much, and then trying to reduce
18:17 cbtriplec ok ok, totally agree.
18:18 HarryHaaren addVertex() and addColour() are a bit expensive for each frame, ideally you want to limit the total number of vertexs to use, and then re-use the same mesh, using "setColor()" and "setVertex()" instead of addColor() / addVertex()
18:22 shichan joined #openframeworks
18:26 cbtriplec We aren't really sure how to limit the vertices that are being read in by the Kinetic.  the getmesh command is being called all at once by - ofMesh Depth::getMesh(bool stitchFaces, PointCloudOptions::TextureCoordinates textureCoordinates) { return this->getMesh(PointCloudOptions(stitchFaces, textureCoordinates));
18:31 HarryHaaren cbtriplec, tag my nick :) in the loop you pasted above, you can add a condition that only adds a point to the mesh if less than X points are generated so far
18:33 HarryHaaren cbtriplec, something like this perhaps https://gist.github.com/harr​yhaaren/8e85ee4d1663360f27b2
18:33 HarryHaaren up to 10000 points will be generated, after that it won't add more points to the mesh
18:34 cbtriplec HarryHarren: doing that will only generate a mesh from the top left downwards until the limit has been reached wont it?
18:34 HarryHaaren it will most-likely disregard the vertexes lower on the screen - depending on how many you have in total. If there's < 10000, the code won't have any real effect
18:34 HarryHaaren yes
18:35 cbtriplec Harry Haaren: Running the code form the link will only work with V1 Kinect.  there is no getColorAt or getWorldCoordinateAt with V2 ofxKinectforWindwos
18:36 HarryHaaren ah ok, i'm not on windows so I don't know about that - you'll have to contact the author of the Addon or somebody else who knows about it
18:37 cbtriplec HarryHaaren: ok, appreciate your help so far.  Thanks!
18:37 HarryHaaren cbtriplec, the other option is to generate the mesh as you are now, and build a new mesh a concept as follows:
18:38 HarryHaaren 1: get number of vertexs in total   2: create a "step" for how many vertexs to skip for each vertex in the new smaller mesh   3: loop over the kinect mesh, adding only every "step"-th vertex to the new mesh
18:40 cbtriplec would the number of vertices in the mesh just be the length of the mesh? its a vector correct of XYZ no? is there an easy way to get the total number?
18:40 cbtriplec HarryHarren : sorry keep forgetting your nick
18:42 HarryHaaren cbtriplec, hitting the "tab" key will probably auto-complete it ;)
18:43 HarryHaaren yeah there's http://openframeworks.cc/documentatio​n/3d/ofMesh.html#show_getNumVertices
18:43 cbtriplec HarryHaaren: sounds thanks again!  sorry for being a newb. :-)
18:44 HarryHaaren y/w, and not at all - everybody was noob once.
18:53 cbtriplec HarryHaaren: yikes.. we have 217000 points...
18:54 HarryHaaren cbtriplec, hehe, what resolution does the kinect have...? Sounds like you're generating a point for every pixel ;)
18:54 HarryHaaren or about every 2 out of 3 pixels at 640*480
18:55 jedahan joined #openframeworks
18:55 cbtriplec HarryHaaren ya... 1920×1080 for camrea and 512×424 depth stream.
18:56 HarryHaaren hmmm, not every pixel then. Still, increase the threshold for adding a vertex
19:03 jedahan so I want to have a couple of hundred vertices, and move them each in some separate vector v every frame....what better data structure / methods should I be using over something like 'myMesh.set(i, myMesh.get(i)+ofPoint(ofRandom(10)-​5,ofRandom(10)-5,ofRandom(10)-5))'
19:06 HarryHaaren jedahan, is that approach not working, or what is the problem?
19:06 jedahan Yeah the meshes never update
19:06 jedahan i'm seeing if maybe i need to flag that they changed somewhere for draw() to do something different
19:06 jedahan or if I should be using pointers somewhere i'm not..
19:09 HarryHaaren jedahan, this works here: https://gist.github.com/harr​yhaaren/c356072cbfbddab7d71c
19:09 HarryHaaren not that this is *not* optimized at all, with multiple calls to mesh.getVertices().at(i), which is not ideal
19:11 jedahan yeah i mean I would rather just use a shader but had a bit of trouble with that so i'm sticking with what I know for right now
19:11 jedahan i'll try that style
19:15 HarryHaaren jedahan, you on OsX? I encountered a strange bug that this non-optimized version worked fine, but using a reference to the vertices (using mesh.getVertices() ) and then modifying those didn't work...
19:15 jedahan why yes i am on osx
19:15 HarryHaaren osX 10.8.something IIRC. They're not my computers, so I'm not 100%
19:15 HarryHaaren 10.9 has some weird XCode things in debug mode, "THREAD_BAD_EXEC" errors, but that don't actually exist.
19:16 jedahan I am not using xcode though
19:16 jedahan just makefiles and neovim
19:16 HarryHaaren again - I'm on Linux, and it all works happyily here
19:16 HarryHaaren ah nice
19:16 jedahan yeah i am dual booting - this needs to be on osx because I couldn't get the libfreenect to recognize my kinect :(((((
19:16 HarryHaaren try the "brute force" approach and see if it works there
19:16 HarryHaaren oh, i've had that working before.. bit of hassle to setup though I agree
19:17 HarryHaaren I used the OpenNI driver for it too after a while
19:17 jedahan yeah I probably should have gone with OpenNI since i am rewriting a lot of silly things
19:17 jedahan like a worse hand-tracker, and a worse gesture recognizer
19:17 jedahan :-p
19:17 HarryHaaren ouch... yeah, or use OpenCV or something
19:18 jedahan well I am using ofxOpenCV to pull out a blob from the depth image, and just assuming its a hand
19:18 reqshark_ joined #openframeworks
19:19 cbtriplec jedahan: you using V1 or V2?  if your are using V1 did you update the kinect drivers on windows?
19:19 jedahan but the image is so noisy, that I had to ofLerp the centroid to make it act as a mouse
19:19 jedahan V1, haven't plugged it into windows or an xbox
19:19 jedahan it works in OSX which is weird
19:19 jedahan i hink its just my distro being a bit too bare-bones sometimes
19:23 HarryHaaren jedahan, which distro? Also, if the correct libs are installed (and udev rules in this case) it (should|could|will) work
19:23 * HarryHaaren is Arch user, and loves it. Barebones, yes certainly. Works? that too :)
19:24 jedahan hmm HarryHaaren that style still isn't working for me ... https://github.com/jedahan/kinectFirewo​rks/blob/master/src/ofApp.cpp#L123-L132
19:25 jedahan HarryHaaren http://exherbo.org ... dmesg shows the correct xbox identifier strings (AFAIK), and libfreenect tries to open it, but says theres no data being sent and after 5 retries just closes the attempted connection
19:25 HarryHaaren jedahan, nice, kinda like NixOS?
19:26 jedahan very similar
19:26 HarryHaaren i like the deterministic element of these distros. Its something I'll play with in future
19:26 HarryHaaren there's a demo of NixOS at the Linux Audio Conference soon, i'll be attending and perhaps toy with it then
19:26 HarryHaaren (and this  :)
19:26 jedahan yeah i'd say nixos is almost definitely more deterministic than exherbo
19:26 jedahan at least when i tried it a few years ago
19:27 jedahan but exherbo had more packages and I was more comfortable with
19:27 jedahan I actually have a package for openFrameworks in the exherbo repositories but its really hacky
19:27 cbtriplec jedahan: drivers come with the ofxKinect addon - if you update your drivers to the ones they have provided it should work.
19:27 jedahan ahh cool cbtriplec I'll try that!
19:40 pizthewiz joined #openframeworks
19:42 Beliq joined #openframeworks
19:47 reqshark_ joined #openframeworks
19:47 reqshark_ joined #openframeworks
20:28 reqshark__ joined #openframeworks
20:47 cbtriplec joined #openframeworks
20:48 cbtriplec HarryHaaren: one more question for you :-) How do i access an index of a mesh? i'm trying to remove every 2nd vertex using removeVertex().  Am i able to do this in a for loop?
20:59 jvcleave joined #openframeworks
21:09 sebllll_ left #openframeworks
21:14 jedahan joined #openframeworks
21:19 HarryHaaren cbtriplec, hey just back - visitors, g2g again soon. Yes, when you removeVertex( 1 ), the 2nd vertex in the array gets removed. Result is that vertex that was the 3rd is now the 2nd.
21:20 cbtriplec HarrryHaaren: perfect.  thanks again!
21:22 HarryHaaren cbtriplec, https://gist.github.com/harr​yhaaren/e811022b9fd940fb4ab0
21:22 HarryHaaren explained there
21:22 HarryHaaren laters!
21:22 * HarryHaaren away
21:27 cbtriplec HarryHaaren: your awesome!
21:37 lukaszw joined #openframeworks
21:40 allartburns joined #openframeworks
23:12 reqshark__ joined #openframeworks
23:20 admsyn joined #openframeworks
23:27 wjf joined #openframeworks
23:34 lukaszw joined #openframeworks

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary