Perl 6 - the future is here, just unevenly distributed

IRC log for #openframeworks, 2014-07-23

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

All times shown according to UTC.

Time Nick Message
00:00 admsyn but it gets the "lib" folder now, basically :)
00:00 kylemcd ahh nice
00:00 admsyn it really is those 2 things I'm 99% sure
00:00 kylemcd i didn’t know about the compile as objective-c++ thing
00:00 admsyn yeah it's a little obscure because you need to select the file and open up the right-hand-side bar and set the language manually for that file
00:01 admsyn because it's a .cpp
00:01 kylemcd riight.. ok i’ll leave a note and hopefilly i can add more instructions to the readme soon
00:01 admsyn also kylemcd I forget if this is codified somewhere, but a PR with a +1 is basically good to merge right?
00:01 kylemcd thanks adam :)
00:01 admsyn specifically -> https://github.com/openframeworks/openFrameworks/pull/2919
00:01 admsyn np
00:02 kylemcd a +1 and >2 weeks is ok to merge
00:02 kylemcd (TAZ has 2 weeks to say something and then you’re free to just go ahead anyway)
00:02 admsyn ah right I knew there was another clause :)
00:02 kylemcd so yeah go for it!
00:03 kylemcd this is the complete set of rules https://github.com/openframeworks/openFrameworks/wiki/Pull-Request-Review-Procedure
00:03 kylemcd but the truth of course is that OF is flexible and it’s just a guideline
00:06 kylemcd ok, back to old issues and old emails… doing summer cleaning of my inbox :)
00:06 kylemcd have a great evening!
00:06 admsyn nice :)
00:06 admsyn you too
00:25 squirrelfiend joined #openframeworks
00:30 squirrelfiend Hi, I'm trying to make some simple interactive audio/visual applications using OpenFrameworks for iOS. I have the code working, but there's pretty serious aliasing on the circles that I'm creating. I tried to use setGlutDisplayString to solve the issue, but I was met with errors. My source code is here (although it might not be the prettiest): https://github.com/alexandertape/minimalisticCircles . Any help would be appr
00:36 jekyllRo joined #openframeworks
00:45 gabrielstuff joined #openframeworks
00:45 gabrielstuff joined #openframeworks
00:48 admsyn hey squirrelfiend
00:49 squirrelfiend Hello.
00:51 admsyn just checking out your repo now, I don't remember off the top of my head but I think you might have to explicitly enable retina or set a bigger resolution in your main.m
00:51 admsyn sort of unrelated, but a circle resolution of 400 is probably overkill
00:53 jekyllRo joined #openframeworks
00:53 pizthewiz Another option is to use something like ShivaVG/NanoVG
00:53 squirrelfiend haha, I thought it was overkill, I actually tried that to see if it could fix anything (I'm new to open frameworks, did some stuff with Processing before, and was kinda just winging it on the troubleshooting)
00:54 jekyllRo joined #openframeworks
00:55 squirrelfiend Interesting, I hadn't heard of either of those. I'll have to look into them.
00:56 admsyn squirrelfiend: what if you double the resolution, in main.mm?
00:56 pizthewiz ShivaVG has an addon: https://github.com/bgstaal/ofxShivaVG, NanoVG you'd have to go it your own with :0)
00:56 admsyn but yeah ofxShivaVG looks like a good alternative :)
00:58 squirrelfiend I'm going to try doubling the resolution, I guess I went in on the assumption that all the settings in the emptyExample template were sort of optimized already.
01:00 squirrelfiend Yeah, changing the resolution doesn't seem to help it. I'm going to look into ShivaVG. Is it true that setGlutDisplayString is non-functional in the iOS version?
01:00 Beliq_ joined #openframeworks
01:01 admsyn yeah you wouldn't be using glut on iOS
01:02 admsyn glut is one of the ways to get a window + GL on desktops, but on iOS and android it's just done with the iOS/android API
01:02 squirrelfiend Looking at the ofxShivaVG and it seems to require the GlutWindow to function, according to the readme. I could be missing something. From the readme: "First, you MUST enable a stencil buffer in your ofProject. This is done by passing in "stencil" as part of the glut display string. "
01:03 squirrelfiend I appreciate all the help, guys.
01:04 admsyn I think that's probably referring to getting it running on e.g. OSX
01:04 admsyn one sec I'm kinda running around right now but I'm pretty sure the issue is that you're running at non-retina resolutions
01:06 jekyllRo joined #openframeworks
01:07 squirrelfiend Sure thing, take your time.
01:14 admsyn yeah there's seperate functions for enabling retina and setting the number of AA samples
01:15 admsyn one of those will probably be what you're looking for :)
01:15 admsyn just a sec I'll figure out the syntax
01:17 admsyn so if you base your main.mm off of one of the examples that has an explicit ofAppiOSWindow (like iosNativeExample)
01:18 admsyn you get a "window" variable, and then you should be able to window->enableRetina() and/or window->enableAntiAliasing(4)
01:18 admsyn where "4" is how many AA samples you want
01:19 squirrelfiend ok, awesome.
01:19 squirrelfiend I'll look into it.
01:19 squirrelfiend Thanks a lot. I guess consulting more of the examples would have been a responsible first step.
01:20 squirrelfiend Anyway, I really appreciate it. I'm having a lot of fun playing with this stuff.
01:45 admsyn joined #openframeworks
02:01 Beliq_ joined #openframeworks
02:32 pizthewiz joined #openframeworks
03:01 Beliq_ joined #openframeworks
03:46 jedahan joined #openframeworks
04:02 Beliq_ joined #openframeworks
05:03 Beliq_ joined #openframeworks
05:26 Beliq_ joined #openframeworks
05:40 pizthewiz joined #openframeworks
06:05 booltox joined #openframeworks
07:27 ncls joined #openframeworks
07:27 GuidovanPossum joined #openframeworks
07:46 nylki joined #openframeworks
08:44 neue joined #openframeworks
09:32 GuidovanPossum joined #openframeworks
09:48 nylki joined #openframeworks
09:51 mhashmi joined #openframeworks
10:51 mhashmi joined #openframeworks
11:42 jchillerup joined #openframeworks
11:43 jchillerup Hey, does anybody have any experience in grabbing video from several cameras? I can't use USB webcams because they use the USB isochronous device type of which there is very limited bandwidth
11:44 jchillerup I want to capture three video inputs. I have low demands in terms of resolution and framerate - VGA is fine, and so is 12 fps
11:48 sebllll joined #openframeworks
12:05 Beliq joined #openframeworks
12:11 nylki joined #openframeworks
12:47 nylki joined #openframeworks
13:06 Beliq joined #openframeworks
13:22 mhashmi joined #openframeworks
13:58 nylki joined #openframeworks
14:06 Beliq joined #openframeworks
14:21 jedahan joined #openframeworks
14:40 vade joined #openframeworks
14:54 jekyllRo joined #openframeworks
15:53 jekyllRo1 joined #openframeworks
15:59 nylki joined #openframeworks
16:14 Beliq joined #openframeworks
17:02 jekyllRo joined #openframeworks
17:15 GuidovanPossum joined #openframeworks
17:15 Beliq joined #openframeworks
17:16 AlexAbraham joined #openframeworks
17:17 AlexAbraham hey
17:17 AlexAbraham anyone have experience with haarFinders?
17:33 pizthewiz joined #openframeworks
17:41 DrCode joined #openframeworks
17:53 pizthewiz joined #openframeworks
17:58 jekyllRo joined #openframeworks
18:16 Beliq joined #openframeworks
18:24 jekyllRo joined #openframeworks
18:24 admsyn joined #openframeworks
18:26 jekyllRo joined #openframeworks
18:43 jekyllRo1 joined #openframeworks
18:48 jekyllRo joined #openframeworks
19:09 mhashmi joined #openframeworks
19:16 AlexAbraham hey
19:16 AlexAbraham anyone have experience with haarFinders?
19:17 Beliq joined #openframeworks
19:26 admsyn hey AlexAbraham
19:26 admsyn yeah what are you looking to do?
19:26 admsyn detecting eyes right?
19:36 AlexAbraham joined #openframeworks
19:37 AlexAbraham right
19:37 AlexAbraham and it works perfectly
19:37 AlexAbraham but here is my issue
19:38 AlexAbraham if I turn screen to portrait, it doesn’t work because image is being analyzed sideways
19:38 AlexAbraham I am doing it on an android phone
19:38 admsyn alright, you could detect orientation and rotate the image before passing it into the algorithm
19:39 admsyn I'm pretty sure there's a way to do it without actually doing the rotation if that's a significant performance hit, but that should do?
19:42 admsyn and yeah the cv haar face detector needs basically a straight upright face to work, if it's tilted a bit you'll probably get bad results as well
19:42 AlexAbraham ya i noticed :-)
19:43 AlexAbraham also, is there a way to detect the outline of the eye instead of a square around it?
19:44 admsyn off the top of my head I don't know if there's anything in opencv / ofxcv that'll just do that for you
19:44 admsyn unless you need to be ultra precise, having a generic eye shape template and applying it to the rectangle you get is probably your best bet
19:45 AlexAbraham interesting
19:45 admsyn you could do e.g. Canny edge detection on a cropped image of the eye, but I'm not sure how well that'd work
19:45 admsyn and you'd get the pupil etc in there
19:45 admsyn depends on the specifics I guess :)
19:45 admsyn *of what you're trying to do
19:46 AlexAbraham prob not worth it
19:46 admsyn canny's pretty easy to apply if you want to give it a shot
19:46 admsyn it's like one line
19:47 admsyn and you get a black / white image back where white = edge and black = not edge
19:47 AlexAbraham maybe I will try it later
19:47 AlexAbraham right now I am trying to figure out how to delete a circle from a vector during either draw or update
19:48 admsyn like a circle that's not at the start/end of the vector?
19:48 AlexAbraham right
19:48 AlexAbraham vector.erase(vector.begin() + i)
19:49 AlexAbraham but app crashes when that line is run
19:49 AlexAbraham SIGSERV
19:49 admsyn that's not actually how erase works IIRC, it's some unintuitive BS
19:49 nylki joined #openframeworks
19:50 admsyn oh nevermind it is, don't know what I'm thinking of
19:50 AlexAbraham well it crashes whether i erase it in draw or update
19:50 admsyn are you doing the erase in a for loop?
19:50 AlexAbraham for now I just don’t draw the circle that i want erased, but thats not a great solution bc list keeps growing
19:50 AlexAbraham ya
19:51 admsyn yeah that'd be it, every time you erase you're changing the vector, right?
19:51 AlexAbraham http://pastebin.com/LciSumcD
19:51 admsyn so for looping through it will get you weird behaviour
19:51 AlexAbraham right thats the issue
19:51 admsyn in any case, you might want a std::list instead, unless you're dealing with a huge number of circles
19:51 admsyn since erasing stuff from the middle is trivial, both in terms of making it work and it being fast
19:51 AlexAbraham so i am deff not dealing with a huge number of circles
19:52 admsyn but lists are slower to step through (not so much that it probably matters unless you've got tens of thousands of circles or more)
19:52 admsyn yeah go for a list IMO :)
19:52 AlexAbraham so how should i right out the for loop
19:52 admsyn for the vector?
19:52 AlexAbraham the list
19:54 admsyn pretty much the same, but you need to use iterators instead of indexes
19:54 AlexAbraham so like this?
19:55 AlexAbraham http://www.cplusplus.com/forum/general/22957/
19:55 admsyn that's it yeah
19:56 AlexAbraham could i use this with vectors?
19:56 admsyn worth noting is that you can't do like added_circles[5] with a list
19:56 AlexAbraham https://stackoverflow.com/questions/409348/iteration-over-vector-in-c
19:56 AlexAbraham the first option in first answer
19:57 admsyn yeah that'd do too
19:57 AlexAbraham so how do i get the circle
19:57 jekyllRo joined #openframeworks
19:57 admsyn with a list? You keep iterators and step through
19:57 AlexAbraham circle = vector(it)?
19:58 AlexAbraham but do i use the iterator as the index? or is the iterator already a circle object
19:58 admsyn the iterator is effectively a pointer to the circle
19:58 AlexAbraham oh sweet :-)
19:59 admsyn the real benefit of using the list is if you're always removing stuff from arbitrary places in the middle of your collection
19:59 admsyn in terms of performance
20:00 admsyn *anyway* not a big deal, figured I'd mention it, vector will probably be fine if you don't care :)
20:00 AlexAbraham i am using this for a few circles so it shouldn’t be a big deal
20:00 AlexAbraham i am having trouble setting up the iterator though
20:01 AlexAbraham nvm i think i got it
20:03 mhashmi joined #openframeworks
20:04 AlexAbraham i am having touble accessing a value in my circle object
20:04 AlexAbraham i have a vector of <Circle*>
20:04 AlexAbraham and i guess the fact that its a pointer is bothering the compiler :p
20:05 AlexAbraham if (circle->timesDrawn > maxTimesDrawn) {
20:05 admsyn yeah you'd have to basically dereference it then do the ->
20:05 admsyn so like (*circle)->timesDrawn
20:05 AlexAbraham thanks :-)
20:06 AlexAbraham its a serious problem trying to do this without knowing a lot about pointers
20:06 admsyn not to overload you with the C++ right now, but keeping a vector / list of raw pointers is usually not something you do
20:07 AlexAbraham really
20:07 admsyn usually either a vector of raw objects or smart pointers (shared_ptr)
20:07 admsyn so like just vector<Circle> if possible, or vector<shared_ptr<Circle>>
20:07 AlexAbraham aha
20:08 AlexAbraham i still get the sigserv error
20:08 admsyn what's your erase loop look like now?
20:09 AlexAbraham http://pastebin.com/hVPrvW1A
20:09 AlexAbraham it actually says added_circles.erase(*circle)
20:09 admsyn oh I don't think you want remove, you want erase
20:10 admsyn alright
20:10 AlexAbraham added_circles.erase(circle);
20:11 admsyn I think you want circle++ in ther
20:12 admsyn e.g. http://stackoverflow.com/a/596180/704596
20:12 AlexAbraham oh thats interesting
20:13 AlexAbraham it says i have to increment first and then remove previous element
20:13 admsyn this and the error with the vector from before is quirks about removing stuff from the collection as you're also looping through it
20:13 admsyn becase C++ is fun like that
20:14 admsyn well basically what's happening is that "circle" becomes invalid after you erase it from the list, then the next time around the for loop you try to circle++ it
20:15 admsyn so doing circle++ in there is kind of a hacky way of erasing the thing you want to erase, but then making the iterator point to the next thing in the list right away
20:15 AlexAbraham still not working :-(
20:15 AlexAbraham http://pastebin.com/SbKnY8tC
20:15 admsyn which is why the answer-er mentioned "alternatively, i = items.erase(i);" because that's a bit more straightforward
20:15 admsyn orl
20:15 admsyn y
20:16 admsyn oh wait you're still doing a vector?
20:17 AlexAbraham should i have switched by now? :p
20:17 admsyn no I just wasn't sure :p
20:17 AlexAbraham i will switch see what happends
20:17 admsyn yeah what's happening there is that when you remove a thing from a vector, *all* the iterators become invalid
20:17 Beliq joined #openframeworks
20:17 admsyn so e.g. circle++ doesn't get you the next element, it gets you errors
20:19 AlexAbraham but now i have an issue where I can’t do added_circles[i]
20:19 pizthewiz joined #openframeworks
20:20 admsyn right, so you can do the vector if being able to access the circles that way is a important
20:20 admsyn you need to step through the vector backwards though is the trick
20:20 admsyn if you're removing stuff by index
20:20 AlexAbraham i think i found the bug
20:20 AlexAbraham it was still trying to delete the circle without an iterator somewhere else in my code
20:21 admsyn that'd do it too :p
20:40 AlexAbraham hey
20:40 AlexAbraham if i have a list
20:40 AlexAbraham and i want to access with an iterator both element i and element i+1
20:40 AlexAbraham how wpould i do that
20:41 admsyn pretty sure you could just do like list<Circle>::iterator nextCircle = circle + 1;
20:42 mhashmi joined #openframeworks
20:50 mhashmi joined #openframeworks
20:55 jekyllRo joined #openframeworks
21:05 jekyllRo joined #openframeworks
21:05 AlexAbraham hey admsyn u still there?
21:05 admsyn yepp what's up
21:06 AlexAbraham do you know how to switch cameras?
21:06 AlexAbraham from back camera to front camera?
21:06 admsyn nope, sorry
21:06 AlexAbraham oh man
21:06 admsyn I'd imagine it's just a function on the android specific camera?
21:07 admsyn *ofVideoGrabber
21:07 AlexAbraham right
21:07 AlexAbraham so i know how to set the device ID, and it says I can’t set it while the grabber is running
21:07 AlexAbraham so i try grabber.stop() and then geabber.setDeviceID(1)
21:08 AlexAbraham and i don’t get an error, but the grabber doesn’t actually stop
21:08 AlexAbraham and the camera is not switched
21:08 admsyn huh
21:08 admsyn I guess one way to go about it would be to have two video grabbers and just switch between them in your code
21:08 admsyn but that's pretty gross
21:09 AlexAbraham right so i tried that and i think it only allows one at a time
21:09 admsyn well it looks like close() isn't implemented in the android grabber for some reason
21:10 admsyn but it does clean up if you actually destroy the object
21:10 AlexAbraham right
21:10 AlexAbraham i noticed that
21:10 AlexAbraham so how does it do that :|
21:10 admsyn so, if you were to have a shared_ptr<ofVideoGrabber> in your app, you could delete it and recreate it when you want to switch
21:10 admsyn which also seems gross but maybe fine
21:10 pizthewiz ofPtr?
21:11 admsyn yeah that's deprecated for reals now :p
21:11 admsyn but yeah ofPtr<ofVideoGrabber> would also work
21:11 pizthewiz Oh nice, I didn't realize that change had already been made on master
21:11 admsyn and be effectively the same thing
21:11 admsyn yeah I think it was a commit from a week ago or so
21:12 AlexAbraham wait so how do i delete an object?
21:12 pizthewiz Excellent, does that mean the other C++11 stuff is in, or waiting on 64-bit?
21:12 AlexAbraham i don’t really need an array i just delete one grabber and make a new one
21:12 admsyn grabber = NULL; should do it
21:12 AlexAbraham huh
21:12 AlexAbraham let me try that :-)
21:13 AlexAbraham although will my app crash if it does that during update() or draw()?
21:13 admsyn what a shared_ptr does is destroy the object it's pointing to when nothing points to it anymore
21:13 admsyn I don't think so no, unless you try and use it while it's null
21:13 AlexAbraham so the draw and update methods use the grabber
21:14 pizthewiz right, you'll need to wrap the use in a conditional
21:14 admsyn right but if your code's like grabber = NULL; grabber = new ofVideoGrabber(); you should be good
21:14 AlexAbraham do you know which one runs first? I could set a boolean variable and then run the switch at the end of whateve method runs last
21:14 admsyn or I guess just grabber = new ofVideoGrabber() really
21:14 pizthewiz Ahh, nice one.
21:14 AlexAbraham i could try that :-)
21:15 admsyn actually I think I got the syntax wrong, derp :p
21:15 admsyn grabber = shared_ptr<ofVideoGrabber>(new ofVideoGrabber()); I think
21:15 admsyn no IDE in front of me at the moment
21:16 pizthewiz Cinder goes one step further and typically uses a single create static factory and then leaves the constructor private
21:16 admsyn yepp, design patterns woo
21:16 pizthewiz And type defs the shared_ptr as TYPENAMERef
21:17 pizthewiz shared pointers are like next gen "smart" pointers right?
21:17 admsyn yeah, though next gen is maybe a little generous :p
21:17 AlexAbraham no match for “operator =“
21:17 AlexAbraham for grabber = new ofVideoGrabber()
21:18 admsyn yeah that's why I corrected myself
21:18 pizthewiz > [14:15:18] @admsyn:grabber = shared_ptr<ofVideoGrabber>(new ofVideoGrabber()); I think
21:18 admsyn grabber = new ofVideoGrabber() would be making grabber a ofVideoGrabber * instead of a shared_ptr<ofVideoGrabber>
21:18 Beliq joined #openframeworks
21:18 AlexAbraham ahhh
21:19 AlexAbraham no match for 'operator=' (operand types are 'ofVideoGrabber' and 'std::tr1::shared_ptr<ofVideoGrabber>')ofApp.cpp
21:19 admsyn is your grabber a shared_ptr<ofVideoGrabber> ? (as in, in your ofApp.h)
21:19 AlexAbraham no its just ofVideoGrabber
21:19 admsyn yeah make that a shared_ptr<ofVideoGrabber>
21:20 admsyn basically the same from your viewpoint, except -> syntax for everything instead of .
21:20 Beliq joined #openframeworks
21:20 GuidovanPossum joined #openframeworks
21:23 AlexAbraham i get a sigserv error before even trying to switch camera
21:23 admsyn which line?
21:23 AlexAbraham idk
21:23 AlexAbraham tag is “”libc
21:24 admsyn well, make sure you're doing grabber = shared_ptr<ofVideoGrabber>(new ofVideoGrabber()); before you're ever using it, that's probably the issue
21:24 admsyn otherwise it's just NULL / garbage
21:25 admsyn but finding out how to see what line your errors are on in your IDE is helpful (to put it lightly)
21:26 AlexAbraham it worked
21:26 admsyn \o/
21:26 AlexAbraham app still crashes when switching camera but i am so much closer!
21:26 AlexAbraham i have to go but you have been AWESOME!
21:26 AlexAbraham thanks man :-)
21:26 admsyn np, good luck with it
21:47 jekyllRo joined #openframeworks
21:55 Beliq joined #openframeworks
22:00 jekyllRo joined #openframeworks
22:03 phserr joined #openframeworks
22:20 jekyllRo joined #openframeworks
22:20 jekyllRo left #openframeworks
23:03 jekyllRo joined #openframeworks
23:45 jekyllRo joined #openframeworks
23:54 Beliq joined #openframeworks
23:55 admsyn anyone know offhand if installing the xcode command line tools is actually necessary still?
23:55 admsyn for getting up and going on OSX
23:56 Beliq joined #openframeworks
23:59 Beliq joined #openframeworks

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