1 | initial version |
uchar
is an 8 bit step but you have a 16 bit image ... so you would need at dImg.at<ushort>(240,i)
to get the correct value. Also you are not considering that we start counting at index 0, so substract 1 position of that index!