help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: displaying an image


From: lana frankle
Subject: Re: displaying an image
Date: Wed, 2 Sep 2015 12:43:10 -0700

Nicholas helped me with adding a space to help and doc, and I'm no longer getting an error there.  But the color channel code is still giving me an error.

On Wed, Sep 2, 2015 at 12:26 PM, Nicholas Jankowski <address@hidden> wrote:
On Wed, Sep 2, 2015 at 3:13 PM, lana frankle <address@hidden> wrote:


On Wed, Sep 2, 2015 at 12:08 PM, Nicholas Jankowski <address@hidden> wrote:
On Wed, Sep 2, 2015 at 2:57 PM, lana frankle <address@hidden> wrote:

On Wednesday, September 2, 2015, Nicholas Jankowski <address@hidden> wrote:


On Wed, Sep 2, 2015 at 1:26 PM, lana frankle <address@hidden> wrote:

On Wed, Sep 2, 2015 at 9:00 AM, Nicholas Jankowski <address@hidden> wrote:


On Wed, Sep 2, 2015 at 10:39 AM, James Sherman Jr. <address@hidden> wrote:
On Tue, Sep 1, 2015 at 11:25 PM, lana frankle <address@hidden> wrote:
> Does Octave have the MATLAB function of displaying an image?  I'm trying toW
<snip>
 
P.S.  I just noticed that you image name is a bit ... odd.  Are you
sure that your image file has the suffix ".img"?  Usual suffixes are
.jpg, .jpeg, or .png.  I'm not familiar with the .img format, and I
wonder if that might be a typo.

.IMG is an image format, usually used by proprietary image generation routines. A quick google search turned up the following:
http://www.imageconverterplus.com/how-to-convert/img-jpg/

"There are several variations of the IMG format. It is not a universal format and depends on the software or device that created it. Originally the IMG format was designed for the GEM Paint Program. IMG can be a CD or a DVD mage file similar to an ISO file; it can be an archival format for floppy disks; an image generated by MAC, etc. Its characteristics vary as well, and depending on the format style it supports from 1 up to 24 bits per pixel. Since this image format is very diverse compatibility is the main issue involved. "


SO... it sounds like after getting used to finding and loading your image files, you might have to find a way to convert your image from the IMG format to something Octave can recognize.  I'm not even certain that Matlab can directly open an IMG file, since it seems to be a non-standard format.  Perhaps the system that produced the files also has available image conversion software available?

Nick J.
 
I tried a JPG first and when that didn't work, that's when I tried the IMG, because "IMG" was listed in the error message.

Please remember to copy the help list in the emails.

Anyway, the usage instructions just used IMG to stand for the name of your image file.

when you call help or doc, use a space between help or doc and the function you're looking for help on.  e.g.:

help imagesc
help imread

etc.

So, the first thing is to make sure that you are in the location of your image file so that Octave can find it. In Octave 4.0.0 with the graphical interface, there is a folder tree in the upper left hand corner. you can use that to navigate to your image files. You should see your file in that files/folders list when you are at the right place.  You can also use the command window to navigate, using CD to change directory and PWD to print the current working directory.

Once you're there, you can try imread. Octave will try to guess the filetype from the extension, so I would stick with JPG files first if that's what you have. the command should be:

>> imread('mousebrain.jpg')

'help imread'  will give you more options and parameters you can try to use.

Note, you should probably do some reading of the Octave help to get familiar with the basic operation and syntax. In the Octave 4.0.0 graphical interface, under the command window you should see tabs that say "Command Window" and "Documentation".  click on Documentation and you should be looking at the top level of the User Manual, where you can start with the Introduction and Getting started sections, and then jump around to other areas of interest.

Nick J.
>Thanks, but can you check my other email?  I got the image to display but still had trouble with the help, doc, and color channel displays.

what other email? if you don't copy the mailing list on your replies only the one person you reply to will see the email. I just saw your first one with the attachment, and in that one you're problem with help and doc seem to be that you aren't using them correctly, which I described at the end of my last message.

Also, the convention on this mailing list is to append your replies to the end of the list so that they appear properly in threaded message archives.

You're right, I only sent it to James.  Here it is:
(as I said the first part is working now, or at least, Octave displayed my image in its own window)

>> pwd
ans = C:\Users\David\Downloads
>> addpath("C:/Users/David/Downloads")
>> %read an image
>> A = imread( 'mousebrain.jpg' );
warning: your version of GraphicsMagick limits images to 8 bits per pixel
warning: called from
    imformats>default_formats at line 256 column 11
    imformats at line 79 column 3
    imageIO at line 106 column 11
    imread at line 106 column 30
>> %display an RGB image
>> imagesc(A);
help(imagesc)
error: Invalid call to imagesc.  Correct usage is:

 -- Function File:  imagesc (IMG)
 -- Function File:  imagesc (X, Y, IMG)
 -- Function File:  imagesc (..., CLIMITS)
 -- Function File:  imagesc (..., "PROP", VAL, ...)
 -- Function File:  imagesc ("PROP1", VAL1, ...)
 -- Function File:  imagesc (HAX, ...)
 -- Function File: H = imagesc (...)



Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
mailing list.
>> doc(imagesc)
error: Invalid call to imagesc.  Correct usage is:

 -- Function File:  imagesc (IMG)
 -- Function File:  imagesc (X, Y, IMG)
 -- Function File:  imagesc (..., CLIMITS)
 -- Function File:  imagesc (..., "PROP", VAL, ...)
 -- Function File:  imagesc ("PROP1", VAL1, ...)
 -- Function File:  imagesc (HAX, ...)
 -- Function File: H = imagesc (...)



Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
mailing list.
>> %display each of 3 color channels.
>> figure; imagesc(A(:,:,1)):
parse error:

  syntax error

>>> figure; imagesc(A(:,:,1)):
                             ^

>> figure; imagesc(A(:,:,2)):
parse error:

  syntax error

>>> figure; imagesc(A(:,:,2)):
                             ^

>> figure; imagesc(A(:,:,3)):
parse error:

  syntax error

>>> figure; imagesc(A(:,:,3)):
                            ^

Thanks in advance.


that's why you copy address@hidden on everything. For all I know James and I were duplicating effort trying to help you out.  Have you tried my previous suggestions for why help and doc weren't working?  I don't use the image functions so I don't know about the color channels. likely it's in the help and documentation for the image functions.

Nick J.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]