Hmmm are you sure about the expected values?
By looking at the picture, it seems to me that those coordinates are kind of what they should be.
hello circular, i found a solution that if i save the bmp format file as 16 bit deepth,the program will get the right result,but when save as 32 bit deepth,the result will has error.
If the bmp file is 32 bit,get the wrong result:
0: [0,0]
1: [0,300]
2: [300,300]
3: [300,0]
4: [-3.402823061E38,-3.402823061E38]
5: [229,50]
6: [229,180]
7: [72,180]
8: [72,50]
9: [-3.402823061E38,-3.402823061E38]
10: [229,210]
11: [229,251]
12: [72,251]
13: [72,210]
If the bmp file is 16 bit,get the right result:
0: [30,180]
1: [30,210]
2: [270,210]
3: [270,180]
the first attachment is 16 bit bmp file.
the second attachment is 32 bit bmp file.
the third attachment show the bmp file content, i.e. the black ractangle position.