### Circle around an Object (instead of blob bounds)

I was wondering if there’s any way to draw a circle around objects and get the radius of the circle in coordinates, so I know the size of the object.

Right now I use blob bounds which outputs the left, top, right and bottom coordinates, but it isn’t sufficient because when the object rotates, the blob bounding box has a different size.

Update:

The alternative would be to measure the greatest distance from the center of an object to the object edge and output the x and y coordinates of that point. For example: if a rectangle is displayed.

I want to be able to output the coordinates the point of the object which is furthest away from the center. I know how to calculate it, but I don’t know how to fetch the data of this point.

The attachment shows what I’m trying to achieve :-) Hope it’s clear…[img]index.php?t=getfile&id=2124&private=0[/img]

On 5 nov. 08, at 12:43, Tjendol wrote:

> The attachment shows what I’m trying to achieve :-) Hope it’s

> clear…[img]index.php?t=getfile&id=2124&private=0[/img]

You might want to have a look to cartopol and poltocar.

HTH,

ej

Thanks for your answer.

Funny this circle looks exactly like my drawing :) Still I’m stuck with the problem to get this circle to go to most distant point from the center of my object…

Tjendol,

Why not use jit.blobs.centroids? The 3rd plane gives you the area of blob – you can then compute the radius. See below, hope it helps.

best,

Zachary

**all**of the following text. Then, in Max, select

*New From Clipboard*.

```
----------begin_max5_patcher----------
1173.3ocyY1zjaZCFG+r8mBM9TamstHg3sNsy38Xtk6Y1lQ.ZsUBfHfXW2lI
e2qPB1.wxa.af06LFrDXqm++34M48qqWsIjejVtA7mfO.Vs5qqWsRMU8DqZF
uZSJ4XTBoTcaah3oozLwl6zWSPOJTyaWDCxSHYT.qDPJnj16fEqtNO7S+tGt
cxG4YhLRJUco6KXjj1qjUkxqDITgZ4r5b+kr+Sc+Pz11oyIhnCrr8erfFIzp
.46IuL.aoNAsrpOgjGAO78Ufk0t.v5491500Gt6JQPA3uAkeoP7K2+Gu+c+p
I8itT8mWPKkKIQv3YcDqimes7b7UmrZN7hRGN0vPrhZNJp4ErbP6dIzd+6.+
Fn3ePlPFb9cYZEussR7yfGymXhsQzjjvDdzmMnR2fwpRbyr5oD+aNUqkMIrR
IjAad40Kpnf+rV.iOlBq7uv9JzXGnvksaGBEwS58c2iXnKf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wkMgHZHTxYY6QEN.aZjon0N5PrdiSnWFzyTkC9
15+GszWm6
-----------end_max5_patcher-----------
```

I can not seem to open your example. I tried to save it in notepad as test.pat and I also tried directly pasting it into max msp…

You need to open the patch in Max5.

best,

Zachary

Alternative (see attachment)

Say I know the x coordinate of the red dots…(i get this through cv.jit.blobs.bounds which can output the largest x value.

How can I output the y value that corresponds to the red spot?

Basicly I have my x but need to know the y so combined they form the coordinates of the point that’s furthest away from the center of my object.

Once I know this x and y it shouldn’t be a problem to get the length of the line from the center to this point.

Of course you can also see it the other way around…I start with the largest y coordinate…and need to know the x coordinate belonging to this point on the object.

I have no trouble getting the largest x and y coordinate..it’s the second coordinate of each of these largest coordinates of the bounding box corner I’m stuck at…

I tried this but if i’m right…centroids works with mass..i need the actual size of the object…and preferably the length from center to the point that’s at the largest distance from the center.

Forums > Jitter