B4i Library Image Transformation

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
 

Attachments

  • imgTransformation.zip
    42.2 KB · Views: 44
  • imgTransformation1_1.zip
    148.5 KB · Views: 68
Last edited:

moster67

Expert
Licensed User
Longtime User
I don't know much about graphics, photo-editing and so forth but I ran your app on the simulator and it was very nice but also very quick. It will surely be useful for other fellow B4i users who needs these features.

Nice work and well done!
 

JohnC

Expert
Licensed User
Longtime User
Thanks for creating and sharing this!
 

hanyelmehy

Active Member
Licensed User
Longtime User
-when i try to use CropImageRect result bitmap is rotated with not correct Rect
-when using EdgeImage ,can we get detected Edge coordinate
Thank you
 
Top