78Views2Replies

Author Options:

Pixel by Pixel Image? Answered

There are many uses for a pixel by pixel image generated using simple values, however there doesn't seem to be an easy way to do it.  I have used excel and its shading by value feature, but this isn't always the most effective method.  So assuming you have two coordinates and a value between 1 and 1000 (like a temp or rf intensity) how would one easily create an image from this data (array or matrix).
Matlab or Mathematica?

The goal is to make a kind of radio telescope that measures rf intensity with an arduino and then creates an image based on the values spread across a matrix.

Discussions

0
Jack A Lopez
Jack A Lopez

4 years ago

Matlab, and also Octave (the free version of Matlab), have tools for image manipulation.

In either of those languages, the sort of basic data element is, generally, a m-by-n matrix, a 2-dimensional array of numbers, with m rows, n columns. It's a language made for working with matrices, hence the name, Matlab, an abbreviation of "Matrix Laboratory", I think.

Regarding images, a greyscale image, e.g. 1024-by-768 pixels, sort of naturally becomes a matrix with 768 rows and 1024 columns. Or 1024 rows and 768 columns would work too. Really, it's up to you, the programmer, to remember which way is up-down, and which is left-right.

For color images, naturally you need three matrices, one for each R,G,B, channel.

By default, Matlab's, or Octave's, matrices are complex valued, but I think it is possible to intentionally define something more simple, and less memory intensive, like integer valued matrices.

The other thing I should mention is, there is kind of a big learning curve for just getting started with Matlab or Octave.

However, you mentioned Matlab by name, so maybe you've already got it, or your school, or employer, has it. I am guessing you would be using it through your school or employer since the actual full, usable, version of name brand Matlab(r) is too expensive for mere mortals. Or this was true the last time I checked.

Which is why everyone else uses GNU Octave, which is free, um, here:

https://www.gnu.org/software/octave/

If you have Matlab or Octave in front of you, and assuming you already introduced to how to use Matlab or Octave, then you can open up the help for the image manipulation toolbox, and see what it's got for you.

Actually, come to think of it, you probably don't even have to have Octave installed to browse through the documentation for one of the toolboxes, if you want to, here:

The first link is the top-level TOC of the Octave manual. The second link is the chapter for the image processing toolbox.

https://www.gnu.org/software/octave/doc/interprete...

https://www.gnu.org/software/octave/doc/interprete...