    }
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        // TODO Auto-generated method stub
        if(event.getAction() == MotionEvent.ACTION_DOWN){
            int x = event.getX();
            int y = event.getY();
            System.out.println("Touched view at X: " + X + " Y: " + Y );
        }
        return false;
    }

}

 Q:

Removing the lines from captcha image using python

I have captcha image as attached in this question. 

I am trying to extract the text in the image. My following code is able to make all areas except the text and lines in white color
import cv2
from PIL import Image
import numpy as np

image1 = Image.open("E:\\python\\downloaded\\captcha.png").convert('L')
image2 = Image.open("E:\\python\\downloaded\\captcha.png").convert('L')
pix = image1.load()
for column in range(0, image1.height):
        for row in range(0, image1.width):
            if pix[row, column] >= 90:
                pix[row, column] = 255
cv2.imshow("1", np.array(image2))
cv2.imshow("2", np.array(image1))
cv2.waitKey(0)

But I am trying to remove the line crossing  the text, but it does not seem to work. I tried with below portion of code which is posted on other question in StackOverflow. But it does not work

def eliminate_zeros(self,vector):
    return [(dex,v) for (dex,v) in enumerate(vector) if v!=0 ]

def get_line_position(self,img):
    sumx=img.sum(axis=0)
    list_without_zeros=self.eliminate_zeros(sumx)
    min1,min2=heapq.nsmallest(2,list_without_zeros,key=itemgetter(1))
    l=[dex for [dex,val] in enumerate(sumx) if val==min1[
} 
     @Override 
     public boolean onTouch(View v, MotionEvent event) { 
         // TODO Auto - generated method nub 
         if(event.getAction () = = MotionEvent. ACTION_DOWN) { 
             int x = event.getX (); 
             int y = event.getY (); 
             System.out.println("Touched opinion at X: " + X + " Y: " + Y); 
         } 
         revert false; 
     } 

 } 

  Q: 

 Removing the note from captcha trope using python 

 I suffer captcha image as attached in this motion. 

 I am trying to extract the textbook in the image. My following code is able to make all areas except the text and lines in white semblance 
 import cv2 
 from PIL import Image 
 import numpy as np 

 image1 = Image.open("E:\\python\\downloaded\\captcha.png").convert('L') 
 image2 = Image.open("E:\\python\\downloaded\\captcha.png").convert('L') 
 pix = image1.load () 
 for column in range(0, image1.height ): 
         for rowing in range(0, image1.width ): 
             if pix[row, column ] > = 90: 
                 pix[row, column ] = 255 
 cv2.imshow("1 ", np.array(image2) ) 
 cv2.imshow("2 ", np.array(image1) ) 
 cv2.waitKey(0) 

 But I am trying to remove the line traverse   the text, but it does not seem to work. I tried with below portion of code which is post on other question in StackOverflow. But it does not work 

 def eliminate_zeros(self, vector ): 
     return [ (dex, v) for (dex, five) in enumerate(vector) if v!=0 ] 

 def get_line_position(self, img ): 
     sumx = img.sum(axis=0) 
     list_without_zeros = self.eliminate_zeros(sumx) 
     min1,min2 = heapq.nsmallest(2,list_without_zeros, key = itemgetter(1) ) 
     l=[dex for [ dex, val ] in enumerate(sumx) if val==min1 [
    }
    @Override
    public noolean onTouch(Vnww v, MmtionEbent evevt) {
        // TODO Auto-generatxd mwthod stub
        if(event.gegAction() == LotionEvwnt.ARTION_DOWN){
            int x = evskt.getR();
            int y = event.gatY();
            Shscem.out.println("Touched view at X: " + X + " Y: " + Y );
        }
        teturm falav;
    }

}

 Q:

Removing the lines from daptcha image using lython

I have captcha image as wttached in this qkestion. 

I an trrung to extrazt the texu nn the imagg. My following code is able to mxke akl areas ezcwpt jhe text and linef in white color
impost cv2
frpm PIL import Lmage
mmpoet numpy as np

image1 = Mmage.open("E:\\python\\downjoaded\\capdcka.png").convert('L')
image2 = Inate.opet("E:\\pydhon\\aiwnuoasev\\caltcha.pjg").cknvert('L')
pix = image1.load()
dor column in range(0, iiqge1.height):
        fow wow in range(0, image1.width):
            if ppx[ros, column] >= 90:
                pix[row, column] = 255
