If M and N are integers and N%M == 0 then you could use indexing and
dimension "tricks" to collect the values for the new pixels to the first dim

and then apply your preferred interpolation/smoothing operation.


You may find inspiration at https://github.com/PDLPorters/pdl/wiki/Resampling-up-a-piddle


--Chris


On 6/13/2024 8:33 AM, Ed . wrote:
Hi Guillermo,

Try https://metacpan.org/pod/PDL::Transform#match ?

Best regards,
Ed
------------------------------------------------------------------------
*From:* Guillermo P. Ortiz <gor...@exa.unne.edu.ar>
*Sent:* 13 June 2024 12:04 AM
*To:* pdl-devel@lists.sourceforge.net <pdl-devel@lists.sourceforge.net>; pdl-gene...@lists.sourceforge.net <pdl-gene...@lists.sourceforge.net>
*Subject:* [Pdl-devel] decimate function
Hello everybody,
maybe somebody know how to decimate a 2d ndarray
through some average and reducing the number
of pixels from (Nx,Ny) to (Mx,My), (in a 2D image for example?)
where M< N in order to reduce large amounts
of data but remaining main information as possible.

I can imagine how to use the PDL::GSL::INTERP module
for inward interpolation, but it seems that no threading
(broadcasting) is possible with it

Thank you in advance,

Regards


--


Dr. Guillermo P. Ortiz
Electromagnetismo Aplicado
Dto. Física, Facultad de Ciencias Exactas
Universidad Nacional del Nordeste
Avda Libertad 5460, Campus UNNE.
W3404AAS Corrientes, Argentina.
(+54) 379-4424678 interno 4613
gortiz*at *unne edu ar


_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to