Be the first to rate this file! 3 Downloads (last 30 days) File Size: 1.89 KB File ID: #19057
image thumbnail

bwmorph c-mex example

by James Tursa

 

05 Mar 2008 (Updated 05 Mar 2008)

This file is the c-mex equivalent of the example given in the bwmorph.m file comments.

| Watch this File

File Information
Description

bwmorph_example converts the following example taken from the comment section of bwmorph.m to a c-mex file:
 
 BW1 = imread('circles.png');
 figure, imshow(BW1)
 BW2 = bwmorph(BW1,'remove');
 BW3 = bwmorph(BW1,'skel',Inf);
 figure, imshow(BW2)
 figure, imshow(BW3)
  
To create the dll, do the following at the MATLAB prompt:
 
 >> mex -setup
    (then pick any C/C++ compiler, such as lcc)
 >> mex bwmorph_example.c
 
That's it. Now you are ready to use bwmorph_example as follows:
 
 >> bwmorph_example

Three figures should appear on the screen (shown above), which are the same exact figures that appear when you run the example code directly from the MATLAB workspace.

The purpose of this submission is simply to show how to use these functions and get plots from within a c-mex file.

MATLAB release MATLAB 7.2 (R2006a)
Other requirements Any supported C compiler, such as the built in lcc compiler.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
tutorial James Tursa 22 Oct 2008 09:51:57
example James Tursa 22 Oct 2008 09:51:57
bwmorph James Tursa 22 Oct 2008 09:51:57
imshow James Tursa 22 Oct 2008 09:51:57
imread James Tursa 22 Oct 2008 09:51:57
bwmorph example Cristina McIntire 06 Feb 2009 11:16:26

Contact us at files@mathworks.com