At first thank you very much
I have installed some of the opencv libraries with the command: sudo apt-get libopencv-dev.
Then I can find them in / usr / lib / arm-linux-gnueabihf Directory,such as : libopencv_ Video. a libopencv_ Video. so libopencv_Video.so. 3.2 libopencv_Video. so. 3.2.0
Libopencv_ Videostab Libopencv_ Viz Libopencv_ Ximgproc Libopencv_ Xobjdetect Libopencv_Xphoto Libopencv_Core etc (about 165 files)
Then I used this header file(RaspiOpencv.pas) to prog:
RaspiOpencv
*********************************************************************
* Modified to use Raspberry Pi with Ver3.3. for evaluation purpose.*
* Functions were changed to suit RaspberryPi and FPC Lazarus. *
* Add function cvLoadImageM etc. *
* Replaced Bitmap2IplImage and iplImage2Bitmap. *
* *
* K.Otani Nov-2017 *
*********************************************************************
* *
* The contents of this file are used with permission, subject to *
* the Mozilla Public License Version 1.1 (the "License"); you may *
* not use this file except in compliance with the License. You may *
* obtain a copy of the License at *
*
http://www.mozilla.org/MPL/MPL-1.1.html *
* *
* Software distributed under the License is distributed on an *
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *
* implied. See the License for the specific language governing *
* rights and limitations under the License. *
* *
*********************************************************************)
unit RaspiOpenCV;
{$mode objfpc}{$H+}
interface
uses
Classes, ctypes , Graphics , SysUtils, Math , GraphType ;
const
{$define Ver3}
// Please modify .dll/.so version name
{$ifdef MSWINDOWS}
video_lib = 'opencv_world331.dll';
videoio_lib = 'opencv_world331.dll';
cv_lib = 'opencv_world331.dll';
cvcore_lib = 'opencv_world331.dll';
highgui_lib = 'opencv_world331.dll';
cvimcodecs_lib = 'opencv_world331.dll';
cvimgproc_lib = 'opencv_world331.dll';
calib3D_lib = 'opencv_world331.dll';
cvobjdetect_lib = 'opencv_world331.dll';
{$endif}
{$ifdef CPUARM} // ARM only for Raspberry Pi
{$ifdef Ver2}
// /usr/lib/arm-linux-gnueabihf
cv_lib = 'libopencv_core.so.2.4';
video_lib = 'libopencv_video.so.2.4';
calib_lib = 'libopencv_calib3d.so.2.4';
highgui_lib = 'libopencv_highgui.so.2.4';
cxCore_lib = 'libopencv_core.so.2.4';
cvimgproc_lib = 'libopencv_imgproc.so.2.4';
cvobjdetect_lib = 'libopencv_objdetect.so.2.4';
{$else}
{$ifdef Ver3}
// /usr/local/lib
cv_lib = 'libopencv_core.so.3.2';
video_lib = 'libopencv_video.so.3.2';
videoio_lib = 'libopencv_videoio.so.3.2'; //add
cvcore_lib = 'libopencv_core.so.3.2';
highgui_lib = 'libopencv_highgui.so.3.2';
cvimcodecs_lib = 'libopencv_imgcodecs.so.3.2'; //add
cvimgproc_lib = 'libopencv_imgproc.so.3.2'; //add
calib3D_lib = 'libopencv_calib3d.so.3.2'; //add
cvobjdetect_lib = 'libopencv_objdetect.so.3.2'; //add
{$endif}
{$endif}
{$endif}
(*Matrix type (CvMat)*)
CV_CN_MAX = 64;
CV_CN_SHIFT = 3;
CV_DEPTH_MAX = (1 shl CV_CN_SHIFT);
CV_8U = 0;
CV_8S = 1;
CV_16U = 2;
CV_16S = 3;
CV_32S = 4;
CV_32F = 5;
CV_64F = 6;
CV_USRTYPE1 = 7;
CV_AUTO_STEP = $7fffffff;
... ...
The compilation can pass, but there is an error in running. The prompt message is:
Project Project1 raised exception class 'External:SIGTRAP'. In file '../sysdeps/unix/sysv/linux/raise.c' at line 50
File not found
The file '/build/glibc-FUvrFr/glibc-2.28/sysdeps/unix/sysv/linux/raise.c" was not found.
Do you want to locate it yourself?
I did not find this file(raise.c) in the download files (library and source code). How can I do it?
Thank you again