this is a image board detect algorithem, shown as folling image,
if click the cell(2,2), the area selected as below:
basicly contains 2 steps,quite directly can get the way to solve the problem.
1.get input row and column, to determin how many cells are linked into the selected area.
2.count all boards for each cell in the area then get the sum boards number.
need add more input and output code to have a test tomorrow.
the main code as follow: