Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Cropping image parts through list of lists
Replies: 2   Last Post: Mar 19, 2013 1:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Vince Virgilio

Posts: 135
Registered: 4/30/05
Re: Cropping image parts through list of lists
Posted: Mar 19, 2013 12:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Wednesday, March 13, 2013 4:18:03 AM UTC-4, TDMF HT wrote:
> Newbie with OOP way of thinking, so bear with me :) Thank you !
>
>
>
> Given - list of lists:
>
>
>
> myList = { { {0,100},{50,100},{800,600} } , { {{100,100},{150,100},{1024,768} } }
>
>
>
> Using the above list of lists, I want to crop two different parts from a single image an resize the resulting partial image in the following way;
>
>
>
> Cropped image 1:
>
> cropXY: 0,100/50,100
>
> resize: 800,600
>
>
>
> Cropped image 2:
>
> cropXY: 100,100/150,100
>
> resize: 1024,768
>
>
>
> My OOP way of thinking tells me to iterate/loop over the outer and inner lists.
>
> This doesnt seem to be the Mathematica way, so I spent the last couple of hours messing around with
>
> DO/TAKE etc. and all image related functions.
>
>
>
> I dont seem to find the right way to sequentially go over the inner lists and crop/resize the two parts from the single image.
>
> Id really appreciate a few tips on how to get this done.
>
>
>
> Thanks a bunch !!!!


Maybe

newImages = MapThread[ cropFunction, { img1, img2 }, { parm1, parm2 } ];

where

cropFunction[img_, { cropX_, cropY_, resize_}] := Module[{...}, newImage = ...; newImage ];

does the work.





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.