This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How can Image Analyzer show a gray image?

Hi,

I want to use the Image Analyzer to show a gray image( 320*180 8bit ).

Can any one tell me how to set the properties about Image Analyzer?

Thank you.

 

 

yours

wang

  • Wang,

    Independent of color (not only grey), the configurations need to match the encoding of the image and the way the data is packed in memory. In your example above, if the image is encoded as RGB with no alpha layer and each pixel is stored as RGBRGBRGB..., the pixel stride is 3 and each mask should be 0xFF0000, 0x00FF00 and 0x0000FF respectively (that isolates each component value). The line stride would be the number of pixels per line * pixel stride - in your case that would be 960.

    However, if the image is monochrome then you can choose the simpler Bitonal, which only requires setting the byte order, foreground/background color and the picture size.

    The options for the other formats (Bayer or YUV) have their own specifics, therefore I suggest checking the various references on the internet about the encoding of these images.

    Also, keep in mind the Image analyzer does not read compressed formats (JPEG, GIF, PNG, etc).

    Hope this helps,

    Rafael

     

  • Hi Rafael,

    Thank you for your reply.

    I want to show a 256-color gray image like this (Only 1 channel)

    so I change the properties like this.

    But there is something wrong with the showing Image.

    It seems the image flips upside down with a shift.

    I think the shift maybe the header information of BMP file.

    But how can I flip it back?

     

    Thank you.

     

    yours,

    wang

  • Wang,

    One thing I forgot to mention is that the Image tool does not read headers as well. However, I don't think the header alone would cause this flip. Maybe something in the way the image was stored in memory? Endianess maybe?

    I couldn't experiment with the image you sent, as the browser seems to encode it in 24bpp and not 8bpp. Can you zip the image and send it so I can also try some things?

    Best regards,

    Rafael

  • Hi Rafael,

        Thank you for your reply.

        Here is my image.

        0211.img_mid1.zip

     

    regards,

    wang

  • Wang,

    It seems the .BMP image has a lot of header information, as I could display an exact copy of the original image with an offset of 0x436 bytes. By applying this offset to the start address parameter I removed the vertical offset and a few corrupted lines (which were, in fact, still header information).

    However, I read in this article that .BMP images are stored "bottom up" - i.e., the first line of the image is the bottom line. This explains why the image is inverted in memory. For this issue there is no easy workaround - you may try to create a parser that removes both the header information and inverts the image before loading it to the target.

    Check the picture attached. It shows the parameters I used to display the image, as well as the last position of the image in memory (at address 0x8000E535).

    Hope this helps,

    Rafael

     

  • Thank you very much Rafael.

  • HI,

     I too have the same problem , can u direct me where can i get study material for deep image analyzer. ., i cant able to plot a single image in image analyzer. please help me to do my task as soon..