I am trying to test custom LCD displays using vision. I can not find one easy way to perform some basic testing (contrast ratio, ghost images, missing segments...). I am trying to use OCR to read back the LCD text. The problem I am having is the LCD edge and plastic housing edge are very close. If I manually set a ROI it sometimes catches the plastic edge of the housing and the software thinks its an unrecognized character. How can I use edge detection to determine the top/bottom, left/right edges of the LCD and extract it as an ROI automatically?