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: 
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)`.
The code for drawing a rectangle on an image is:

```
cv2.rectangle(image, pt1, pt2, color, thickness)

```

where `pt1` is starting point-->(x,y) and `pt2` is end point-->(x+w,y+h).