How do I pass C# Bitmap images as MWArrays into my .NET object created with MATLAB Builder for .NET 2.0?
Show older comments
I have the following MATLAB code that performs edge detection on a matrix of image data:
function iprocess(A)
BW=edge(A, 'sobel');
imshow(BW);
I invoke this function in MATLAB as follows:
A = imread('C:\lena.bmp');
iprocess(A)
I am generating a .NET component from iprocess.m using MATLAB Builder for .NET and want to know how to pass a Bitmap image created in C# to this function. This is how I create a Bitmap image in my C# application:
int width = 256;
int height = 256;
Image image = Image.FromFile("C:\\lena.bmp");
Bitmap bitmap = new Bitmap(image, new Size(width, height));
Accepted Answer
More Answers (0)
Categories
Find more on Deploy to .NET Applications Using MWArray API in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!