Drawing the rectangle box can only be done if you store the corners of the box somewhere. You can take a look at the opencv_annotation application on how this is done in OpenCV and C++ but this is highly portable to Python.
Once you have the rectangle, you can get a select area of an image by doing Rect region; Mat small = large(region).clone().
Now perform an edge detector on that smaller image.
If you want you can then overlay this result with the original image by copying the content back.