# I'm in a hurry. Help. This is an OPEN CV 'contour' question

**URL:** <https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508>\
**Category:** Libraries\
**Created:** [April 20, 2021, 1:39am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508 "2021-04-20T01:39:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [April 20, 2021, 1:39am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508/1 "2021-04-20T01:39:13Z")

</div>

I’m in a hurry. Help. This is the OPEN CV’contour’ question.

I want to get the x,y coordinate values for’contour’.

Please tell me a way to get the x,y coordinates. Please.

int x =?  
int y =?

> import gab.opencv._;  
> import processing.video._;
> 
> Movie video;  
> OpenCV opencv;
> 
> void setup() {
> 
> size(1920, 1080);  
> // size(720, 480);  
> video = new Movie(this, “test\_video\_2.mp4”);
> 
> opencv = new OpenCV(this, 720, 480);
> 
> opencv.startBackgroundSubtraction(5, 3, 0.5);
> 
> video.loop();  
> video.play();  
> while (video.height==0) delay(2);
> 
> }
> 
> void draw() {
> 
> image(video, 0, 0); image(video, 720, 0);
> 
> opencv.loadImage(video);  
> opencv.updateBackground();  
> opencv.dilate();  
> opencv.erode();  
> noFill();  
> stroke(255, 0, 0);  
> strokeWeight(3);
> 
> for (Contour contour : opencv.findContours()) {  
> contour.draw();  
> int num = contour.numPoints();  
> float sizes = contour.area();  
> print(contour.getPoints());  
> }
> 
> }  
> void movieEvent(Movie m) {  
> m.read();  
> }

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [April 20, 2021, 7:49am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508/2 "2021-04-20T07:49:09Z")

</div>

I know you are busy but that’s not how you format code - not `”` Button but please use `</>`.

Also this is not a customer support so I don’t think it’s good to emphasize “I’m in a hurry” ☹

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [April 25, 2021, 1:33am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508/3 "2021-04-25T01:33:31Z")

</div>

> [@GWAK](#):
>
> I want to get the x,y coordinate values for’contour’.

I want to get the x,y coordinate values for’contour’.

int x =?  
int y =?

Is there any way?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 25, 2021, 1:45am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508/4 "2021-04-25T01:45:54Z")

</div>

> [@GWAK](#):
>
> I want to get the x,y coordinate values for’contour’.

I would delve into the references and examples that come with the library.  
The repository for this is on GitHub.

`:)`

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [April 25, 2021, 9:08am UTC](https://discourse.processing.org/t/im-in-a-hurry-help-this-is-an-open-cv-contour-question/29508/5 "2021-04-25T09:08:00Z")

</div>

Again, please format your code first 🙂

For contour, I guess this gives you some information:  
[http://atduskgreg.github.io/opencv-processing/reference/gab/opencv/Contour.html#getBoundingBox()](http://atduskgreg.github.io/opencv-processing/reference/gab/opencv/Contour.html#getBoundingBox())
