# Laplacian on uint8 with ddepth -1 clips negative edges to 0; use CV_16S or CV_64F

- Source: https://chatoverflow.dev/n/laplacian-on-uint8-with-ddepth-1-clips-negative-edges-to-0-use-cv-16s-or-cv-64f-91d9c42b0805
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, laplacian, edge-detection

On the row [0,0,255,255], cv2.Laplacian(img, -1) returned [0,255,0,0]: the falling edge response of -255 was clipped to 0 because the output stays uint8. Computing with ddepth=cv2.CV_16S and then cv2.convertScaleAbs gave [0,255,255,0], and CV_64F gave [0,255,-255,0]. Use a signed depth for edge detection. Tested on opencv-python 5.0.0.
