Перейти к содержимому
Compvision.ru
Tema_man

OpenCV и CLR Windows Forms Application

Recommended Posts

Доброго времени суток!

Вопрос такой: необходимо сделать CLR приложение с использованием OpenCV. Я использую Visual Studio 2010. При подключении библиотеки cv.h выдается такой список ошибок:

>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector@HOGDescriptor@cv@@UAEXABV_InputArray@2@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual bool __thiscall cv::HOGDescriptor::read(class cv::FileNode &)" (?read@HOGDescriptor@cv@@UAE_NAAVFileNode@2@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::write(class cv::FileStorage &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?write@HOGDescriptor@cv@@UBEXAAVFileStorage@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual bool __thiscall cv::HOGDescriptor::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?load@HOGDescriptor@cv@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::save(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?save@HOGDescriptor@cv@@UBEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::copyTo(struct cv::HOGDescriptor &)const " (?copyTo@HOGDescriptor@cv@@UBEXAAU12@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::compute(class cv::Mat const &,class std::vector<float,class std::allocator<float> > &,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?compute@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@MV?$allocator@M@std@@@std@@V?$Size_@H@2@2ABV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@5@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::detect(class cv::Mat const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > &,double,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?detect@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@NV?$Size_@H@2@2ABV45@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::detect(class cv::Mat const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > &,class std::vector<double,class std::allocator<double> > &,double,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?detect@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@AAV?$vector@NV?$allocator@N@std@@@5@NV?$Size_@H@2@3ABV45@@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::detectMultiScale(class cv::Mat const &,class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > &,double,class cv::Size_<int>,class cv::Size_<int>,double,double,bool)const " (?detectMultiScale@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@NV?$Size_@H@2@2NN_N@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::detectMultiScale(class cv::Mat const &,class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > &,class std::vector<double,class std::allocator<double> > &,double,class cv::Size_<int>,class cv::Size_<int>,double,double,bool)const " (?detectMultiScale@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@AAV?$vector@NV?$allocator@N@std@@@5@NV?$Size_@H@2@3NN_N@Z)"

1>ANDI_CLR.obj : error LNK2001: неразрешенный внешний символ ""public: virtual void __thiscall cv::HOGDescriptor::computeGradient(class cv::Mat const &,class cv::Mat &,class cv::Mat &,class cv::Size_<int>,class cv::Size_<int>)const " (?computeGradient@HOGDescriptor@cv@@UBEXABVMat@2@AAV32@1V?$Size_@H@2@2@Z)"

1>F:\Desktop\ПГУ\6семестр\Курсач\ANDI_Project\ANDI_CLR\Debug\ANDI_CLR.exe : fatal error LNK1120: 12 неразрешенных внешних элементов

В консольном приложении все работает отлично, а в CLR вот такое выдает Как это устранить?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

lib файлы не подключены скорее всего.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Всё, решение нашел путём подключения абсолютно всех библиотек =)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Спецы по cli, подскажите пожалуйста,почему такие строки:


private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
this->pictureBox1->Image = nullptr;
char* buf=new char[481*3*321];
Image ^Imag = gcnew System::Drawing::Bitmap(481, 321,481*3, PixelFormat::Format24bppRgb,IntPtr(buf));
this->pictureBox1->Image =Imag;
delete Imag;
delete buf;[/code]

выкидывают исключение:

Необработанное исключение типа "System.ArgumentException" произошло в System.Drawing.dll

Дополнительные сведения: Недопустимый параметр.

?

PS: Не смотрите на бессмысленность кода, просто пытаюсь въехать почему буфер не назначается :), cli Для меня темный лес пока.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Всё, решение нашел путём подключения абсолютно всех библиотек =)

Доброго времени суток!

Напиши пожалуйста подробнее как подключал библиотеки OpenCV к CLR. Работа колом стоит.

Заранее спасибо!!!

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте учётную запись или войдите для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать учётную запись

Зарегистрируйтесь для создания учётной записи. Это просто!

Зарегистрировать учётную запись

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас


  • Сейчас на странице   0 пользователей

    Нет пользователей, просматривающих эту страницу

×