How to do image processing with iPhoneSDK - ios4

How does one do image processing & manipulation in an iPhone application?
I would like to include below 3 important steps:
access raw RGB from image data
apply any image processing (edge detect, grey-scale, contrast & color).
create a new image from this modified data.
I got few links with color & contrast, but still looking for edge detection just from the corners of the image.
Here are the links:
https://launchpad.net/imagemagick/main/6.3.2-2
http://code.google.com/p/image-tools2009/source/checkout
http://www.google.com/codesearch#I0cABDTB4TA/pub/FreeBSD/
Is there any other open source code available for these functionalities?

Your question highlights open source frameworks - but I'm going to throw my answer behind Apple's CoreImage framework that is now available in iOS5. CI has been around as an OSX framework for a very long time and as of iOS 5+ you can use a subset of the filters in iOS.
Advantages include:
Very powerful
Highly Optimised
Been around for ages
Ray Wenderlich has great tutorials and he has one on "Beginning Core Image in OS5" which I think might be right up your alley. He talks of the fundamental parts like CIContext, CIImage, CIFilter.
The second place you should look is the Core Image Programming guide for iOS and then CoreImage Filter Reference from Apple. The filter reference mentions which filters are available in iOS.
If you're finding that all a bit difficult, I think you may need to step backwards into CoreGraphics to learn the underlying basics of graphics on iOS - but that's outside the scope of this question.

Related

Possible environments to generate wide range of graphics objects on-the-fly

I am developing an online assessment package for elementary grade math (K-6) Many questions will need to contain graphics such as shown on this image:
https://www.dropbox.com/s/xwsi91l3bp9t3de/samplegraphics.PNG
All graphics needs to be generated on-the-fly (apart from photos of real objects that are stored in a database) - so that unlimited number of problems can be created). Another requirement is that this works well on both desktop and mobile devices.
I am looking for an advice as to what language / graphics package would be best suited for this purpose. I would rather do everything in one environment. If some of the above can not be generated on the fly, I would consider (but not prefer) off-line generation of many examples that are then stored in a database.
I have considered the following
php+gd -- seems nice for manipulating images; however 3D not readily available.
jpgraph.net/features/gallery.php seems like a nice addition for spiffy graphs
There also seems to be a 3D rendered for php phpclasses.org/package/3364-PHP-Compose-and-render-3D-object-models.html -- my 3D requirements are modest (basic shapes, no animation)
JS with different plugins i.e. threejs.org/ for 3D - but this seems like an overkill for my needs
there is also js interface to html 5 canvas : calebevans.me/projects/jcanvas/
and this: keith-wood.name/svgRef.html
Google charts also seems very simple to use, but it doesn't provide everything I need
CSS3 - seems like it can do everything (??)
gnuplot (??) - not on-the-fly
Basically, I am looking for the easiest way to accomplish this, without reinventing the wheel - I am just not quite sure what the trade-offs of different approaches are.

Tracking the top of heads with Kinect

I was wondering if there was an existing API for tracking the top of people heads with the Kinect. e.g., the Kinect is facing downwards from a ceiling.
If not, how might I implement such a thing with its depth data.
No. The Kinect expects to be facing a standing (or seated, given the appropriate flag) human. All APIs (official or 3rd party) that have a notion of skeleton tracking expect this.
If you wish you track someone from above, you will need to use a library such as OpenCV (or EmguCV, for C# development). Well, you don't have to, but they offer utilities to help with computer vision and image processing. These libraries don't care if you are using a Kinect or just a regular RGB camera.
Using the Kinect from above, you could use the depth data to help locate and track blobs. With the Kinect at a known distance from the floor, have a few people walk under it and see what z-coordinates you get out of it -- you can then assume that anything within a certain z-coordinate range is a person walking across the screen (vs. a cat, or something else).
You will need to use standard image processing techniques (see OpenCV reference above) to initially find the blobs within the image. Once found, the depth data from the Kinect might be useful but I think you'll find it isn't ultimately necessary if you're just watching people walk across the floor.
We built a Kinect-driven experience where the sensors had to point downward to detect users walking along a wall. We used openTSPS to do all the work of taking the camera input and doing blob detection and handing off tracked "persons" to (in our case) a Processing app. It works really well for us.
http://opentsps.com/

Iphone Speech Bubble

It would be great if anyone could provide a tutorial or best approach to create a dynamic speech bubble in iphone. Here is the link of an application that already has a dynamic speech bubble built in - http://itunes.apple.com/us/app/bubble-up-free/id364054415?mt=8 . Since I am starting to develop applications in xcode I am not sure whether to approach this using quartz 2d or open GL etc.
http://www.uinnoblog.com/sms-bubble-ui-in-iphone-apps.html
The previous approach is not really the good one where you can use only one image and use the advantage of the stretchableImageWithLeftCapWidth / topCapHeight according with a setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin of an UIImage allowing to stretch an image by its width and/or height without stretching all angles...
In that case, your speech bubble image will be smaller, you'll need only one (instead of 9) AND your code will be really smaller...
Here is good cocoa UI Component on GitHub: https://github.com/AlexBarinov/UIBubbleTableView

High quality image re-sampling in Mono/C#/ASP.NET

I've developed a site that requires high quality resizing of uploaded photos. The site works perfectly under ASP.NET on Windows. This afternoon I tried running it under Mono/Apache/Ubuntu 10.10. To my surprise, it worked - except for the image resampling.
It seems the libraries underlying Mono's Graphics/GDI+ implementation don't implement the bi-cubic interpolation mode. (See Mono Ignores Graphics.InterpolationMode? ).
So I'm looking for a library that can do high quality image resizing. I'm willing to put in the effort to interop to it from C# since this is important functionality and I'd like to be able to run under mono if at all possible. I don't really need any other graphics processing capabilities - just resize.
Follow up: as suggested below ImageMagick works really well for this and was pretty easy to interop to. More details here: http://www.toptensoftware.com/blog/posts/17/high-quality-image-resampling-in-monolinux
ImageMagick is both a command line tool and a library with high quality interpolation and antialiasing algorithms.

What would you recommend to do simple 2D Graphics?

I want to build a program that will (as part of what it's doing) display lines organically growing and interacting horizontally across the screen. Here's a sample image, just imagine the lines sprouting from the left and growing to the right:
The lines would look like the lines used on Google Maps Transit Overlay or OnNYTurf's transit pages.
It's a personal project, so I'm open to just about any language and library combination. But I don't know where to start. What have you used in the past to create graphics that are similar to this? What would you recommend? I want it to run on Windows without any extras needed (.Net is fine), and it doesn't have to run elsewhere. I needs to run as an actual program, not javascript in the browser.
There's obviously no 'right' answer to this, but the purpose isn't to start an argument about X better than Y but rather just find a list of graphics toolkits that do simple 2D graphics that people recommend because of their ease of use or community or whatever.
Processing may be just the tool for you.
Like you said, there are many ways to tackle this problem. Me personally, being it is a windows based project, I would go with the .NET based implementation utilizing WPF. There are tutorials on how to use the 2D drawing feature out there ( http://www.wpftutorial.net/DrawOnPhysicalDevicePixels.html for one ) Again, there is no right answer here. I might also pick some new technology and let your project be a mechanism to learn something new, providing you do not have a looming deadline.

Resources