Ask Your Question

densvr's profile - activity

2017-11-08 06:57:43 -0600 received badge  Famous Question (source)
2016-09-02 09:47:08 -0600 received badge  Notable Question (source)
2016-04-09 15:42:05 -0600 asked a question linux arm cross-compiling, problem with linking OpenCV so libraries


I am building a c++ project for arm with OpenCV dependencies and getting some errors:

Linking CXX executable VehicleDetection
/home/densvr/lib/opencv/opencv-3.1.0/build_arm/lib/ file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [VehicleDetection] Error 1
make[1]: *** [CMakeFiles/VehicleDetection.dir/all] Error 2
make: *** [all] Error 2

OpenCV was successfully builded for arm according to instructions on

Please help me to find out how to fix this problem.

Here is my project's CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) # Проверка версии CMake.
                                    # Если версия установленой программы
                                    # старее указаной, произайдёт аварийный выход.

project( VehicleDetectionDemo )

set( CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set( CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
find_package( OpenCV REQUIRED )

add_executable( VehicleDetection 
    #src files

target_link_libraries( VehicleDetection ${OpenCV_LIBS} )
2016-03-04 04:37:55 -0600 received badge  Popular Question (source)
2016-02-29 01:07:25 -0600 received badge  Supporter (source)
2014-09-02 02:10:48 -0600 received badge  Student (source)
2014-09-01 15:55:36 -0600 answered a question Include multiple objects in one contour

try to use cv::dilate() function before finding contours

2014-09-01 15:48:39 -0600 asked a question How to crop non rectangular area from Mat?

Hello everybody,

I need some help with cropping cv::Mat. There are a src mat image and a polygon to be cropped (for example triangle). For cropping I create mask image having size like src mat one and depth CV_8U. Then I filled my mask with 0 value and draw polygon on it using cv::filimage descriptionlPoly function . Finally, I try to apply the mask to src image using Mat::copyTo function but nothing happens with src img. What I do wrong?

Sorry for my bad English.

here is a part of my code

Mat createMask(const Size &size, const vector<Point2f> &_pts) {
    vector<Point> pts(_pts.size());
    for(int i = 0; i < _pts.size(); i++) {
        pts[i] = _pts[i];
    const Point* elementPoints[1] = { &pts[0] };
    int numPoints = (int)pts.size();
    Mat mMask = Mat::zeros(size, CV_8U);
    //circle(mMask, Point(30,30), 20, Scalar(0), 0);
    fillPoly(mMask, elementPoints, &numPoints, 1, Scalar(0));
    imshow("mMask", mMask);
    return mMask;

Mat mMask = createMask(size, pts); //some cv::Size and some predefined polygon points
Mat mTmp = mSrc.clone();
mTmp.copyTo(mSrc, mMask);
imshow("debug_frame", mFrame);