Hi Ingo,

Sorry for having left this a long time.

Recently I added lots of tests and some changes to PDL::Transform, now 
available in PDL 2.104. You say "restore that feature" of being able to invert 
a non-square matrix, but that is not mathematically possible, and main PDL does 
not have a pseudo-inverse capability. That would not particularly help with the 
case you mention, since it is not easily possible to reconstruct 3D coordinates 
from a 2D projection. I believe the closest you will get is using t_projective 
with a matrix you supply, which will conceptually require you to supply a 
backplane.

Please could you say which version of PDL had the feature you are claiming is 
now not there?

By the way, please could you add failing code on 
https://github.com/PDLPorters/pdl/issues/544, or close it? I can't reproduce 
the problem you report.

Best regards,
Ed
________________________________
From: Ingo Schmid via pdl-devel <[email protected]>
Sent: 25 September 2025 15:31
To: perldl <[email protected]>; pdl-devel 
<[email protected]>
Subject: [Pdl-devel] PDL::Transform matrix


Hi,

I need coordinate transformations from pixel space to real 3D space. 
PDL::Transform is great for this kind of operations. I've got the two vectors 
(and hence a 2x3) matrix, let's call it $tm, of the x and y axes.

Unfortunately, t_linear(m=>$tm) complains that the matrix is not square. The 
docs explicitly say that this should work.

Tested on 2.079 and 2.100.

pdl> $tm=ones(3,2); # That would also scale

pdl> t_linear(matrix=>$tm);
Runtime error: lu_decomp requires a square (2D) PDL
 at matrixops.pd line 897.
    PDL::MatrixOps::lu_decomp(PDL=SCALAR(0x55929b90eb70)) called at 
matrixops.pd line 337
    PDL::MatrixOps::det(PDL=SCALAR(0x55929b90eb70), HASH(0x55929b910d88)) 
called at transform.pd line 2769
    PDL::Transform::Linear::new("PDL::Transform::Linear", "matrix", 
PDL=SCALAR(0x55929ba84d30)) called at transform.pd line 2639
    PDL::Transform::t_linear("matrix", PDL=SCALAR(0x55929ba84d30)) called at 
(eval 472) line

It would be great to restore that feature.

Ingo

_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to