Yes, but you need more than an edge detector. The y-values output by the edge detector might not be a function of x - you could have more than 1 y-value per x, or none at all.
You need a segmentation algorithm to draw a line where the mountains stop and the sky starts, that way y is really a function of x.
You need a segmentation algorithm to draw a line where the mountains stop and the sky starts, that way y is really a function of x.