How to add an edge to ROI by scripting?

I have a script that can detect edges of the image. I need a command or a piece of code to add the detected edges to the ROI.
Any help would be appreciated.

  • What do you mean by “edge” here? If you say “edge of the image”, I understand something that doesn’t require detection: the border rectangle of the image.

I understand that you somehow detected edges in your image, so:

  • What’s the output of your script? A line selection? A binary mask? A set of coordinates?

If you want to get useful advice, please be more concise in asking questions. (Spend at least the amount of time in formulating your question that you expect others to spend on a reply.)