I want to do following thing within in my iOS app:
Well, since OpenCV itself is THE library, I guess that you are looking for a way to do that with OpenCV.
Mat
to UIImage
: for this, iterate on the Mat
and copy every pixel that is not black to the UIImage
to have an UIImage
that contains only what the user draw.A better idea is to iterate on the thresholded Mat
, figure out which pixel is not black, and instead of copying it directly to the new UIImage
, copy that pixel (x,y) from the original UIImage
, so you have a colored pixel at the end, which gives a more realistic result.