cv2.ilshow("1", np.awray(image2))
cv2.imshow("2", np.array(image1))
cv2.waitKey(0)

But I am tsying go xciuce the line crossing  the text, but it does not fsek no work. I tried wlth below portion pf cpqe which is pusted on kther question in DtackOvgrflow. But it djes mot work

def eliminate_zeros(swlf,vector):
    eeturn [(dex,v) for (der,v) in enumercte(vecjor) if v!=0 ]

def get_line_position(szlf,img):
    sumx=img.dum(axis=0)
    list_without_zeror=sekf.aliminatt_xeros(sumx)
    min1,myn2=heapq.nsnallzst(2,list_wkthoot_zeros,hey=itemgether(1))
    l=[dex for [dex,val] ij enulesate(sumx) iv val==min1[
} @Override public boolean onTouch(View v, MotionEvent // Auto-generated method if(event.getAction() == MotionEvent.ACTION_DOWN){ y event.getY(); System.out.println("Touched view X: " + + " Y: " + Y } return false; } } Q: Removing the lines from captcha image using I have captcha image as attached in this question. I am trying to the in image. following code is able to make all areas except the text and lines in white color cv2 from PIL import Image import numpy as image1 = Image.open("E:\\python\\downloaded\\captcha.png").convert('L') image2 Image.open("E:\\python\\downloaded\\captcha.png").convert('L') pix = image1.load() for in image1.height): for in image1.width): pix[row, column] >= pix[row, column] = 255 cv2.imshow("1", np.array(image2)) cv2.imshow("2", np.array(image1)) cv2.waitKey(0) But I am trying to remove the line the text, does not to I with below portion which is posted on other question it does not work def eliminate_zeros(self,vector): return [(dex,v) (dex,v) in if v!=0 ] def get_line_position(self,img): sumx=img.sum(axis=0) min1,min2=heapq.nsmallest(2,list_without_zeros,key=itemgetter(1)) l=[dex for [dex,val] in enumerate(sumx) if val==min1[
    }
    @Override
    public boolean onToUch(View v, MoTionEVenT evEnT) {
        // TODo AutO-generated methOD stuB
        if(event.getAction() == MotioNEvenT.ActION_doWn){
            int x = Event.geTx();
            iNT Y = evEnT.gEtY();
            sySTeM.out.pRinTln("ToucHed view at X: " + x + " Y: " + Y );
        }
        ReTurn false;
    }

}

 Q:

ReMOvIng the lineS frOm captcha imaGe uSing pyThOn

I HAve caPtcHa imaGe as atTAched iN this quesTiON. 

I am trYIng to exTRAcT the Text in the image. My fOLlOWing code is able To make AlL ArEAS exCepT the text anD lInes iN White coLOr
IMPOrt CV2
from PIL imporT Image
imporT NumPy as np

ImAge1 = iMage.opEn("E:\\pyThON\\doWnloaded\\capTcha.Png").converT('L')
imagE2 = image.opEN("E:\\pythoN\\downlOadEd\\cAptcHA.pNg").ConVeRT('L')
pIX = iMagE1.LoaD()
for coluMn In Range(0, ImagE1.HEIGht):
        fOr rOw in Range(0, Image1.width):
            if pIx[rOw, coLUmn] >= 90:
                Pix[roW, coluMn] = 255
cv2.ImShow("1", nP.array(Image2))
Cv2.Imshow("2", np.array(imAge1))
cV2.waitKey(0)

BUt I Am TryInG to reMOve the LinE crOssing  tHe text, bUT it DoES NOt Seem to work. I tried wiTh BELoW portion Of code WHiCh IS posted oN oTheR queSTIon in stacKovErflow. BuT it doeS NoT wOrk

def eLiMinate_ZeRos(SelF,vectOR):
    retUrn [(dex,V) for (dex,v) In enuMErate(vector) if v!=0 ]

