I\'m streaming a png image from my iPhone to my MacBook over tcp. The MacBook code is from http://docs.python.org/library/socketserver.html#requesthandler-objects. How can t
(Your question seems to be tagged objective-c but you ask for Python and so is your example, so I'll use that.) My first post on Stack Overflow!
The cv.LoadImageM method seems to be what you are looking for.
http://opencv.willowgarage.com/documentation/python/reading_and_writing_images_and_video.html
Example use: http://opencv.willowgarage.com/wiki/PythonInterface/
LoadImage(filename, iscolor=CV_LOAD_IMAGE_COLOR) → None
Loads an image from a file as an IplImage. Parameters: filename (str) – Name of file to be loaded. iscolor (int) – Specific color type of the loaded image: CV_LOAD_IMAGE_COLOR the loaded image is forced to be a 3-channel color image CV_LOAD_IMAGE_GRAYSCALE the loaded image is forced to be grayscale CV_LOAD_IMAGE_UNCHANGED the loaded image will be loaded as is.
The function cvLoadImage loads an image from the specified file and returns the pointer to the loaded image. Currently the following file formats are supported:
Windows bitmaps - BMP, DIB JPEG files - JPEG, JPG, JPE Portable Network Graphics - PNG Portable image format - PBM, PGM, PPM Sun rasters - SR, RAS TIFF files - TIFF, TIF
Note that in the current implementation the alpha channel, if any, is stripped from the output image, e.g. 4-channel RGBA image will be loaded as RGB.