I need to find pixel values that are between the intersection of 2 lines. The following image shows the points that I want namely the brown region.
These 4 co-ordinates can change and are not necessarily the corner points.

What is the fastest way to get the pixel values ? Is there any function that can give me the necessary mask.
You should calculate for each point, whether it is above the line or below. If the line is given in its equation form
Ax+By+C, then it is as simple as calculating the sign of this expression, per your point(x,y). If your lines are given in any other form, you should first calculate the form above. (See here and here)Let
L1be the set of all points below the first line, andL2the set of all points below the second line. Then, your set isX = Xor(L1,L2)[
] Xor [
]
Equals:
Here is a Matlab code that solves you problem for the corner points, based on the solution that I’ve described. You can adjust the line equations in your code.