text is recognized in a scanned image , by sensing left and right edges , preferably in coincidence in all three color planes -- or otherwise to determine edges in black . such edge sensing is preferably done by convolution of the input pixel stream with a windowed vertical jump , yielding narrow peaks of opposite directedness at beginning and end of each character stroke . textual material is indicated where such peaks alternate in directedness . concurrent testing is desirable also for dark pixels between beginning and end of each stroke -- and light pixels between end of one stroke and beginning of the next . in addition it is preferable to test for an appropriate mix of pixels in each candidate text region . a preliminary test is conducted to determine whether a region being scanned is pictorial ; in this case the entire edge - detection protocol with associated tests is bypassed , on the operating assumption that black - and - white text cannot be present in a region that is pictorial . the pictorial - region test consists of determining whether only very few light pixels are present .