Hi Guillermo, That will depend on how you want to combine each pixel. If you can deal independently with each R/G/B value, then to just add the values together, you'd do:
$im = $imn->mv(-1,0)->sumover; Otherwise you'll have to spell out a bit more what you mean by sorting. Another operation that might be useful is "borover" (bitwise or, on each R/G/B value along the sequence of images). Best regards, Ed ________________________________ From: Guillermo P. Ortiz <gor...@exa.unne.edu.ar> Sent: 24 October 2024 4:52 PM To: Ed . <ej...@hotmail.com> Cc: pdl-devel@lists.sourceforge.net <pdl-devel@lists.sourceforge.net>; pdl-gene...@lists.sourceforge.net <pdl-gene...@lists.sourceforge.net> Subject: Re: [Pdl-devel] project ordered sequence image Hello again, thanks to Ed for show me a typo error in my example. Where I wrote $im=$imn->reduce('op',2); it must say $im=$imn->reduce('op',3); But, the question remain in how to do an 'op' that result in a sorted overlapping between all the sub images In other words. Suppose you have n=0 sub image with a red circle and in n=1 a sub image with a blue rectangle. Some pixeles of both images are in common. Then, what I want is to get a composed image that shows the red circle overlapping the blue rectangle. The same idea for many subimages with sorted overlapping. Regards, El jue, 24 oct 2024 a las 9:57, Guillermo P. Ortiz (<gor...@exa.unne.edu.ar<mailto:gor...@exa.unne.edu.ar>>) escribió: Hello Ed, thanks for your reply. That I trying to mean with 'reduce' is some of projection operation (op) like in PDL::Reduce module that performs "(op)over" to reduce to N-1 dimension after some operation over the set of (3,x,y, n) to (3,x,y) rgb images. I mean a composed rgb image from a set of (layer) n rgb images. For example: $imn-> info : pdl D [3,nx,ny,n] $im=$imn->reduce('op',2); $im-> info : pdl D [3,nx,ny] Then, maybe I need to introduce some "sort" operation in order that when I reduce to one composed $im image each layer in $imn overlap the following layer. But, I did not realize how to do that using some pdl trick. Thanks a lot for your help Regards El jue, 24 oct 2024 a las 9:12, Ed . (<ej...@hotmail.com<mailto:ej...@hotmail.com>>) escribió: Hi Guillermo, I believe the situation you're describing is you have effectively a series of (3,x,y) images. You mention "reducing", but you haven't said what you mean by that - would it turn that series of images into one image? wpic is intended to write out a single image, so an ndarray with multiple images won't work with that. To write out a series of images as a movie you could use wmpeg, or just to store the data you could use https://metacpan.org/pod/PDL::IO::FastRaw and specifically writefraw. Otherwise to write each image in its own file you could use something like: $_->wpic(sprintf "img%03d.png", $count++) for $pdl->dog; Does that help? Best regards, Ed ________________________________ From: Guillermo P. Ortiz <gor...@exa.unne.edu.ar<mailto:gor...@exa.unne.edu.ar>> Sent: 23 October 2024 4:42 PM To: pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net> <pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net>>; pdl-gene...@lists.sourceforge.net<mailto:pdl-gene...@lists.sourceforge.net> <pdl-gene...@lists.sourceforge.net<mailto:pdl-gene...@lists.sourceforge.net>> Subject: [Pdl-devel] project ordered sequence image Hello everyone, I have created a pdl with structure (3,size_x,size_y,np) in order to manage different layer features to compose an rgb image. The idea that I can not connect yet is how to "reduce" over dim 3 to project to 3 X s_x X s_y rgb image in ordered fashion sequence. For example, suppose that for np=0, 1 and 2, in the resulting image is only view of 2 that is allowed by 1 and 0 layers, in that order. I am trying to use wpic command from PDL::IO::Pic module to convert via for example pnmtopng using options for it. There are hashes like {FLAGS => options} used for options {CONVERTER => 'pnmtopng'} indicating which conversor to use. But is seems to be intended of rgb 3(4) X s_x X s_y Thanks for your attention 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