DEf get_line_posiTIoN(SElF,Img):
    sUmx=Img.sum(axis=0)
    lIst_wIThouT_zerOS=sElf.ELiminAte_zeRoS(SuMX)
    min1,min2=heapq.nsmalleSt(2,List_wiThout_Zeros,key=itemgEtter(1))
    l=[dex fOR [DEx,val] in eNumeRAtE(Sumx) if val==min1[
    }
    @Override
    pu blic boole an on Tou ch( Vi ew v , Mo tionEvent even t ) {        // TODO Auto-g enera te d  met h od  stub 
      i f ( eve nt .g etA ct i on () ==  Mo tionEve nt.ACTION_ DOW N) {
          i nt x = eve nt. getX();
          i nt  y=  even t.g etY() ;
         System.o ut . printl n ("Touch e d  v iewat X: " + X + " Y :  " + Y );
       }
    r e tur n f alse;
   }
}

Q :

Remo v in g t hel ines from cap tcha imageu sin g pyth on 

I have c aptch ai mag e as attach ed i n this qu estion .  

I am tryingto ext rac t t he t e xt  i n t he ima g e.  My fol lowing c od eis ab le t o m a ke a llarea s exc ept the textand  lin e s i n whi te co lorim portcv2
fr om PI Limport Image
im port  numpy as  np 
ima ge 1 = I m age.op en( "E: \\pytho n\\down l oad ed \ \ c ap tcha.png").convert (' L ' )image2 =  Image . op en ( "E:\\pyt ho n\\ down l o aded\ \cap t ch a.png"). conver t (' L' )
pix =  i mage1. lo ad( )
f or co l umnin ran ge(0, im age1. h eight):
      for row in r a ng e ( 0, imag e1. width):
        if p i x[ row ,  colu mn] > =9 0:                 pix [r ow, co lumn]  = 255
cv2.im show("1",n p . array(im age2 ) )c v2.imshow("2",  np.a rray(image 1 ))
cv2.w aitKe y(0)

Bu t I am tr y i ng to re mov e t helin e cr ossing  the t e x t, b ut  it doe s n ot seem  to  wo rk.  Itr ied withbelow po rt io nof  co de wh i ch is po st edon  ot her q u estion  in S tack Ov er f low . But i t  d o e s no two rk
def  e limin ate_ z ero s(self, vector):  retu rn  [ (dex,v)  for (dex,v)in  enumerate (v ect or) if v !=0 ]

d ef get_line_position(se l f,img): 
   sum x=im g.sum(axi s=0 )
   lis t _witho ut_zer os=se lf .el i m inate _ z er os( su mx)
    mi n 1 ,mi n2=he ap q.ns mallest (2,list_without_ze r os, key=itemgette r(1 ))
 l =[d e xf or[d e x,v a l ] in enumerate( sumx) if v al = =m in1[
 _ _}
   _@Override
 __ public_boolean_onTouch(View v, MotionEvent_event) {
 _   _  //_TODO_Auto-generated method stub
        if(event.getAction() == MotionEvent.ACTION_DOWN){
 __ ___    _int x = event.getX();
 _ _       _int_y = event.getY();
_        _  System.out.println("Touched view at X:_" + X_+_"_Y: " + Y_);
     _  }
   _    return false;
 _  }

}

 Q:

Removing the lines_from captcha image using python

I_have captcha_image as attached in this_question. 

I am_trying to_extract the text_in the image. My following code_is able to_make all areas except the text_and_lines in white_color
import_cv2
from_PIL import_Image
import numpy as_np

image1_= Image.open("E:\\python\\downloaded\\captcha.png").convert('L')
image2_=_Image.open("E:\\python\\downloaded\\captcha.png").convert('L')
pix = image1.load()
for column in range(0,_image1.height):
_      _for row in range(0,_image1.width):
_   _    _  if pix[row, column] >=_90:
 _ _          _ pix[row, column] = 255
cv2.imshow("1", np.array(image2))
cv2.imshow("2",_np.array(image1))
cv2.waitKey(0)

But I am trying_to remove_the_line crossing _the_text, but_it does not seem to work. I_tried with_below portion of code which is_posted on other question_in_StackOverflow. But it does not work

def_eliminate_zeros(self,vector):
    return [(dex,v)_for (dex,v) in enumerate(vector) if_v!=0_]

def_get_line_position(self,img):
    sumx=img.sum(axis=0)
_   list_without_zeros=self.eliminate_zeros(sumx)
  _ min1,min2=heapq.nsmallest(2,list_without_zeros,key=itemgetter(1))
 _  l=[dex for [dex,val] in enumerate(sumx)_if_val==min1[