Stasm (http://www.milbo.users.sonic.net/stasm/index.html) - это библиотека C ++ для поиска объектов на изображении с применением концепции моделей активных фигур.
Я пытаюсь использовать AsmSearchDll, который находится на stasm DLL (stasm_dll), например this в проекте C #. В C ++ прототип -
void AsmSearchDll(
int *pnlandmarks, // out: number of landmarks, 0 if can't get landmarks
int landmarks[], // out: the landmarks, caller must allocate
const char image_name[], // in: used in internal error messages, if necessary
const char image_data[], // in: image data, 3 bytes per pixel if is_color
const int width, // in: the width of the image
const int height, // in: the height of the image
const int is_color, // in: 1 if RGB image, 0 if grayscale
const char conf_file0[], // in: 1st config filename, NULL for default
const char conf_file1[]); // in: 2nd config filename, NULL for default, "" for none
Я использую это в C # с этим
[DllImport(@"..\data\stasm_dll.dll")]
public static extern void AsmSearchDll(
out int pnlandmarks, // out: number of landmarks, 0 if can't get landmarks
out int[] landmarks, // out: the landmarks, caller must allocate
[MarshalAs(UnmanagedType.LPStr)]string imagename, // in: used in internal error messages, if necessary
byte[] imagedata, // in: image data, 3 bytes per pixel if is_color
int width, // in: the width of the image
int height, // in: the height of the image
int is_color, // in: 1 if RGB image, 0 if grayscale
[MarshalAs(UnmanagedType.LPStr)]string conf_file0, // in: 1st config filename, NULL for default
[MarshalAs(UnmanagedType.LPStr)]string conf_file1 // in: 2nd config filename, NULL for default, "" for none
);
Функция начинает читать файлы конфигурации, но затем выходит из программы. Я не могу понять, что происходит. Есть предложения?
С наилучшими пожеланиями