Thread: Please, help me.. How the way to read image in C++

  1. #1
    Registered User
    Join Date
    May 2013
    Location
    Indonesia
    Posts
    1

    Please, help me.. How the way to read image in C++

    I am Arif Lazuardi,

    I will make a program to read the image in C++. And later, the image will represent by array 3D, which (x,y) represent the spatial coordinat of (height*weight) image (pixel) and z represent the intesity of those image (0-255).
    In matlab, the code for do that is --> imread('image.jpg')
    how can I do that in C++?
    please teach me,... thank you..

  2. #2
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    Quote Originally Posted by Arif Lazuardi View Post
    I am Arif Lazuardi,

    I will make a program to read the image in C++. And later, the image will represent by array 3D, which (x,y) represent the spatial coordinat of (height*weight) image (pixel) and z represent the intesity of those image (0-255).
    In matlab, the code for do that is --> imread('image.jpg')
    how can I do that in C++?
    please teach me,... thank you..
    Get a cross-platform image library.
    Btw, it is still a 2D array, not 3D.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There is no standard way of doing it, because the C++ standard library has no function/class for reading and manipulating images. So you will have to, as kmdv suggested, get an imagine library. Then you will have to consult their documentation on how to use it, because it's going to vary from library to library.
    Perhaps a good place to start is Adobe Generic Image Library: Main Page (I have not tested this myself).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to read an 8 bit Raw Image
    By geewhan in forum C++ Programming
    Replies: 7
    Last Post: 07-13-2012, 10:32 PM
  2. read image to 2d matrix???
    By sukuku in forum C++ Programming
    Replies: 3
    Last Post: 10-10-2011, 06:06 AM
  3. Why won't this image be read in from a string?
    By goodbadugly16 in forum C Programming
    Replies: 2
    Last Post: 04-26-2011, 03:07 PM
  4. Replies: 13
    Last Post: 11-20-2009, 04:43 PM
  5. How to read a image in C++?
    By DramaKing in forum C++ Programming
    Replies: 2
    Last Post: 10-26-2001, 12:34 AM

Tags for this Thread