I needed to perform some image transformations in a project to prepare a image for OCR. After some search for different solutions, got some methods that may be useful for some of you. Here is the code that include the "lib".
It basically wraps inline code got from internet and modified to run in this project.
There are many options to treat images (GPUImage Lib as example), but I decided to use Quartz e Accelerate Framework, that are already part of iOS (I think since iOS 5). As I use remote host to compile my code, these frameworks were already there.
There are only few method, but you can extend as you need. If you do that, please share the improvements.
Method are:
- Blur Image
- Black and White Image
- Grey Image
- Erode
- Dilate
- Emboss
EDIT: VERSION 1.1
Thanks to many friends that answered many questions during this weekend, I was able to add some new methods to this lib. Here it is:
FULL LIST:
=======
cropImageRect
blurImage
GreyScaleImage
GreyScaleImage2
BlackWhiteImage
InvBlackWhiteImage
ErodeImage
ErodeImageWithDefaultKernel
DilateImage
DilateImageWithDefaultKernel
EmbossImage
EdgeImage
threshold (with otsu)
Hope it helps,
Jorge
It basically wraps inline code got from internet and modified to run in this project.
There are many options to treat images (GPUImage Lib as example), but I decided to use Quartz e Accelerate Framework, that are already part of iOS (I think since iOS 5). As I use remote host to compile my code, these frameworks were already there.
There are only few method, but you can extend as you need. If you do that, please share the improvements.
Method are:
- Blur Image
- Black and White Image
- Grey Image
- Erode
- Dilate
- Emboss
EDIT: VERSION 1.1
Thanks to many friends that answered many questions during this weekend, I was able to add some new methods to this lib. Here it is:
FULL LIST:
=======
cropImageRect
blurImage
GreyScaleImage
GreyScaleImage2
BlackWhiteImage
InvBlackWhiteImage
ErodeImage
ErodeImageWithDefaultKernel
DilateImage
DilateImageWithDefaultKernel
EmbossImage
EdgeImage
threshold (with otsu)
Hope it helps,
Jorge
Attachments
Last edited: