[SciPy-dev] MCMC, Kalman Filtering, AI for SciPy?
Travis Oliphant
oliphant at ee.byu.edu
Thu Sep 30 16:52:51 EDT 2004
Fernando Perez wrote:
> Travis Oliphant schrieb:
>
>>> 2. The matrixmultiply != bug I recently reported is _very_ serious
>>> for people working with large matrices. I also reported it in the
>>> numpy list, but nobody replied. Since scipy can trivially work
>>> around it with the one-liner I showed, I think this really should be
>>> done.
>>
>>
>>
>> I think you will see that I released a new version of Numeric that
>> fixed this problem. See 23.5
>
>
> Great! But since you didn't mention anything on the list, and my
> telepathy link has been acting up lately, I missed it ;)
Sorry, I assumed you were monitoring releases of Numeric. I should have
said something, or I should let you have my new telepathy upgrade...
>
>
> I also had this old patch lying around, which I sent to the list about
> a year ago. It's far from critical, so feel free to drop it if you
> don't like it/disagree. I'll just paste my old email and reattach the
> patch (I hope it still applies).
>
> here's a simple patch for pilutil which adds a simple 'flatten' option
> to the
> image reading functions imread. Here are the resulting definition and
> docstrings:
>
> In [2]: scipy.fromimage?
> Definition: scipy.fromimage(im, flatten=0)
> Docstring:
> Takes a PIL image and returns a copy of the image in a Numeric
> container.
> If the image is RGB returns a 3-dimensional array: arr[:,:,n] is
> each
> channel
>
> Optional arguments:
>
> - flatten (0): if true, the image is flattened by calling
> convert('F') on
> the image object before extracting the numerical data. This
> flattens the
> color layers into a single grayscale layer. Note that the
> supplied image
> object is NOT modified.
>
>
> In [3]: scipy.imread?
> Definition: scipy.imread(name, flatten=0)
> Docstring:
> Read an image file from a filename.
>
> Optional arguments:
>
> - flatten (0): if true, the image is flattened by calling
> convert('F') on
> the resulting image object. This flattens the color layers into
> a single
> grayscale layer.
>
>
> This is useful in case you want to load straight from an image file
> (jpeg,
> tiff, ...) but you want a single grayscale array to do numerics on. The
> change is fully backwards compatible. I did it because we needed here to
> easily read images for testing some numerical transformations without
> dealing
> with the color channels. It was easier to patch scipy than to tell my
> coworkers to remember to convert every image first :)
>
> Regards,
>
> Fernando.
Seems reasonable. If there are no complaints. I'll add it.
More information about the SciPy-Dev
mailing list