# How to capture an image after contour.draw();?

**URL:** <https://discourse.processing.org/t/how-to-capture-an-image-after-contour-draw/8389>\
**Category:** Libraries\
**Created:** [February 14, 2019, 3:16am UTC](https://discourse.processing.org/t/how-to-capture-an-image-after-contour-draw/8389 "2019-02-14T03:16:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laptophead](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/laptophead/32/2701_2.png) [@laptophead](https://discourse.processing.org/u/laptophead)\
**Post date:** [February 14, 2019, 3:16am UTC](https://discourse.processing.org/t/how-to-capture-an-image-after-contour-draw/8389/1 "2019-02-14T03:16:57Z")

</div>

I am using the “FindContours” example from the OpenCV library.

All works well, but I would like to capture an image after the countours have been drawn. (For further analysis of the the contours.)

So I tried:

```auto
    contour.draw();
    PImage draw = opencv.getOutput();
       image(draw, 0, 0);

```

But I do not get an image containing the green contours.  
I also tried “Get” and “getSnapshot” but none of them captures the contours. What to do?  
Thanks

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 14, 2019, 5:49am UTC](https://discourse.processing.org/t/how-to-capture-an-image-after-contour-draw/8389/2 "2019-02-14T05:49:29Z")

</div>

if

> contour.draw();

show on screen (canvas)  
what you want to see / to store,  
you can make a screenshot:

```auto
String outfilename = "data/screenshot.png";

void setup() {
  size(500,500);
}

void draw() {
 background(200,200,0);
 fill(0,200,0);
 stroke(0,0,200);
 strokeWeight(5);
 circle(width/2,height/2,width/2);
}

void keyPressed() {
 if ( key == 's' ) saveFrame(outfilename); 
}

```
