You can use the Quick selection tool. It learns as you subtract some extras from the selection by holding Alt as you select and add some missing pars by holding Shift as you select.
After that you can smooth the edge to straighten exessive wrinkles, if needed. Unfortunately it makes some sharp corners round, but you can add them back to the selection with the Polygonal lasso tool (+ holding Shift for add or Alt for subtract). Here's an example of the resulted selection:
Save the selection. You probably need it for masking or conversion to a path. I would add the border by clipping the pattern to another layer and then I would add below it a filled area which is created by expanding the selection few pixels and then painting it full. Here's an example: