opencv - Loss of quality when converting from IplImage to UIImage -


i'm using opencv library in app , want use final result uiimage. use code convert between iplimage uiimage:

cgcolorspaceref colorspace = cgcolorspacecreatedevicergb(); nsdata * data = [[nsdata alloc] initwithbytes:image->imagedata length:image->imagesize]; cgdataproviderref provider = cgdataprovidercreatewithcfdata((__bridge cfdataref)data); cgimageref imageref = cgimagecreate(image->width, image->height,                                     image->depth, image->depth * image->nchannels, image->widthstep,                                     colorspace, kcgimagealphapremultipliedlast|kcgbitmapbyteorderdefault,                                     provider, null, false, kcgrenderingintentdefault); uiimage *ret = [[uiimage alloc] initwithcgimage:imageref]; cgimagerelease(imageref); cgdataproviderrelease(provider); cgcolorspacerelease(colorspace); 

my problem after conversion quality of original image decreases , image kind of blurry.

what wrong code?


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -