Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Steve on Image Processing

December 15th, 2006

Getting MATLAB code from blog postings - An update

Loren and I frequently use the MATLAB publish feature to create our blog posts. Back in October, we started using some JavaScript in our blogs so you could click on a link to get the original MATLAB code. (Look for a link that says "Get the MATLAB code") at the bottom right of many of our posts. Then some readers complained that the JavaScript was messing up the appearance of our posts in the feed-reader software they used.

I believe we have now corrected the problem. JavaScript code inside HTML script tags is now hidden inside HTML comment tags, so it should not appear in browsers or feed readers that do not support JavaScript. If you still see this problem, please let me know what browser or feed reader you use.

6 Responses to “Getting MATLAB code from blog postings - An update”

  1. Ramiro Massol replied on :

    hi Steve
    Everyday I read your blog site to get useful ideas about image processing. I appreciate very much your advices and code that you provide to the community.
    I have a few problems that I have been unable to resolve for a long time. I created a GUI to display a time series of images (16-bit, multiple channels) using gray scale or RGB colormaps. The GUI has a slider to scroll through the different time points of the time series. The GUI has also buttons to allow the user to enter annotations (textboxes and arrows). The problems are the following:
    1) Annotations: after creating an annotation, let’s say a textbox, if I scroll the a different time point of the series the new image will be plotted on top of the annotation. How do I move to the front the pre-created annotation? I haven’t seen that property in the annotation properties.

    2) Colormap problems: the GUI has sliders that control the black shown and white levels of the displayed image. It’s no problem for me to adjust these levels when the images shown are grayscale or more precisely single channel. For instance:
    black level: pixels of equal or lower intensity are shown in black
    white level: pixels of equal or higher intensity are shown as white
    image: 16-bit grayscale
    imshow(image,[black level white level])
    However, if the image that I want to display is an RGB composite (3 channels, each a 16-bit channel), I cannot manage to force pixels whose intensities in one channel are below a certain black level to have no contribution in that specific channel (i.e., let’s say that pixels of the red channel below 200 units should have no redish coloring). My code is the following:
    rgbimage=zeros(imageheight, imagewidth, 3,’uint16′);
    RGBVALUES = [0 0 0;1 1 1];
    % redimagechannel, greenimagechannel, blueimagechannel are 16-bit tiff images
    rgbimage(:,:,1)=redimagechannel;
    rgbimage(:,:,2)=greenimagechannel;
    rgbimage(:,:,3)=blueimagechannel;
    RGB = imadjust(rgbimage,RGBVALUES,[],1);
    axes(gca)
    imshow(RGB);

    I appreciate any help on these issues.
    best regards
    ramiro

  2. Steve replied on :

    Ramiro - I don’t generally give GUI programming advice, but I think for your question 1 you might want to look at the stacking order of the various objects involved. Take a look at the MATLAB function uistack.

    Regarding question 2, try this:

    red = rgbimage(:,:,1);
    red(red < 200) = 0;
    rgbimage(:,:,1) = red;

  3. Anju replied on :

    Hi I am new to this field and I am currently working on a face recognition system.

    I have to display several images inside a panel. I have already created the GUI with two panels but don’t know how to display the images inside one of them. Can you please help me?

  4. Steve replied on :

    Anju—See this page for some getting-started resources on GUI programming with MATLAB.

  5. fuad replied on :

    can i have a code in matlab for image acquisition by a webcam or handi cam.

  6. Steve replied on :

    Fuad—Take a look at Image Acquisition Toolbox.

Leave a Reply


Steve Eddins manages the Image & Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

  • Mikr: I look for answers before asking people… “But we still can’t see the coordinates!...
  • Steve: Mikr—You might want to take a look at the Getting Started section of the MATLAB documentation in order...
  • Mikr: thanks but is it possible to see and write to file (Excel ?) that matrix of pixel coordinates ? instead of...
  • Steve: Mikr—An image in MATLAB is simply a matrix of pixel values. It can be saved (exported) to several common...
  • Mikr: thanks, Steve just started to learn matlab and to clarify matlab saves image files as a matrix of pixel...
  • Steve: Mikr—As far as I know, the commonly used image file formats such as TIFF, JPEG, PNG, etc., do not...
  • Mikr: how to write pixel coordinates in file ?
  • Steve: M.S.—Code for the bwtraceboundaries function ships with the Image Processing Toolbox.
  • M.S.Cheema: i need to know the detailed algorithm for bwtraceboundaries. i want how that function works. so please...
  • Steve: Wagas—It depends on how much memory you have on your computer. You should be able to load a 94 MB TIFF...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.

Related Topics