2019-03-29 03:04:51 -0600 | received badge | ● Famous Question (source) |
2017-05-30 11:29:33 -0600 | received badge | ● Student (source) |
2017-02-26 11:52:03 -0600 | received badge | ● Notable Question (source) |
2016-12-06 21:53:45 -0600 | received badge | ● Famous Question (source) |
2016-10-24 09:04:20 -0600 | received badge | ● Popular Question (source) |
2016-05-30 12:44:50 -0600 | received badge | ● Notable Question (source) |
2016-02-23 16:31:07 -0600 | received badge | ● Popular Question (source) |
2015-02-24 00:58:26 -0600 | commented question | Convert DLL IntPtr to byte[] to bitmap @berak I tried that, thanks! but nothing loaded in the PictureBox. I debugged the code and the value ptr changes to indicate that it received something. I've been doing some more reading. . .is it not because char * in C++ is unmanaged and cannot be interpreted by C#? |
2015-02-23 08:38:46 -0600 | commented question | Convert DLL IntPtr to byte[] to bitmap @berak thanks for your response, the Bitmap constructor does not take IntPtr, it takes a System.Drawing.Image type. I tried to cast it but no luck @Eduardo I need to do this exercise because later I am going to read the image using emgucv and send it C++ for processing using opencv. Your next question might be to just use Emgucv since its equivalent to opencv and has most methods wrapped. Well I might just do that . . .port everything to C# Emgucv and compromise performance. |
2015-02-23 03:45:24 -0600 | asked a question | Convert DLL IntPtr to byte[] to bitmap Initially I thought to send an image from C++ opencv to C# required converting the opencv mat to an equivalent emgucv object. I have come to learn that it just requires unpacking the mat object to a type that C# can understand, which is uchar . . .apparently same as byte in C# I have a C++ program that reads and an image and converts it to uchar (which is what a Mat object is anyway). In the main program I assign a Mat object to the returned value from BytesToMat() and image looks fine. My DLL looks like below Just by the way; I firstly started by assigning the pointer to uchar (in C++) with a simple text and displayed it C# by Marshaling returned IntPtr (from dll) to PtrToStringAnsi and it worked. The only difference now is that the returned IntPtr contains address to image data which I want to turn to byte[] and then it will be easy to convert to Bitmap. How can I do that? |
2015-02-23 01:32:04 -0600 | received badge | ● Scholar (source) |
2015-02-23 01:32:01 -0600 | commented question | c++ convert uchar * to opencv mat Thanks, the link was 'slots' helpful although there parts I find confusing there but I will read some more as I am still leaerning |
2015-02-23 01:28:45 -0600 | commented answer | c++ convert uchar * to opencv mat Thanks for your response. I have made modifications as below |
2015-02-22 15:28:59 -0600 | asked a question | c++ convert uchar * to opencv mat I have converted a cv::Mat object to uchar * I now want to convert the uchar* back to Mat object. I tried using the Mat clone function but I don't really understand all the parameters for the default Mat constructor. And then I read somewhere that I can just use the default Mat constructor but I don't know what that last parameter (size_t step) means. How do you convert uchar * back to Mat object? The image is a colour image by the way |