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
Post a Comment