can someone tell me how to implement a bisection of the image into upper and lower part? so that I could overlap them. for example, I have an image and I should divide it to calculate a number of pixels on each part. I am new to OpenCV and don't exactly understand the geometry of the image.
To simplify @avereux's answer:
In Python you can use splicing to break down an image into sub-images. The syntax for this is:
sub_image = full_image[y_start: y_end, x_start:x_end]
Note that for images, the origin is the top-left corner of the image. So a pixel on the first row of the image (that is the topmost row) would have coordinates x_coordinate = x, y_coordinate = 0
To get the shape of the image, use image.shape
. This returns (no_of_rows, no_of_cols)
You can use these to break down the image any which way you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With