On Sun, Jan 15, 2012 at 19:10, Peter
wrote:
> Hello all,
>
> Is there a recommended (and ideally cross platform)
> way to load the frames of a QuickTime movie (*.mov
> file) in Python as NumPy arrays? I'd be happy with
> an iterator based approach, but random access to
> the frames would be a nice
Hello all,
Is there a recommended (and ideally cross platform)
way to load the frames of a QuickTime movie (*.mov
file) in Python as NumPy arrays? I'd be happy with
an iterator based approach, but random access to
the frames would be a nice bonus.
My aim is to try some image analysis in Python, i
im_flat = im0[...,0]*65536 + im[...,1]*256 +im[...,2]
colours = np.unique(im_flat)
Nadav
From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org]
On Behalf Of Tony Yu [tsy...@gmail.com]
Sent: 15 January 2012 18:03
To: Discussion of Numeric
On Sun, Jan 15, 2012 at 10:45 AM, wrote:
>
> Counting the Colors of RGB-Image,
> nameit im0 with im0.shape = 2500,3500,3
> with this code:
>
> tab0 = zeros( (256,256,256) , dtype=int)
> tt = im0.view()
> tt.shape = -1,3
> for r,g,b in tt:
> tab0[r,g,b] += 1
>
> Question:
>
> Is there a faster wa
Counting the Colors of RGB-Image,
nameit im0 with im0.shape = 2500,3500,3
with this code:
tab0 = zeros( (256,256,256) , dtype=int)
tt = im0.view()
tt.shape = -1,3
for r,g,b in tt:
tab0[r,g,b] += 1
Question:
Is there a faster way in numpy to get this result?
MfG elodw
___
On Sun, Jan 15, 2012 at 3:15 AM, Nathaniel Smith wrote:
> On Sat, Jan 14, 2012 at 2:12 PM, Charles R Harris
> wrote:
>> This sort of makes sense, but is it the 'correct' behavior?
>>
>> In [20]: zeros(2, 'S')
>> Out[20]:
>> array(['', ''],
>> dtype='|S1')
>
> I think of numpy strings as raw
On Sat, Jan 14, 2012 at 11:53 PM, Nathan Faggian
wrote:
> Hi,
>
> I am finding it less than useful to have the negative index wrapping on
> nd-arrays. Here is a short example:
>
> import numpy as np
> a = np.zeros((3, 3))
> a[:,2] = 1000
> print a[0,-1]
> print a[0,-1]
> print a[-1,-1]
>
> In all
On 15/01/12 00:53, Nathan Faggian wrote:
> Hi,
>
> I am finding it less than useful to have the negative index wrapping
> on nd-arrays. Here is a short example:
>
> import numpy as np
> a = np.zeros((3, 3))
> a[:,2] = 1000
> print a[0,-1]
> print a[0,-1]
> print a[-1,-1]
>
> In all cases 1000 is
On Sat, Jan 14, 2012 at 2:12 PM, Charles R Harris
wrote:
> This sort of makes sense, but is it the 'correct' behavior?
>
> In [20]: zeros(2, 'S')
> Out[20]:
> array(['', ''],
> dtype='|S1')
I think of numpy strings as raw fixed-length byte arrays (since, well,
that's what they are), so I wo