Trouble processing LAndSat 8 image

pat scarth
  • pat scarth

    pat scarth - 2013-06-06

    I have been using the Admance Imigery Library to process Landsat 5 and landsat 7 data. IT has been working GREAT!!!

    However, it hicups on LandSat 8 data, which are GeoTiff images with 16 bit pixels.

    The following code returns clr_val = -1 and Error_get_last returns "Failed to successfully get the color value of the pixel located at X,Y : 3000,3000"

    Link to a LAndSat 8 image:

    ' test code
    Dim src_file = "\pasco002\DATA\LandSat_8\2013\152\LC80300362013152LGN00_B2.TIF"
    Dim h_src, clr_val, rtn_red, rtn_grn, rtn_blu As Integer
    Dim err As String
    Dim g_src As New AdvImgLib_NET.cAdvancedImagery

    g_src.IO_LoadImage(src_file, h_src)
    err = g_src.Error_GetLast ' ==> "nothing"

    clr_val = g_src.Color_GetPixel(h_src, 3000, 3000, rtn_red, rtn_grn, rtn_blu)
    err = g_src.Error_GetLast ' ==> "Failed to successfully get the color value of the pixel located at X,Y : 3000,3000"



  • Carsten Klein

    Carsten Klein - 2013-06-07

    Hi Pat,

    although Advanced Image Library may be based on FreeImage, this is probably not the place to request support for it.

    Nevertheless, I have downloaded you image and tried to get you pixel's color. However, I can only guess that AIL's Color_GetPixel method directly relies on FreeImage's FreeImage_GetPixel function, which is only supported for images of type FIT_BITMAP, that are "standard" images, like palletized images (1 <= bpp <= 8) and 16, 24, or 32 bpp RGB(A) images. The function fails (returns FALSE) for images of any other image.

    Since your image is of image type FIT_UINT16 (2), which is an array of unsigned short (unsigned 16-bit), you can''t get any pixel value from FreeImage_GetPixel.

    You have to access the image's scanline's directly in order to get your pixel's values.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks