I would like to draw the canny result on the original image

We have no idea where your line 229 is.
You make no attempt to check if the QImage to Mat conversion succeeds.