Circle around an Object (instead of blob bounds)

Tjendol's icon

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.

Tjendol's icon

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.

Tjendol's icon

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

Emmanuel Jourdan's icon

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

Tjendol's icon

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...

Zachary Seldess's icon

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

Max Patch
Copy patch and select New From Clipboard in Max.

Tjendol's icon

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...

Zachary Seldess's icon

You need to open the patch in Max5.

best,
Zachary

Tjendol's icon

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...

Tjendol's icon

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.