[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading images from internal char string
From: |
Pantxo |
Subject: |
Re: Reading images from internal char string |
Date: |
Thu, 21 Jul 2016 05:40:46 -0700 (PDT) |
PhilipNienhuis wrote
> Hi,
>
> AFAIK (pls correct me if I'm wrong) Octave can only read images from file
> (or URL, essentially a file as well).
> I'd like to find a way to read images directly from a char string ("text
> file").
>
> For some assignment I need to process a long series of rain radar images
> in PNG format.
> I haul them in using urlread() in "raw" (compressed) form, IOW the very
> same format in memory as it would be on disk. To make an image out of
> them I haven't found a better way yet than to first write them in raw form
> to to disk (fopen, fwrite, fclose), only then to be able turn them into an
> image using imread() to read them back in as an image.
> It would be a lot faster, and save disk space, if the output from
> urlread() could directly be interpreted and turned into an image while the
> "raw" image is still in memory, skipping disk I/O altogether.
>
> Is this possible at all?
>
> Stepping through imread.m I see that control finally passes to binary
> module __magickread__. All the way through there I only see references to
> real files.
> I saw the url option in imageIO.m but that also results in a file on disk
> that is fed to __magickread__ in the end.
>
> Thanks,
>
> Philip
Hi Phillip,
AFAIU Octave never has to deal with raw image headers/data, we rely on
graphics magick to obtain image data in the form of RGB or indexed matrix.
To do the job, you'd have to either implement a png reader your self or use
libpng from an oct file.
Pantxo
--
View this message in context:
http://octave.1599824.n4.nabble.com/Reading-images-from-internal-char-string-tp4678727p4678728.html
Sent from the Octave - General mailing list archive at Nabble.com.