Re: [Pdl-general] [Pdl-devel] replace very small numbers

2022-05-05 Thread Ingo Schmid


HI,

Use the comparison operator to create a mask and multiply it onto your data.

$gr= abs (grandom (5,5))

p $gr*($gr>0.1)

[
 [ 1.1689305  1.2499314 0.71939273  0 0.73171201]
 [0.31795298  1.0656512 0.32072078 0.58750721 0.36339994]
 [ 0  2.0256596  1.1261147  1.0729967  1.7958531]
 [0.28044179 0.45181403  1.3248066 0.97292087 0.29573919]
 [ 0 0.29361551  1.0373939 0.25552433 0.10957606]

Ingo

On 5/5/22 17:21, Zakariyya Mughal wrote:

On 2022-05-05 at 10:57:53 -0300, Guillermo P. Ortiz wrote:

Hello,
somebody know if there are a quick way
to set all very small number to zero into a ndarray?

Hello,

If I understand correctly, I believe that you can achieve this using the
`where` function  to
create a mask.

Cheers,
- Zaki Mughal


Regards


--


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



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



___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general
___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] [Pdl-devel] replace very small numbers

2022-05-05 Thread Zakariyya Mughal
On 2022-05-05 at 10:57:53 -0300, Guillermo P. Ortiz wrote:
> Hello,
> somebody know if there are a quick way
> to set all very small number to zero into a ndarray?

Hello,

If I understand correctly, I believe that you can achieve this using the
`where` function  to
create a mask.

Cheers,
- Zaki Mughal

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


> ___
> pdl-devel mailing list
> pdl-de...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdl-devel



___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general


Re: [Pdl-general] PDL::OpenCV update

2022-05-05 Thread Ingo Schmid

Hi

kudos to Ed for carving out a full module from my proof of concept level
code.

For those trying this WIP package, keep reading. This is not yet a
release, no Ed?

There appears to be an issue with the typemap.

heiner:[PDL-OpenCV]$ make
make[1]: Entering directory '/data/ingo/git/PDL-OpenCV/Tracker'
"/usr/bin/perl" "-I/usr/local/lib/x86_64-linux-gnu/perl/5.34.0"
"-MPDL::PP=PDL::OpenCV::Tracker,PDL::OpenCV::Tracker,Tracker,," tracker.pd
The type =PDL__OpenCV__Tracker= does not have a typemap entry!
make[1]: *** [Makefile:859: Tracker.pm] Error 255
make[1]: Leaving directory '/data/ingo/git/PDL-OpenCV/Tracker'
make: *** [Makefile:542: subdirs] Error 2
heiner:[PDL-OpenCV]$ grep -Ri tracker typemap
PDL__OpenCV__Tracker   T_PTROBJ_SPECIAL

On my box it doesn't look at the top level typemap file in the
subfolders. I can get by this error when copying the typemap file into
the Tracker folder. That is then followed by the same error for
VideoCapture and VideoWriter.

Fixing these, the t/opencv_basic.t is segfaulting. I guess this test
file is obsolete since MatWrapper is a transient thingy now? In this
case, it should be deleted.

Conceptually, wouldn't it be better to have a typemap file for each
module in its own folder instead of the kitchen sink top-level typemap?

Ingo

On 5/5/22 01:58, Ed . wrote:


Hi pdl-general folks,

A quick update on this: Ingo and I are still working on it. The build
process has been simplified so that the local C/C++ wrapper is part of
the main project and the build is a normal PDL-ish one. The repo URL
is now https://github.com/PDLPorters/PDL-OpenCV (the previous URL will
redirect to that).

There is now a skeletal wrapper-generation structure in place, both
for the C-wrapper and the PDL PP functions. Once the rest of the
Tracker-updating code has been unpicked so that it can be done from
Perl via generated wrapper, and the wrapper-generators are
generalised, the Python binding-generator’s data (see my script on
https://github.com/PDLPorters/pdl/issues/362) will be able to be used
to generate a PDL binding for a fairly large part of OpenCV (indeed,
it looks like it will be straightforward to bind a larger part than
“gocv”, the current Go binding, does).

Best regards,

Ed

*From: *Ingo Schmid 
*Sent: *19 April 2022 10:50
*To: *perldl 
*Subject: *[Pdl-general] PDL::OpenCV update

Hi

I just pushed a new version to github.

https://github.com/fantasma13/PDL-OpenCV.git

It should be working at least on linux. Please read the INSTALL
document. It is a two step process.

It is basic but works.

Ingo

___
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general