How can i invert colors in an character image?
显示 更早的评论
I started working on handwritten English character recognition using neural network. In my scanned character images, characters are written in black color with a white background. Is there any function in MATLAB which can convert the character image's background color into black and the printed character into white color?
Actually in the process of skeletonization (thinning) of the character image, i used a function "bwmorph", which works well if the character is written with white color on a black background. The code i used was:
Img1=bwmorph(Img,'skel',Inf);
It works correctly if Img is the character image with white character on black background but doesn't work when i take Img as a black ink character with white background.
Is there any other alternative of "bwmorph"? or any other code used for thinning the character image..
Thanks... -Amit
采纳的回答
更多回答(1 个)
farhan rana
2011-10-10
0 个投票
there was an even simpler way to do this but i dont remember it correctly. all it took was subtracting 1 from the image or something. forgive me for not remembering correctly :(
类别
在 帮助中心 和 File Exchange 中查找有关 Keypoint Detection 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!