View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

3.0 | 2 ratings Rate this file 7 Downloads (last 30 days) File Size: 81.9 KB File ID: #9107 Version: 1.0
image thumbnail

RGB to Black and White



22 Nov 2005 (Updated )

Converts RGB images to black and white images

| Watch this File

File Information

This code converts an RGB image to a black and white image in C with MEX. I this together for a school project and I couldn't find any good examples of MEX with image processing. One note the code is currently hard coded to handle only UINT8, however it should be trivial to convert that data type. Enjoy.

MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements I built this under Windows with VC 2003 & R14SP3, but there is nothing platform or compiler specific about it.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
05 Jun 2009 umer fareed

How it works? I don't know much about how to run MEX file.

Comment only
06 Aug 2008 Anthony Gabrielson

Your right it did just handle grayscale. I threw in a function so it can take the grayscale image and convert it to a black & white.

08 Nov 2007 Matt -

This isn't RGB to black and white, it's RGB to gray scale.

05 Dec 2005

Cleaned up the code a bit.

Contact us