While listening to the voicemail, you can always press 1 for rewinding.
Even after the operator prompts for your inputs to either skip to the next voicemail or store the current voicemail, you can still press 1 to rewind! COOL!
Medical Imaging, Image Processing, Computer Vision, Pattern Recognition, Research, Medical & Health Informatics
#include "stdafx.h"#include \#include \#include \int _tmain(int argc, _TCHAR* argv[]){IplImage *img = cvLoadImage("C:\\output.JPG");cvNamedWindow("Image:",1);cvShowImage("Image:",img);cvWaitKey();cvDestroyWindow("Image:");cvReleaseImage(&img);return 0;}
private bool someValue= false;...
public void toggleSomeValue(bool b){this.someValue = b;}
public void toggleSomeValue(){this.someValue = !this.someValue;}
orpublic void toggle(bool someValue)
// if someValue is declared as class variables{someValue = !someValue;}orpublic bool toggle(bool someValue)
// you actually don't need this, but FYI.{return !someValue;}
public void doSomethingBasedOnSomeValue(){if(this.someValue)//do thiselse//do thattoggleSomeValue(); //or toggle(this.someValue);}
// NOTE you SHOULD cvReleaseImage() for the return value when end of the code. - (IplImage *)CreateIplImageFromUIImage:(UIImage *)image { // Getting CGImage from UIImage CGImageRef imageRef = image.CGImage; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); // Creating temporal IplImage for drawing IplImage *iplimage = cvCreateImage( cvSize(image.size.width,image.size.height), IPL_DEPTH_8U, 4 ); // Creating CGContext for temporal IplImage CGContextRef contextRef = CGBitmapContextCreate( iplimage->imageData, iplimage->width, iplimage->height, iplimage->depth, iplimage->widthStep, colorSpace, kCGImageAlphaPremultipliedLast|kCGBitmapByteOrderDefault ); // Drawing CGImage to CGContext CGContextDrawImage( contextRef, CGRectMake(0, 0, image.size.width, image.size.height), imageRef ); CGContextRelease(contextRef); CGColorSpaceRelease(colorSpace); // Creating result IplImage IplImage *ret = cvCreateImage(cvGetSize(iplimage), IPL_DEPTH_8U, 3); cvCvtColor(iplimage, ret, CV_RGBA2BGR); cvReleaseImage(&iplimage); return ret; }
Don’t forget release IplImage after using it by cvReleaseImage!
And creating UIImage from IplImage is like this.
// NOTE You should convert color mode as RGB before passing to this function - (UIImage *)UIImageFromIplImage:(IplImage *)image { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); // Allocating the buffer for CGImage NSData *data = [NSData dataWithBytes:image->imageData length:image->imageSize]; CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); // Creating CGImage from chunk of IplImage CGImageRef imageRef = CGImageCreate( image->width, image->height, image->depth, image->depth * image->nChannels, image->widthStep, colorSpace, kCGImageAlphaNone|kCGBitmapByteOrderDefault, provider, NULL, false, kCGRenderingIntentDefault ); // Getting UIImage from CGImage UIImage *ret = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); CGDataProviderRelease(provider); CGColorSpaceRelease(colorSpace); return ret; }