
I cant seem to make this work. I ran debug50 and it seems my math is not mathing. I asked Duck and he said it's right but on debugging it's giving the value (i manually did the math on paper). Is this line the problem?
temp[row][col].rgbtRed = round(sqrt(pow(gxreds,2)+pow(gyreds,2)));
edit: i changed my multiplier name to gxmul from xmul same as for the y. screenshot shows i forgot to change it in line 233 onwards. still after that is changed i still cant get it to work. check50 says edges correctly filters middle pixel and got the others wrong.
edit: I've solved it! the results after the arithmetic is truncated because the rgbt struct was declared as uint8_t which can only store 0-255. and when multiplying it to negative or x2 it overflowed. instead of
temp[row][col].rgbtRed =(sobel operator) --> which can lead to a number outside 0-255, i created another int to do the operation then just passing to the temp.struct in another line.
this has troubled me for 2 days and lil duck is not much of a help on this problem.