patchGNU Octave - Patches: patch #8824, [octave forge] (image) added...

 
 

patch #8824: [octave forge] (image) added affine2d class

Submitted by:  Guy B <motherboard>
Submitted on:  Mon 07 Dec 2015 10:23:58 PM UTC  
 
Category:  Forge : new feature Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sun 21 May 2017 03:42:39 PM UTC, comment #8:

Consider the following script:

The first 3 command give 1, which is wrong.
The last command fails with an error.

The reasons are:
isTranslation: the check is

check = all ((abs (abs (submatrix) - eye (this.Dimensionality)) < e^-10)(:));

which is wrong - the 2nd abs should be removed. It should be
check = all ((abs(submatrix - eye (this.Dimensionality)) < e^-10)(:));

Since I do not like those e^-10, I would prefer
check = all (abs (submatrix - eye (this.Dimensionality)) < eps)(:));
or even
check = !any (abs (submatrix - eye (this.Dimensionality)) > 0)(:));

Explanation: submatrix should be the Identity matrix (in the accuracy limits), so maybe the check should be different for
the diagonal entries (which should be 1), and the non-diagonal
(which should be 0)

isRigid: The submatrix should be a rotation matrix, without
scale or shear, so its determinant should be 1:
check = abs ((det (submatrix)) -1) < eps;

isSimilarity: The submatrix should be a rotation matrix multiplied by constant, so the condition is something like

s2 = submatrix*submatrix';
ans = all((abs(s2 - s2(1,1)*eye(2)) < ones(2)*eps)(:));

s2 should be the Identity Matrix multiplied by a constant.

When I do
a = invert(affine2d ([1 2 0; 3 4 0; 10 20 1]))
a.T(3,3)-1 = -1.1102e-016
so a.T(3,3) is not 1, and b = affine2d(a.T) fails.
there should be something like
this.T(:,3) = [0; 0; 1];

BTW, line 72 should be:
this.T = inv (this.T);

Avinoam Kalma <avinoam>
Project Member
Sat 20 May 2017 09:53:37 PM UTC, comment #7:

I have reviewed this and made a new class named affine to implement all of affine2d and affine3d in order to reduce code duplication. Only the outputLimits method is still implemented on affine2d and affine3d. Anyone can give a hand there? See the branch affine-classes or

https://bitbucket.org/carandraug/octave-image/commits/branch/affine-classes

@Avinoam

can you be more explicit what was the problems? There was a lot of changes from you, but only a few were required to pass the new tests.

@motherboard

Can I have a proper name and valid email for the copyright notice?

Carnë Draug <carandraug>
Project Member
Wed 12 Apr 2017 07:46:00 PM UTC, comment #6:

I have fixed some problems with affine2d (the inverse was problematic).

Please review.

(file #40380)

Avinoam Kalma <avinoam>
Project Member
Wed 09 Dec 2015 07:38:34 AM UTC, comment #5:

I mean, it is one of the possible arguments for imwarp (which are affine2d, affine3d or projective2d).
And this transform may be either built "by hand" by constructing it with the transformation matrix, or calculated using functions such as imregcorr, imregtform or estimateGeometricTransform.

since Matlab 2013a, it is no longer recommended to use imtransform, which used the transformation structure returned from maketform or cp2tform.

Guy B <motherboard>
Wed 09 Dec 2015 01:58:04 AM UTC, comment #4:

What do you mean with?

> It is used in imwarp, and is returned from functions such as imregcorr, imregtform and estimateGeometricTransform.

Carnë Draug <carandraug>
Project Member
Tue 08 Dec 2015 01:54:06 PM UTC, comment #3:

Added affine3d as well (very similar)

(file #35665)

Guy B <motherboard>
Tue 08 Dec 2015 01:47:19 PM UTC, comment #2:

now the test is actually working...

(file #35664)

Guy B <motherboard>
Tue 08 Dec 2015 12:52:27 PM UTC, comment #1:

fixed a bug in outputLimits, and added a test for it.

(file #35662)

Guy B <motherboard>
Mon 07 Dec 2015 10:23:58 PM UTC, original submission:

affine2d class represents the affine transform of 2d vectors (as of matlab 2013a).
It is used in imwarp, and is returned from functions such as imregcorr, imregtform and estimateGeometricTransform.

Guy B <motherboard>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #40380:  affine2d.m added by avinoam (5KiB - application/octet-stream)
file #35665:  affine2dAnd3d.diff added by motherboard (5KiB - text/x-patch)
file #35664:  affine2d.diff added by motherboard (2KiB - text/x-patch)
file #35662:  affine2d.diff added by motherboard (1KiB - text/x-patch)
file #35658:  affine2d.diff added by motherboard (5KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by avinoam (Updated the item)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by motherboard (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-10 mtmiller CategoryNone => Forge : new feature
        Summaryadded affine2d class => [octave forge] (image) added affine2d class
    2017-04-12 avinoam Attached File- => Added affine2d.m, #40380
        Carbon-Copy- => Added -email is unavailable-
    2015-12-08 motherboard Attached File- => Added affine2dAnd3d.diff, #35665
    2015-12-08 motherboard Attached File- => Added affine2d.diff, #35664
    2015-12-08 motherboard Attached File- => Added affine2d.diff, #35662
    2015-12-07 motherboard Attached File- => Added affine2d.diff, #35658

    Back to the top


    Powered by Savane 3.3