Yes, each pixel is treated as a unit square, typically with integer-indexed top-left corner coordinates. Coordinate [100, 100] refers to the top-left corner of the pixel at row 100, column 100 (if using image coordinate convention) or x = 100, y = 100 (if using screen coordinates). In MATLAB, this coordinate refers to the top-left corner of the pixel. For a rectangle defined as [100 100 200 200], how many pixels are included depends on the interpretation of the coordinates.
MATLAB often uses the format: [x1, y1, x2, y2]
But in many MATLAB functions (e.g., rectangle), the form is instead: [x, y, width, height]
If [100 100 200 200] is interpreted as [x1 y1 x2 y2], then:
- Pixels included = (200 - 100 + 1)^2 = 10201
If interpreted as [x, y, width, height]:
- Pixels included = 200 * 200 = 40000
Hope this helps!