I have an image, where four corner points are defined. Now I want to get the pixel values of the region, that is defined by the 4 corners. Problem is, although it is a rectangle, it has a "slope", which means neither the two upper corner points nor the lower one are at the same height. How can I still solve this issue?
I have not found anything for this yet.. I'd appreciate any kind of support! :)
It is not very easy to iterate through a slanted rectangle. Therefore, what you can do is to rotate the whole image such that the rectangle is parallel to the sides again. 
For this, you can compute the slope of one side as difference in the y coordinate over the difference in the x coordinate of the corners. The value you get is the slope. The arctangent of the slope is the angle to the horizontal. You need to rotate the image with the opposite (negative) of this value. 
To make it more efficient, you can crop a bit the image.
How to get pixel values inside of a rectangle within an image