title: How to find out average pixel value of an image, scanning it from top and bottom?
body: <p>So, I have an image and I want to scan the image from top upto 5 rows. After that, I want to calculate the average pixel color value of the scanned area. How to do it?</p>
  
  <p>Same for scanning from bottom upto 5 rows.
  <a href="https://i.stack.imgur.com/Krz1z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Krz1z.jpg" alt="Image to scan"></a> </p>