android - Is it possible to convert a edge detection output to binary image OpenCV -


i trying convert text document binary image first detecting edges , converting binary image based on output of edge detection. can me in regard. image after edge detectionenter image description here

have @ non-maxima suppression. used convert gradient edge image binary edge image. difficult pick out words if above out put of edge detection. might need change lighting conditions.

from remember general algorithm. want make sure current pixel greater 2 of neighboring pixels. effective when pick 1 of diagonals. here have picked top left bottom right diagonal. if pixel geater neighbors local maximum , can set one. otherwise there pixel in vacinity has greater value set 0.

for(int i=1; i<image.width;i++){     for(int j=1; j<image.height;j++){         if(image[i][j]>=image[i-1][j-1] && image[i][j]> image[i+1][j+1]){             image[i][j]=1;         }else{             image[i][j]=0;         }     } } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -