From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Roundness calculations

Solved!
Go to solution

elset191 wrote:
You can just do a rotation of all the points ...

That sounds a little easier said than done. Smiley Very Happy

Is there an easy way to do that?

Cory K
0 Kudos
Message 11 of 24
(2,260 Views)

Mathematics -> Geometry -> 2D Cartesian Coordinate Rotation.

 

Of course when I did it way back when I didn't know about this VI so wrote it myself.

--
Tim Elsey
Certified LabVIEW Architect
Message 12 of 24
(2,256 Views)

Hi Cory,

 

I think that with

Center x-value = [(max x-value)+(min x-value)] / 2

Center y-value = [(max y-value) + (min y-value)] / 2

 

you wil calculate the center point of the minimum circumscribed BOX, not circle!

If by any luck, your box is a square then it's ok but I'm pretty sure that it will never be the case 😞

Message Edited by Alain S on 06-02-2009 10:47 AM
0 Kudos
Message 13 of 24
(2,244 Views)

You should be able to pose this as a sort of constrained optimization problem.  The LS circle is just the unconstrained solution (minimize the LS distance between the datapoints and the circle).  For the maximum inscribed circle the constraint is that no datapoint should lie inside the circle (distance from any datapoint to the circle center must be greater than the circle radius).  For the minimum circumscribed circle all datapoints should lie inside the circle (distance from any datapoint to the circle center must be less than the circle radius).  The constrained nonlinear optimization.vi should be able to solve this problem.

0 Kudos
Message 14 of 24
(2,221 Views)

I found a way to calculate MCC Smiley Surprised

Start the VI and.......................have a break 🙂

 

So now I need a) a super computer or b) valuable data reduction

I'll go for the last one and also a way to find MIC & MZC, keep you posted guys ... ... ...

 

 

I took a rough look at the constrained nonlinear optimization.vi but I don't know yet how to translate the constraints you mentioned into LV code 😞

Can you help a little bit more DSPGuy?

 

Regards

Alain

0 Kudos
Message 15 of 24
(2,205 Views)
Solution
Accepted by Alain_S
Okay,  I implemented a first pass at the MCC and MIC using the constrained optimization VI.  I modified your original VI, and now display the MCC and MIC on the same graph as the same graph as the data and the LS circle.  I commented the model functions so the mapping is clearer (I hope).  Performance seems pretty good, with both circles being found within 700 mS or so on my desktop machine. 
Message 16 of 24
(2,178 Views)

Thanks DSPGuy for your efforts!

I'll have to install V8.6 first, I have the CD's somewhere but......... can't find them right now Smiley Sad

 

 

Forget about my version because there's an inadmissible error in the both centre point and radius.
it looks good on a graph but when zooming in it isn't anymore 😞

I have a dataset with known values for centerpoint and radius and the error I get is too large 😞

 

As soon as I have V8.6 installed I will test your code with the same dataset and let you know the outcome!

 

Thanks for your help so far

 

Regards

Alain

0 Kudos
Message 17 of 24
(2,162 Views)
Reposting code saved for LabVIEW 8.21. 
0 Kudos
Message 18 of 24
(2,143 Views)

Thanks for the "earlier" version but I already have 8.6 installed and translated to V8.5. I

 also did some caculations.

A first sight it's ok but with some objects I don't get an answer for MIC or MCC or even both.

It seems that how the more unround a shape is or the more spread there is in the data, the more critical it is to set correct start parameters.

 

I'll make a vi with some datasets to explain the above.

 

To be continued... ...

0 Kudos
Message 19 of 24
(2,137 Views)

As promised a vi with some datasets that genereates errors instead of answers Smiley Surprised

I'll have a closer look at that vi in the week-end ...

0 Kudos
Message 20 of 24
(2,117 Views)