select area (square) from an image using Python

Job ID: 33895191

Budget: $10 – $30 USD

I'm trying to extract 3 random areas from the image (lungs image) these areas are indicated in the soft tissues, each area will be a square of specific height and width e.g. 10mm for width and height, as shown in the image 1

in image 1 for more clarification I selected where the soft tissues located, they are the Homogeneous color

as seen in the image 2 also the area is Homogeneous which means it only includes the same color (soft tissues in the case)