Question: I am working with Express and mongoose . Don't know why `array.push` is not working . Maybe I am calling it in asynchronous function . 

```
function x(){
    var a = [] ;
    database.auth.distinct('tag',function(err , tagname){
        console.log(tagname); // printing tag names perfectly
        a.push(tagname);

    });
       console.log("a =" ,a); // printing an empty array 
    /*for(var x = 0; x< a.length ; x++){  //so this block is not working .
        database.auth.count({ 'tag' : a[x] },function(err, nish){
            // a[tagname[x]] = nish.length ;

        });*/

   // }

```

Answer: 
please don't try with the old cv module, use cv2:

```
import cv2

cv2.rectangle(img, (x1, y1), (x2, y2), (255,0,0), 2)

x1,y1 ------
|          |
|          |
|          |
--------x2,y2

```

[edit] to append the follow-up questions below:

```
cv2.imwrite("my.png",img)

cv2.imshow("lalala", img)
k = cv2.waitKey(0) # 0==wait forever

```
As the other answers said, the function you need is `cv2.rectangle()`, but keep in mind that the coordinates for the bounding box vertices need to be integers if they are in a tuple, and they need to be in the order of `(left, top)` and `(right, bottom)`. Or, equivalently, `(xmin, ymin)` and `(xmax, ymax)`.