|
Can the analysis part be done on smaller images? You could set it all up to use OpenGL for drawing your live video feed a la most camera apps (look up GPUImage), and have OpenGL render to a small framebuffer, then grab that and do your analysis. Depending on what kind of analysis you're doing, you could even draw to the small framebuffer with a shader that does some preprocessing for you. edit: I'm assuming you aren't converting every frame to a UIImage. You aren't, right?
|
# ? Sep 11, 2012 04:30 |
|
|
# ? May 21, 2024 06:14 |
|
I am converting every frame to a UIImage for display in a UIImageView, actually, as shown here: http://www.devsrealm.com/objective-c/direct-access-to-the-camera/ The actual processing also requries UIImages, so I'd have to do it anyway. And yeah, I resize them to a much smaller resolution before processing. There's next to no drawing on the video feed, so that's not an issue. It's a CV thing.
|
# ? Sep 11, 2012 04:50 |
|
Putting every frame in a UIImageView has got to be really inefficient. Maybe not, but I would think that'd be really slow. My suggestion would be to use OpenGL for drawing your live video preview. Take a look at GPUImage, which can set it all up for you. They've got a sample app that uses GPUImage to do real-time color tracking, and it even has a motion detector filter. If you don't want to use OpenGL for drawing your video feed, and you don't need the live preview to be altered first, AVFoundation has a special Core Animation layer to draw the live video preview: Objective-C code:
Doc Block fucked around with this message at 06:05 on Sep 11, 2012 |
# ? Sep 11, 2012 06:00 |
|
I don't think it would end up making a difference either way since I'd still have to convert every single frame to a UIImage for analysis as it is... but thanks. Edit: And honestly, the analysis is perfectly fine as it is -- there's no lag until I try to change preset modes to take a picture. If I use 640 x 480 and never change the preset mode, there's no lag at all. The problem is that it's just a lovely picture. tarepanda fucked around with this message at 06:25 on Sep 11, 2012 |
# ? Sep 11, 2012 06:05 |
|
Thanks for all the advice. Kind of confusing with the conflicting opinions but I think I have a clear idea what to do. I'll be back requesting help when I get stuck I am sure.
|
# ? Sep 11, 2012 08:17 |
|
Jesus Christ, why is date-and-time programming so complicated! My library branch directory app is coming along nicely, but I want to display the branch's schedule today. Let's say a branch has the following schedule: Sun 1:00 p.m. — 5:00 p.m. Mon 9:00 a.m. — 9:00 p.m. Tue 9:00 a.m. — 9:00 p.m. Wed 9:00 a.m. — 9:00 p.m. Thu 9:00 a.m. — 9:00 p.m. Fri 9:00 a.m. — 5:00 p.m. Sat 9:00 a.m. — 5:00 p.m. Rather than put in the whole schedule – which will take up a lot of room in the UI – I'd like to have a button which displays the branch's schedule for today only. (Then, if they tap on the button, it will load a new view with the branch's full schedule.) But holy smokes, does Cocoa ever make this complicated! There seem to be lots of parts involved here: NSDate, NSDateComponents, NSCalendar... I don't get ANY of this! Does anyone know how to do this or of a decent tutorial?
|
# ? Sep 12, 2012 03:48 |
|
The most confounding thing about all that bullshit is that NSDate objects are immutable. I kind of got mad and made my own date class with the functionality I needed... Edit: I have a UIButton that I made in the storyboard and am adding a title to later, in code; the changes don't show up until I touch the UIButton, for some reason. What's the deal with that? tarepanda fucked around with this message at 06:07 on Sep 12, 2012 |
# ? Sep 12, 2012 04:02 |
|
stray posted:But holy smokes, does Cocoa ever make this complicated! There seem to be lots of parts involved here: NSDate, NSDateComponents, NSCalendar... I don't get ANY of this! Does anyone know how to do this or of a decent tutorial? Try this as a starting point: code:
tarepanda posted:Edit: I have a UIButton that I made in the storyboard and am adding a title to later, in code; the changes don't show up until I touch the UIButton, for some reason. What's the deal with that? Check the state config setting on the inspector, you might have Highlighted selected instead of Default. Echo Video fucked around with this message at 06:21 on Sep 12, 2012 |
# ? Sep 12, 2012 06:18 |
|
Echo Video posted:Check the state config setting on the inspector, you might have Highlighted selected instead of Default. Good call. That was exactly it.
|
# ? Sep 12, 2012 06:24 |
|
tarepanda posted:The most confounding thing about all that bullshit is that NSDate objects are immutable. I kind of got mad and made my own date class with the functionality I needed... I'm curious, what were you trying to do?
|
# ? Sep 12, 2012 11:28 |
|
tarepanda posted:The most confounding thing about all that bullshit is that NSDate objects are immutable. I kind of got mad and made my own date class with the functionality I needed... If I recall correctly, NSDate objects are just wrappers around a Unix timestamp.
|
# ? Sep 12, 2012 17:42 |
|
Different epoch: midnight January 1, 2001.
|
# ? Sep 12, 2012 19:27 |
|
tarepanda posted:The most confounding thing about all that bullshit is that NSDate objects are immutable. I kind of got mad and made my own date class with the functionality I needed... Dates are complicated as poo poo and NSDate is a fairly heavy wrapper around a LOT of engineering to make it work across a lot of different locales. Being immutable is The Right Thing™. Writing your own date class yourself (that isn't a wrapper around well-established library) is in most cases a retarded thing to do without special requirements that warrant it.
|
# ? Sep 12, 2012 21:04 |
|
FYI: This took me way too long to figure out, but apparently the the way to get an existing app to start doing 4" layouts is to define a 4"-sized default image in the project file. Did I miss some documentation on this?
|
# ? Sep 13, 2012 01:53 |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
AlwaysWetID34 fucked around with this message at 17:50 on Jan 18, 2019 |
# ? Sep 13, 2012 02:04 |
|
McFunkerson posted:If so I missed it too, I looked all over the iOS/Xcode 4.5 release notes before jumping on the Developer Forums and finding the answer. This is why I liked WWDC hardware releases. I feel like features that needed developer intervention, like @2x-stuff, got explained a lot more efficiently when a critical mass of developers/bloggers had the chance to pick an Apple engineer's brain about it. It's especially weird, given that there's probably going to be a lot of leterboxed apps out there when the iPhone 5 comes out.
|
# ? Sep 13, 2012 02:47 |
|
Doctor w-rw-rw- posted:Dates are complicated as poo poo and NSDate is a fairly heavy wrapper around a LOT of engineering to make it work across a lot of different locales. I could have sworn one of the WWDC presentations stated that NSDate is nothing more than a boxed timestamp.
|
# ? Sep 13, 2012 03:56 |
|
Toady posted:I could have sworn one of the WWDC presentations stated that NSDate is nothing more than a boxed timestamp.
|
# ? Sep 13, 2012 04:14 |
|
Looking at a class-dump of CoreFoundation, NSDate is actually a class cluster with two concrete subclasses (plus a placeholder subclass for alloc-ing): __NSDate which has a double ivar called _time, presumably seconds since some epoch. __NSTaggedDate which doesn't have any ivars and is probably using the tagged pointers trick as mentioned on Mike Ash's blog recently. But yeah, keeping a date itself isn't so hard, it's doing any sort of arithmetic with it that gets hairy very quickly, which is why there's a glut of helper methods for that stuff. There's also the CFDate stuff of course. E: Weird that it's a double though, using a floating point to keep time seems risky. Carthag Tuek fucked around with this message at 04:41 on Sep 13, 2012 |
# ? Sep 13, 2012 04:35 |
|
It probably gives you like sub-microsecond accuracy across ten thousand years in either direction (numbers pulled out of my rear end), and it'll be way faster for any arithmetic, so it seems like a reasonable choice given those trade offs.
|
# ? Sep 13, 2012 06:41 |
|
Plorkyeran posted:What else would it need to store? The complex part is the code to do anything interesting with that timestamp, not the data structure. The point wasn't the data structure. I'm saying NSDate does very little other than represent a timestamp and that the complicated functionality is in other classes. Toady fucked around with this message at 08:02 on Sep 13, 2012 |
# ? Sep 13, 2012 07:53 |
|
ultramiraculous posted:FYI: This took me way too long to figure out, but apparently the the way to get an existing app to start doing 4" layouts is to define a 4"-sized default image in the project file. Did I miss some documentation on this?
|
# ? Sep 13, 2012 09:17 |
|
pokeyman posted:It probably gives you like sub-microsecond accuracy across ten thousand years in either direction (numbers pulled out of my rear end), and it'll be way faster for any arithmetic, so it seems like a reasonable choice given those trade offs. Yeah that's pretty much it, on further investigation: typedef double NSTimeInterval; NSTimeInterval is always specified in seconds; it yields sub-millisecond precision over a range of 10,000 years.
|
# ? Sep 13, 2012 11:09 |
|
McFunkerson posted:If so I missed it too, I looked all over the iOS/Xcode 4.5 release notes before jumping on the Developer Forums and finding the answer. What's the answer?
|
# ? Sep 13, 2012 16:59 |
|
I have this bit in my code, but it just seems like a lot of work for something that might be easier to do another way.Objective-C code:
Objective-C code:
|
# ? Sep 14, 2012 14:10 |
|
filteredArrayUsingPredicate: and the predicate would be something like: @"contains %@", @"Special" But that would be more general assuming @"Special" can only be a suffix. you could also try a regex match in the predicate @"matches %@", @"regex"
|
# ? Sep 14, 2012 15:04 |
|
Is there a clever way to force -viewDidUnload to simulate performance with low memory conditions? I'm only getting the unloaded view action about 15% of the time when I test for it, and I'd rather just trigger it and see what happens.
|
# ? Sep 14, 2012 15:53 |
|
Kallikrates posted:filteredArrayUsingPredicate: I want both the matching object and the filtered array, and most ways I can think of eventually end up doing double work, searching through the array twice.
|
# ? Sep 14, 2012 16:22 |
|
Carthag posted:I want both the matching object and the filtered array, and most ways I can think of eventually end up doing double work, searching through the array twice. You could use one of the IndexOfMethods which would return an index you could use to directly access the object late. Better than using removeObject which will just search twice. so get the index, get a references of the object using the index, then delete it using the index
|
# ? Sep 14, 2012 16:46 |
|
Kallikrates posted:You could use one of the IndexOfMethods which would return an index you could use to directly access the object late. Yeah after posting I saved the index in my block and use removeObjectAtIndex: instead, but it still seems kinda gross. I guess what I'd actually like is some sort of popObjectAtIndex: method that would let me get the object out in the same operation as removing it from the array.
|
# ? Sep 14, 2012 17:12 |
|
Carthag posted:Anyone doing a similar thing with a good tip? I guess I could put it in a category but ugh... I don't think there's a significantly simpler way to do this. This is the best I can come up with, which is only slightly better. I don't really think it's that bad though. Objective-C code:
|
# ? Sep 14, 2012 18:56 |
|
Has anyone tried to use the turn based match system in Game Center? I'm trying to think of a general strategy for building a game around it without requiring the use of multiple devices or GC accounts. There doesn't seem to be any way to start a 1-player turn based match, so my idea right now is simply to firewall off the game code from the matchmaking service and write my own harness for it, but this seems like far too much effort for something the API designer should have anticipated. Am I missing something?
|
# ? Sep 14, 2012 19:02 |
|
Will iOS6 based iPads show the 4" optimized UI on iPhone-only apps, assuming they've got a 4" UI? Want to get started on a UI revamp for an app of mine and get some real-hardware testing done on it this week before my iPhone 5 turns up.
|
# ? Sep 14, 2012 20:50 |
|
lord funk posted:Is there a clever way to force -viewDidUnload to simulate performance with low memory conditions? I'm only getting the unloaded view action about 15% of the time when I test for it, and I'd rather just trigger it and see what happens. I seem to remember -viewDidUnload becoming or essentially already being a no-op, partly because nobody used it properly and partly because it didn't solve any of the problems it was meant to.
|
# ? Sep 14, 2012 22:58 |
|
Carthag posted:Yeah after posting I saved the index in my block and use removeObjectAtIndex: instead, but it still seems kinda gross. I guess what I'd actually like is some sort of popObjectAtIndex: method that would let me get the object out in the same operation as removing it from the array. Is there anything stopping you from putting that in a category on NSArray?
|
# ? Sep 14, 2012 22:59 |
|
pokeyman posted:I seem to remember -viewDidUnload becoming or essentially already being a no-op, partly because nobody used it properly and partly because it didn't solve any of the problems it was meant to. Yeah, as of iOS6 it's not going to get called anymore. Apparently the strategy of throwing away the *entire* view when a memory warning sweep came through wasn't really necessary. Basically as of iOS6, the OS will only throw away the backing layer bitmap for the view, rather than trashing the entire view hierarchy. That realization + realizing so many crashes happened after viewWillUnload got called prompted the change. To answer lord funk's question, you could add a button to do something like this: http://stackoverflow.com/questions/2784892/simulate-memory-warnings-from-the-code-possible
|
# ? Sep 14, 2012 23:19 |
|
pokeyman posted:Is there anything stopping you from putting that in a category on NSArray? I'm only doing it in one place, it just seemed like a thing that an NSArray would be able to do. Doesn't matter that much, I was just sperging a bit. I'm having an actual problem with mktime(), but ONLY when in running the app; the code works fine in my test case. I'm probably really dumb, but what am I doing wrong here? C code:
NB: I'm using strptime()/mktime() because NSDateFormatter is too slow when handling thousands of dates while opening a file. Edit: I guess it must have to do with tm_gmtoff being wildly inappropiate, something about the locale or environment is apparently different when running a test case and the app itself. Edit 2: Jesus christ, I went and checked Date & Time in System Preferences and I had Bangui, Central African Republic as my timezone (incidentally it's the same as ECT, but I guess its locale is hosed up). Setting my timezone to my actual country fixed it. Carthag Tuek fucked around with this message at 00:09 on Sep 15, 2012 |
# ? Sep 14, 2012 23:46 |
|
Is there a good site with a list of all of the changes from iOS 5 to 6 and what they mean rather than a simple itemized list or "you can do more picture fun times" articles? Videos are a no-go for me since I'm mostly deaf.
|
# ? Sep 15, 2012 00:16 |
|
The WWDC videos used to have subtitles, but I can't get it to work with the 2012 ones. The 2010 ones work fine from a quick test. I'm probably too tired to gently caress around with serious stuff any more today. You can see itemized API diffs in XCode help under iOS 6 Library > General > iOS x.y Diffs.
|
# ? Sep 15, 2012 00:28 |
|
|
# ? May 21, 2024 06:14 |
|
lord funk posted:Is there a clever way to force -viewDidUnload to simulate performance with low memory conditions? I'm only getting the unloaded view action about 15% of the time when I test for it, and I'd rather just trigger it and see what happens.
|
# ? Sep 15, 2012 11:39 |