[Gdal-dev] Guess the pixels and rows of raw image

Joaquim Luis jluis at ualg.pt
Fri Oct 31 11:28:37 EST 2003


Frank Warmerdam wrote:

> Chen, Fu wrote:
> > Hi! In Gdal, every raw image should has a header to describe its pixels and rows. But in photoshop, it will guess the
> > pixels and rows automaticly. I think it decide the size by the relation of nearby rows. Is there any resource or code
> > on the web that we can add a guess feature in the gdal? In some situations we don't have a standard header for raw
> > image, if we have a gdal tool it will generate a bil header automaticly,  we needn't to write new raw format driver.
>
> Fu Chen,
>
> While I believe there is going to be a dialog developed for OpenEV which
> allows a user to describe the format of a raw file, I was not aware of any
> dependable way to "guess" the layout of raw files.  If it is easily done it
> would be good to incorporate into that tool.
>
> I wouldn't want to have GDALOpen() try to guess raw file layout on it's own
> though.  To dangerous.
>

Hi,
About a year ago I started a discussion in the GMT mailing list with exactly the same question.
Unfortunately no one new the clever photoshop algorithm.
I ended up with a solution based on FFTs, but:
1 - it's potentially slow
2 - it doesn't always guess the correct answer (though it does for many of times).

J. Luis




More information about the Gdal-dev mailing list