<div class="gmail_quote">On 17 September 2012 23:31, Wanderer <span dir="ltr"><<a href="mailto:wanderer@dialup4less.com" target="_blank">wanderer@dialup4less.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I need to divide a 512x512 image array with the first horizontal and vertical division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit want to start at the edges and create a bunch of same size arrays. Is there a command to chop off different sized arrays?<br>
</blockquote><div><br></div><div><span style="color:rgb(34,34,34);font-size:10px;background-color:rgb(255,255,255)"><div><font face="courier new, monospace">hsplits = [49]</font></div><div><font face="courier new, monospace">sum_hsplits = 49</font></div>
<div><font face="courier new, monospace">while sum_hsplits < 512:</font></div></span></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><span style="color:rgb(34,34,34);font-size:10px;background-color:rgb(255,255,255)"><div>
<font face="courier new, monospace">hsplits.append(sum_hsplits)</font></div></span></div></div><div class="gmail_quote"><div><span style="color:rgb(34,34,34);font-size:10px;background-color:rgb(255,255,255)"><div><font face="courier new, monospace">sum_hsplits += 59</font></div>
</span></div></div></blockquote><span style="font-family:'courier new',monospace;background-color:rgb(255,255,255);color:rgb(34,34,34);font-size:10px"><div><span style="font-family:'courier new',monospace;background-color:rgb(255,255,255);color:rgb(34,34,34);font-size:10px"><br>
</span></div>np.split(np.random.rand(512), hsplits)</span><div><font color="#222222" face="courier new, monospace"><div><font color="#222222" face="courier new, monospace"><br></font></div></font><div class="gmail_quote">
<div><span style="background-color:rgb(255,255,255)"><div style="color:rgb(34,34,34)"><font face="arial, helvetica, sans-serif">If I understand correctly, this is a one-dimensional version of what you want. Extending this to the second dimension should be quite easy.</font></div>
<div><font face="arial, helvetica, sans-serif"><font color="#222222">However, I am not sure if I do understand what you want. Could you elaborate on what you are trying to achieve?</font></font></div></span></div></div></div>