Skip to content

Commit 417b1c6

Browse files
committed
change c++ back to not abs
1 parent d771258 commit 417b1c6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

finial_product/sobel_hls/source/sobel_base.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ static PIXEL Gradient_X(PIXEL WB[3][3])
1616
out_pix = out_pix + A00;
1717
out_pix = out_pix - S00;
1818

19-
out_pix = abs(out_pix);
19+
if(out_pix<0)
20+
{
21+
out_pix = 0;
22+
}
2023

2124
if(out_pix>255)
2225
{
@@ -35,9 +38,11 @@ static PIXEL Gradient_Y(PIXEL WB[3][3])
3538
out_pix = M01 - M00;
3639
out_pix = out_pix + A00;
3740
out_pix = out_pix - S00;
38-
39-
out_pix = abs(out_pix);
40-
41+
42+
if(out_pix<0)
43+
{
44+
out_pix = 0;
45+
}
4146
if(out_pix > 255)
4247
{
4348
out_pix = 255;

0 commit comments

Comments
 (0)