busy with title.. will release some new/updated stuff after 16/01/2014.
// sluggo
busy with title.. will release some new/updated stuff after 16/01/2014.
// sluggo
Havent had time to test it enough (read at all) for even an alpha-release yet but to give a hint of what’s in it i’ve uploaded the current documentation to libuvcc.dm9.se.
I’m also writing an obj-c (cocoa) wrapper for the whole thing but that one is not documented yet.
// sluggo
the download links are fixed, sorry about that.
// sluggo
This the new demo from a friends band, The Friday Prophets. Listen it to it, it’s awesome.
the friday prophets @ soundcloud
// sluggo
well hello there!
i just updated to Xcode 4.2 on snow leopard (10.6.8) since 4.0.something kept crashing on me.. well, 4.2 wasn’t much better! when trying to open one of my projects it would crash immediately. i did the usual stuff, (re)moving
~/Library/Preferences/com.apple.dt.Xcode.plist
but to no effect. when i checked the crash log i saw that i got some ui-based reason:
... ASSERTION FAILURE in /SourceCache/DVTKit/DVTKit-907/Framework/Classes/Tabs/DVTTabBarView.m:1532 Details: Assertion failed: maxX >= minX ...
so i figured i’d check out what my workspace file (or actually folder) contained. after firing up iTerm and navigating to
<project-dir>/<project-name>.xcworkspace/xcuserdata/<username>.xcuserdatad/
i found the file UserInterfaceState.xcuserstate. having had a few beers i didn’t feel like going thru a gazillion rows of apple-xml just to fix some layout-crap so i simply (re)moved it. This fixed the problem.
// sluggo
update: regarding the iSight, to get the it into uvc-ctrl menu it has to be active..
update 2: This was originally the release announcement for 1.0a, but i did some minor changes that i realized fixed some really annoying things in that version so i uploaded the new one (1.02a) and just replaced the download link here.. if you’re one of the first five to download the 1.0a version, i’m sorry!
here’s the new alpha version of uvc-ctrl, it looks pretty much as the screenshots in the previous post. function-wise it doesn’t differ much from the last one but it now comes with a native gui localized in english and swedish and is completely dependency-free. note that it’s a status-bar app so no windows are displayed until you select a camera in the menu. there are still some functions missing, most notably the cam-profiles.. also, i’ve only had the chance to test it on 10.6.8. if anyone would like to report success/fail on other os x versions that would be super!
since this is a complete rewrite any and all bug-reports are very welcome, either to sluggo@dm9.se or in the comments below. It would be great if the they included your os x-version, any messages from the Console-app in the Utilities folder (you can filter with the phrase se.dm9) and what led up to it.
lastly, since i wouldn’t be able to draw a stick-figure if my life depended on it there’s no icon!
// sluggo
I’m not quite done with the new version of uvc-ctrl yet but i though i’ll give anyone that’s still interested an update..
the new version is a complete rewrite (not needing libusb and therefore distributed under the dm9 license), two part project. first there’s the uvcc-lib, a library that implements some of the stuff i’ve been missing in QTKit (enumeration of resolutions and fps´, direct access to vendor and device id etc), a few helper functions to tie it up with QTKit (getting a uvccCam struct that can be used to send uvc requests from a [QTCaptureDevice uniqueID] and so on) and of course a uvccSendRequest function. Then there’s the application which will be a status bar (or “menu bar”, dunno the apple lingo here) app capable of setting all the settings on any connected uvc compliant cam.
i thought i’d have this done by now but a work-project turned out occupy most of my summer. now i’m back, just moved into a new apartment and is trying to settle in and study for an exam i screwed up before leaving for the summer break.
next time i post it’ll be the new uvc-ctrl comming out.
update: still some kinks to work out.. but here’s a sneek preview
// sluggo
update: ended up not using the old version so i didn’t look at it much. today i needed it again and realized it was crap so i rewrote it and here’s a new, (hopefully) less buggy version that also handles single-channel images.
Through work i found the need to display an IplImage in cocoa.. after looking at CVOCV, James Hurleys example and a couple of other snippets i remembered that opencv can be built for iOS and started browsing through the source. Inside OpenCV-2.4.1/modules/highgui/src/window_cocoa.mm i found what i was looking for (CVView). i rewrote it a bit and came up with the following NSView subclass:
MyCVView.h
#import <Foundation/Foundation.h> #import <opencv/cv.h> @interface MyCVView : NSView { @private NSBitmapImageRep *bm; @public } @property (nonatomic, retain) NSImage *image; - (void)setImagePrefs:(int)width // image width height:(int)height // " height channels:(int)nChannels // usually 4/3/1 (rgba/rgb/monochrome) widthStep:(int)widthStep // usually width*nChannels depth:(int)depth; - (void)setImageData:(IplImage *)img releaseWhenCopied:(BOOL)shouldRelease; - (void)drawRect:(NSRect)rect; @end
MyCVView.m:
#import "MyCVView.h" @implementation MyCVView @synthesize image; - (id)init { if((self = [super init])) [self setCanDrawConcurrently:true]; return self; } - (void)setImagePrefs:(int)width height:(int)height channels:(int)nChannels widthStep:(int)widthStep depth:(int)depth { if(bm) [bm release]; bm = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 // i only use IPL_DEPTH_8U, if you use others set it as an arg.. samplesPerPixel: nChannels hasAlpha: NO isPlanar: NO colorSpaceName: (nChannels == 1 ? NSDeviceWhiteColorSpace : NSDeviceRGBColorSpace) bytesPerRow: widthStep bitsPerPixel: nChannels*depth]; if(image) [image release]; image = [[NSImage alloc] init]; [image addRepresentation:bm]; } - (void)setImageData:(IplImage *)img releaseWhenCopied:(BOOL)shouldRelease { if(!bm) [self setImagePrefs:img->width height:img->height channels:img->nChannels widthStep:img->widthStep depth:img->depth]; unsigned char *src = (unsigned char *)img->imageData; unsigned char *dst = [bm bitmapData]; if(img->nChannels == 1) memcpy(dst, src, (img->width*img->height)); else { // red-blue swap and flip incorporated for(int i = img->width * img->height - 1; i >= 0; i--) { dst[i * 4 + 0] = src[2]; dst[i * 4 + 1] = src[1]; dst[i * 4 + 2] = src[0]; src += ((CvMat *)img)->step - ((CvMat *)img)->cols; } } [self setNeedsDisplay:YES]; if(shouldRelease) cvReleaseImage(&img); } - (void)drawRect:(NSRect)rect { [super drawRect:rect]; // autoscaling - if you don't want it replace second part with comment below NSRect ir = {{0,0}, {[self bounds].size.width, [self bounds].size.height}}; // {[image size].width, [image size].height}}; if(image != nil) { [image drawInRect: ir fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; } } - (void)dealloc { if(bm) [bm release]; if(image) [image release]; [super dealloc]; } @end
This was built without warnings in xcode 4 on snow leopard and saves some cpu-cycles compared to the original version since the rb-swap and flip is stuffed into a the data-copy-loop. Note that you should not call it CVView (will cause a crash) since opencv already contains a class with that name.
// sluggo
new version out
not much done but since i got rid of the most annoying thing i figured i’d release it anyway.. here’s what’s done
This version is also compatible with Klaus’ gui.
// sluggo
Klaus has written a gui for the latest version of uvc-ctrl! to use it all you have to do is place the uvc-ctrl in the same folder as his app and you can point-and-click-control your uvc cam. if you wish to bundle uvc-ctrl and Klaus’ gui you just copy it into the app. the easiest way to do that is by unpacking uvc-ctrl and uvc-ctrl-GUI in your home-folder, start the terminal (Applications > Utilities > Terminal) and type
mv uvc-ctrl uvc-ctrl-GUI.app/Contents/MacOS/
and then hit enter.
Thank you Klaus for you awesome work!
note libusb is still required.
// sluggo