I am doing a task where I use the Canny edge detector to compute an edge image which has white pixels representing the edge, and then I will need the coordinates of the these edge pixels in the image to sent into another function.
The process of getting the coordinates of edge pixels from the edge image matrix is usually done with the cv::FindContours()
of OpenCV, and the algorithm in this function is complicated and with many decisions, which is not differentiable. But now I want to use the process of turning edge image into 2d coordinates as a part in a deep learning model, so I need to have a differentiable and more straightforward process.
I couldn't find one, does anyone have any ideas? Thanks!