How can I save an Image from memory using a pointer?

3 ビュー (過去 30 日間)
Sridutt Nayak
Sridutt Nayak 2013 年 1 月 7 日
Hello I am using DCU224M from Thorlabs.
What I have done
I have written a code in C++ using APIs to capture and save image. Using:
is_AllocImageMem (HIDS hCam,INT width, INT height, INT bitspixel,char** ppcImgMem,INT* pid) - Allocates memory
is_SetImageMem (HIDS hCam, char* pcImgMem, INT id) - Clear memory and make it available for storing
is_FreezeVideo (HIDS hCam, INT Wait) - Captures Image
is_SaveImageMem(HIDS hCam, const IS_CHAR* File); - Saves Image to a file mentioned.
What I have to do
The saving to file takes lot of time so I don't want to do that.
Is there a possible way of passing these to Matlab so that I can read image from memory directly in Matlab?
No Active-X Controls. I can't use inbuilt imaqdevice - there are other controls available via C APIs which I need(Ex: Exposure time, FPS etc,).

採用された回答

Sridutt Nayak
Sridutt Nayak 2013 年 1 月 9 日
Solved using Mex.
I wrote the code in .cpp, compiled using mex. Then returned the values using mxCreateDoubleMatrix.
I followed:
  1 件のコメント
Hurter
Hurter 2013 年 1 月 23 日
Hi Sridutt
Just for clarity. Is it still 2 different program running, MATLAB and your C++ program or did you compile your C++ code with mex and call that from MATLAB?
Thanks in advance

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by