Thread: Read an image to Matrix in visual c++ 6.0???

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    4

    Smile Read an image to Matrix in visual c++ 6.0???

    I have a problem about read an image to matrix. Plz Someone can help me!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    4
    I have an image with 100x100. I want to read it to matrix. I read some infomation from web pages but not found that I need. Do you know a libary function can resole this problem?? I'm studying c++ programming

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Can you open and close the file?
    Can you write the code to Hex Dump the data?
    If you can do these things, then we don't need to tell you about how to open/read/close files, because you can do that much yourself.

    Have you written any code to deal with declaring a matrix?
    - as a 2D array (C style)
    - as a vector<vector> of some type (C++ style)
    If you can do these things, then we don't need to tell you about these either

    Which kind of image file is it? There are many -> Image file formats - Wikipedia, the free encyclopedia

    In other words, you need to write some code up to the point you get stuck, and then ask a specific question about what happens next.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Oct 2011
    Posts
    4
    I studied techniques programming
    I can open and write the text file, do operation on 2d array...
    I want to read an image as *.jpg,..
    I will write the code in c++, when I added a path of image file, then I press enter, It's show 2d array as interger about information of it.
    Finally, I will use it for some other case.
    Last edited by sukuku; 10-03-2011 at 08:46 AM.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Upgrade your IDE.
    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.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Then you'll want to use a library to do all the low-level math (or high-level math, depending on your point of view).
    libjpeg - Wikipedia, the free encyclopedia
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Convert image to matrix
    By prefix in forum C++ Programming
    Replies: 1
    Last Post: 09-05-2011, 03:57 AM
  2. Advice on raw image matrix matching
    By ejok in forum C++ Programming
    Replies: 1
    Last Post: 06-01-2011, 01:14 PM
  3. Image opening with Visual C++
    By george7378 in forum C++ Programming
    Replies: 16
    Last Post: 06-16-2010, 04:55 AM
  4. Replies: 13
    Last Post: 11-20-2009, 04:43 PM
  5. Read Image to a Matrix
    By scrapedbr in forum C Programming
    Replies: 3
    Last Post: 05-02-2003, 03:53 PM