# Cut an image into 2 parts based on a line

Hi,

I am looking to split an image into two parts. After doing some math, (x1, y1) of the top point and (x2, y2) of the bottom point are calculate (y1 = 0 and y2 = height of the image).

How can i split the image knowing all the 4 corner points.

what should happen with the overlapping parts ?

What do u mean by overlapping ? From HoughLinesP function i get two points on the line. I extrapolated the line to get the top point on the image(x1, 0) and bottom point (x2, rows of image).

please explain "split"

I am sorry. Now I am realizing that my question does make any sense. If i cut the image along the line as left image and right image. The number rows are fine but the number of columns in left image/right image will have a some number, either it has to be x1 or x2. I think, i have to do rectangular cut. image[y1:y2, x1:x2]