Continue to Site

# Need some algorithms for distortion processing

Status
Not open for further replies.

#### DanDo

##### Newbie level 3
My problem is: I have a set of 4 points O, A, B, C locating on a surface. Due to distortion of that surface, A, B, C are moved to new positions which are A', B', C'. Now I want to find new position of O (supposed O') satisfying root mean square error (RMSE) of two set of distances (O'A', O'B', O'C', OO') and (OA, OB, OC, OO) is minimal. So dose anyone know which algorithm can solve my problem?

##### Super Moderator
Staff member
The smaller OA, the more A influences O. (Similarly with B, C.)

I don't know how to do root mean square error, but this is how I would calculate the motion of point O. The method is to determine how much percentage weight each point holds, in its influence on O.

Add 1/OA + 1/OB + 1/OC. Take the reciprocal. Call the result Z. (Identical to the formula used to find the equivalent R of resistors in parallel.)

Calculate a weighting factor for each point's motion. For point A, this is Z /AO. Etc.

Move O in proportion to the weighting factor for that point.

- - - Updated - - -

Example, if the weighting factor for A is 33%, then move O parallel to AA', for a distance of 33% of AA'.

Etc.

DanDo

### DanDo

Points: 2

#### andre_luis

##### Super Moderator
Staff member
Perhaps another approach could be seeing the set of 2D vectors (O'A',O'B',O'C') as the projection of the set of 2D vectors (OA,OB,OC), each one at a different surface and perspective. There should have some algebraic matrix description of these vectors in the geometric representation over coordinates x,y.

#### DanDo

##### Newbie level 3
The smaller OA, the more A influences O. (Similarly with B, C.)

I don't know how to do root mean square error, but this is how I would calculate the motion of point O. The method is to determine how much percentage weight each point holds, in its influence on O.

Add 1/OA + 1/OB + 1/OC. Take the reciprocal. Call the result Z. (Identical to the formula used to find the equivalent R of resistors in parallel.)

Calculate a weighting factor for each point's motion. For point A, this is Z /AO. Etc.

Move O in proportion to the weighting factor for that point.

- - - Updated - - -

Example, if the weighting factor for A is 33%, then move O parallel to AA', for a distance of 33% of AA'.

Etc.

Oh, very helpful, I'll try it. Have you applied it to any geometric problem before?

#### DanDo

##### Newbie level 3
Perhaps another approach could be seeing the set of 2D vectors (O'A',O'B',O'C') as the projection of the set of 2D vectors (OA,OB,OC), each one at a different surface and perspective. There should have some algebraic matrix description of these vectors in the geometric representation over coordinates x,y.

Thank andre_teprom! But if sounds so complex to code. I'm looking for an algorithm with matrices like that, )

#### andre_luis

##### Super Moderator
Staff member
Let's call vectors <OA, OB, OC> as V, and <O'A',O'B',O'C'> as V', where all points are given constant values. I believe that you should perform the RMSE calculation from V to V', but at the origin of V', just add an offset variable X' and Y'. This would implicitly take into account the OO' shift.

##### Super Moderator
Staff member
Oh, very helpful, I'll try it. Have you applied it to any geometric problem before?

I use an identical algorithm in my homebrew circuit simulator, to derive the voltage at a node, as it is influenced by neighboring nodes.

It sees each neighboring node through a certain resistance, sending a particular voltage.

- - - Updated - - -

I calculate the weighting factor for each node, and multiply that times the voltage it sends.

- - - Updated - - -

Notice that a low resistance has great influence. This is similar to a point that is close to point O. It has great influence on point O.

However a distant point has little influence on point O.

Status
Not open for further replies.