Ask Your Question

azdoud.y's profile - activity

2019-11-25 10:41:19 -0600 received badge  Famous Question (source)
2019-06-19 08:52:11 -0600 received badge  Popular Question (source)
2019-06-19 08:52:11 -0600 received badge  Notable Question (source)
2018-07-25 07:31:29 -0600 commented question How to get the exact time using the FPS and frame index?

@LBerger so the above code is right if we consider the explanation in that link, no need to get milliseconds from the fr

2018-07-25 07:27:00 -0600 commented question How to get the exact time using the FPS and frame index?

okey @LBerger

2018-07-25 06:15:49 -0600 commented question How to get the exact time using the FPS and frame index?

@berak can this be done ?

2018-07-25 05:50:46 -0600 edited question How to get the exact time using the FPS and frame index?

How to get the exact time using the FPS and frame index? Hi, My aim is to get exact time (hours : minites : secondes :

2018-07-25 05:31:46 -0600 asked a question How to get the exact time using the FPS and frame index?

How to get the exact time using the FPS and frame index? Hi, My aim is to get exact time (hours : minites : secondes :

2018-07-04 09:37:08 -0600 asked a question How to ignore the first and the last 10% of the videoCaption ?

How to ignore the first and the last 10% of the videoCaption ? Hello, I've a video which starts by black stream and end

2018-06-26 07:24:24 -0600 received badge  Self-Learner (source)
2018-06-26 07:16:52 -0600 marked best answer why serialized vector of Mat won't work?

hello,

I've written this code which opens tree images and push them with some infos inside vector<ColletorMat> setFrames then I save this vector of Mat within a binary file. so as to load it later and open these images again. however, I didn't get the aim

any will be appreciated

#include <opencv2\opencv.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"

#include "opencv2/core/core.hpp"

#include <iostream>
#include <fstream>

using namespace std;
using namespace cv;

class ColletorMat
{
private:
    int indexFrame;
    bool found;
    Mat frame;

public:

    ColletorMat(int index, bool found, Mat frame)
    {
        this->indexFrame = index;
        this->found = found;
        this->frame = frame;
    }

    ~ColletorMat()
    {

    }

    // settors
    void set_indexFrame(int index)
    {
        this->indexFrame = index;
    }

    void set_found(bool found)
    {
        this->found = found;
    }

    void set_frame(Mat frame)
    {
        this->frame = frame;
    }

    // accessors
    int get_indexFrame()
    {
        return this->indexFrame;
    }

    bool get_found()
    {
        return this->found;
    }

    Mat get_frame()
    {
        return this->frame;
    }

};

int main()
{

    {
        Mat image1, image2, image3;
        image1 = imread("C:\\opencvVid\\data_seq\\Human3\\0001.jpg");
        image2 = imread("C:\\opencvVid\\data_seq\\Human3\\0002.jpg");
        image3 = imread("C:\\opencvVid\\data_seq\\Human3\\0003.jpg");

        if (image1.empty() || image2.empty() || image3.empty()) {
            std::cout << "error: image not readed from file\n";
            return(0);
        }

        imshow("M1",image1);
        imshow("M2",image2);
        imshow("M3",image3);

        (char)cvWaitKey(0);

        vector<ColletorMat> setFrames;

        ColletorMat colletorMat1(1,false,image1.clone());
        ColletorMat colletorMat2(1,false,image2.clone());
        ColletorMat colletorMat3(1,false,image3.clone());

        setFrames.push_back(colletorMat1);
        setFrames.push_back(colletorMat2);
        setFrames.push_back(colletorMat3);

        ofstream fs("setFrms.bin", fstream::binary);

        fs.write((char *) &setFrames, sizeof(vector<ColletorMat>));
        fs.close();

        ifstream loadFs("setFrms.bin", ios::binary);

        if(!loadFs.is_open()){
            cout << "error while opening the binary file" << endl;
        }

        vector<ColletorMat> setFramesLoad;

        loadFs.read( (char *) &setFramesLoad, sizeof(vector<ColletorMat>));
        cout << "frames loaded up " << setFramesLoad.size() << endl;

        imshow("1",setFramesLoad.at(0).get_frame());
        imshow("2",setFramesLoad.at(1).get_frame());
        imshow("3",setFramesLoad.at(2).get_frame());

        loadFs.close();

    }

    return 0;
}
2018-06-26 07:16:25 -0600 answered a question why serialized vector of Mat won't work?

serializing each object alone, then I deserializing each object respectively by adding these functions void matwrite(of

2018-06-26 07:00:06 -0600 commented question why serialized vector of Mat won't work?

I did this code it does the aim, thank you

2018-06-26 06:43:26 -0600 commented question why serialized vector of Mat won't work?

I serialized each object alone, then I deserialized each object respectively next I push them in that vector.

2018-06-26 05:33:09 -0600 edited question why serialized vector of Mat won't work?

why serialized vector of Mat won't work? hello, I've written this code which opens tree images and push them with some

2018-06-26 05:26:28 -0600 asked a question why serialized vector of Mat won't work?

why serialized vector of Mat won't work? hello, I've written this code which opens tree images and push them with some

2018-06-22 09:51:06 -0600 edited question How to apply ffmpeg noises ?

How to appyl ffmpeg noises ? Hello, I have seen this video on youtube which apply ffmpeg noises by these commands, but

2018-06-22 09:37:10 -0600 edited question How to apply ffmpeg noises ?

How to appyl ffmpeg noises ? Hello, I have seen this video on youtube which apply ffmpeg noises by these commands, but

2018-06-22 09:36:08 -0600 asked a question How to apply ffmpeg noises ?

How to appyl ffmpeg noises ? Hello, I have seen this video on youtube which apply ffmpeg noises by these commands, but

2018-06-21 12:13:44 -0600 asked a question How to apply noise in frames video ?

How to apply noise in frames video ? Hello, I have seen the video of Megamind.avi and it noisy version Megamind_bugy.av

2018-06-21 10:47:02 -0600 marked best answer how to enable multi-thread in CMake (centos) ?

hi,

I've issue with multi thread and CMAKE

I've written this code using multi-thread it works fine in windows, however, when I tried to run it in CentOS using CMAKE it works in a sequential manner which is weird

project structure :

image description

CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
                project( main )
                find_package( OpenCV REQUIRED )
                add_executable( main main.cpp )
                target_link_libraries( main ${OpenCV_LIBS} )

code

#include <iostream> // for standard I/O
#include <opencv2/core/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/imgproc/imgproc.hpp>  // Gaussian Blur
#include <opencv2/highgui/highgui.hpp>  // OpenCV window I/O

// uncomment this to run it in Centos
//#include "opencv2/imgproc/imgproc_c.h"
//#include <opencv2/highgui/highgui_c.h>
//#include "opencv2/videoio/videoio_c.h"

#include <thread>
#include <future>

using namespace std;
using namespace cv;

int loadVideo( VideoCapture cap1, int seek_step,int thrd){
    int frameNum = 0;
    Mat frame;
    char c;
    cap1.set(CV_CAP_PROP_POS_FRAMES, seek_step );
    while (1){
        cap1 >> frame;
        if (frame.empty())
        {
            cout << " < < <  Channel stream ended!  > > > ";
            break;
        }
    cout<<"\nseek_step" <<seek_step << "frameNum" << frameNum << endl;
    ++frameNum;
    }
    return frameNum;
}

int main()
{
    string sourceVideoPath;
    sourceVideoPath = "C:\\opencvVid\\case1_320_240\\case320_240fps10.mp4";
//    sourceVideoPath = "./media/case320_240fps10.mp4";
    VideoCapture cap1(sourceVideoPath);
    VideoCapture cap2(sourceVideoPath);
    VideoCapture cap3(sourceVideoPath);

    cout << "Stream frame numbre : " << cap1.get(CV_CAP_PROP_FRAME_COUNT)<<endl;
    if (!cap1.isOpened())
    {
        cout  << "Could not open reference " << sourceVideoPath << endl;
        return -1;
    }

    auto future1 = std::async(loadVideo, cap1,0,1);
    auto future2 = std::async(loadVideo, cap2,750,2);
    auto future3 = std::async(loadVideo, cap3,1000,3);

    cout << future1.get() << endl;
    cout << future2.get() << endl;
    cout << future3.get() << endl;

    return 0;
}

output in windows :

Stream frame numbre : 36206

seek_step0frameNum0

seek_step0frameNum
seek_step1
750frameNum
seek_step0
0
seek_stepframeNum750frameNum2
1

seek_step1000frameNum
seek_step
seek_step750frameNum2
0
0frameNum3

seek_step
seek_step
seek_step01000750frameNum3
frameNum1
frameNum
seek_step7504
seek_step1000frameNum2
frameNum4


seek_step
seek_step
seek_step7501000frameNum3
frameNum5
0
seek_step1000frameNum4

seek_step750frameNum6frameNum5

output in CentOS:

[azdoud@video-processor proj1]$ cmake -DCMAKE_CXX_FLAGS="-std=c++11"
[azdoud@video-processor proj1]$ make
[azdoud@video-processor proj1]$ ./main
Stream frame numbre : 36206
seek_step0frameNum0
seek_step0frameNum1
seek_step0frameNum2
seek_step0frameNum3
seek_step0frameNum4
seek_step0frameNum5
seek_step0frameNum6
seek_step0frameNum7
seek_step0frameNum8
seek_step0frameNum9
seek_step0frameNum10
seek_step0frameNum11
seek_step0frameNum12
seek_step0frameNum13
seek_step0frameNum14
seek_step0frameNum15
seek_step0frameNum16
seek_step0frameNum17
seek_step0frameNum18
seek_step0frameNum19
seek_step0frameNum20
seek_step0frameNum21
seek_step0frameNum22
seek_step0frameNum23
seek_step0frameNum24
seek_step0frameNum25
seek_step0frameNum26
seek_step0frameNum27
seek_step0frameNum28
seek_step0frameNum29
seek_step0frameNum30
seek_step0frameNum31
seek_step0frameNum32
seek_step0frameNum33
seek_step0frameNum34
seek_step0frameNum35
seek_step0frameNum36
seek_step0frameNum37
seek_step0frameNum38
seek_step0frameNum39
seek_step0frameNum40
seek_step0frameNum41
seek_step0frameNum42
seek_step0frameNum43
seek_step0frameNum44
seek_step0frameNum45
seek_step0frameNum46
seek_step0frameNum47
seek_step0frameNum48
2018-06-21 10:46:50 -0600 edited answer how to enable multi-thread in CMake (centos) ?

I solved this issue by upgrading my GCC compiler on centOS, Initially, I had GCC version 4.8.0 and when I upgraded it to

2018-06-21 07:05:56 -0600 asked a question How do I select the best serialization technique for Mat objects?

How do I select the best serialization technique for Mat objects? Hi, I want to write a code in which I will process a v

2018-06-21 05:17:48 -0600 marked best answer How to solve problem with VideoCapture loading in linux ?

Hi,

I've written the following code so as to load a mp4 video into VideoCapture, however, when I check the capture with isOpened() I get false . I'm 100% sure that the mp4 file is within the folder but my code is not able to open the capture.

#include <iostream> // for standard I/O
#include <opencv2/core/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/imgproc/imgproc.hpp>  // Gaussian Blur
#include <opencv2/highgui/highgui.hpp>  // OpenCV window I/O
#include <thread>
#include <future>

using namespace std;
using namespace cv;

int loadVideo( VideoCapture cap1, int seek_step,int thrd){
    int frameNum = 0;
    Mat frame;
     char c;
    cap1.set(CV_CAP_PROP_POS_FRAMES, seek_step );
    while (1){
        cap1 >> frame;
        if (frame.empty())
        {
            cout << " < < <  Channel stream ended!  > > > ";
            break;
        }

        cout << frameNum << endl;
        ++frameNum;
    }
    return frameNum;
}

int main(int argc, char *argv[])
{
    string sourceVideoPath;
    sourceVideoPath = "/home/azdoud/case1_320_200/case320_200fps20.mp4";
//    sourceVideoPath = "case320_240fps20.mp4";
//    sourceVideoPath = "C:\\opencvVid\\case1_320_240\\vid320_240fps25.mp4";
//    sourceVideoPath = argv[1];
    //start a new VideoCapture object in each of your 4 threads
    VideoCapture cap1(sourceVideoPath);

    cout << "Stream frame numbre : " << cap1.get(CV_CAP_PROP_FRAME_COUNT)<<endl;
    if (!cap1.isOpened())
    {
        cout  << "Could not open video " << sourceVideoPath << endl;
        return -1;
    }

    loadVideo(cap1,0,1);

    return 0;
}

I've put the video in the same folder but no good results.

[azdoud@video-processor CentOSsimple]$ cmake -DCMAKE_CXX_FLAGS="-std=c++11"
-- Configuring done
-- Generating done
-- Build files have been written to: /home/azdoud/CentOSsimple
[azdoud@video-processor CentOSsimple]$ make
Scanning dependencies of target main
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
Linking CXX executable main
[100%] Built target main
[azdoud@video-processor CentOSsimple]$ ./main
Stream frame numbre : 0
Could not open video case320_240fps20.mp4

in I tested this code it works well, the image is in the same folder too

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
using namespace std;
using namespace cv;

int main()
{
    Mat src;

    /// Load image
    src = imread(  "/home/azdoud/im.jpg");
//    src = imread( "C:\\opencvVid\\images\\1.png" );
    cout << "Width : " << src.size().width << endl;
    cout << "Height: " << src.size().height << endl;
    return 0;
}

this the result

[azdoud@video-processor CentOSsimple]$ cmake -DCMAKE_CXX_FLAGS="-std=c++11"
-- Configuring done
-- Generating done
-- Build files have been written to: /home/azdoud/CentOSsimple
[azdoud@video-processor CentOSsimple]$ make
Scanning dependencies of target main
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
Linking CXX executable main
[100%] Built target main
[azdoud@video-processor CentOSsimple]$ ./main
Width : 0
Height: 0

you may tell is a probelm of permission, I've checked that too by setting chmod to 666 on the folder and on mp4 file. How can you explain this, I can't understand why

any help thank you in advance.

here the getBuildInformation() output

 [azdoud@video-processor CentOSsimple]$ cmake -DCMAKE_CXX_FLAGS="-std=c++11"
 -- Configuring done
 -- Generating done
 -- Build files have been written to: /home/azdoud/CentOSsimple
 [azdoud@video-processor CentOSsimple]$ make
 Scanning dependencies of target main
 [100%] Building CXX object ...
(more)
2018-06-21 04:28:34 -0600 edited answer How to solve problem with VideoCapture loading in linux ?

I solved this issue by installing a new version of opencv3 and I had installed ffmpeg package from another repository.

2018-06-21 04:15:44 -0600 answered a question how to enable multi-thread in CMake (centos) ?

I solved this issue by upgrading my GCC compiler on centOS, Initially, I had GCC version 4.8.0 and when I upgraded it to

2018-06-20 14:32:32 -0600 marked best answer How to solve CMAKE compiler error in CentOS machine ?

Hello,

I've developed a code in Qt IDE in windows and when I run it, it works well, however, when I passed to run the code in CentOS machine with CMAKE I got these error :

[azdoud@video-processor CentOSsimple]$ make Scanning dependencies of target main [100%] Building CXX object CMakeFiles/main.dir/main.cpp.o In file included from /usr/include/c++/4.8.2/thread:35:0, from /opt/working/CentOSsimple/main.cpp:5:

  /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   #error This file requires compiler and library support for the \
    ^
  /opt/working/CentOSsimple/main.cpp: In function ‘void loadVideo1(cv::VideoCapture, int, int)’:
  /opt/working/CentOSsimple/main.cpp:24:65: error: ‘to_string’ was not declared in this scope
           cv::putText(frame, "Frame "+to_string(frameNum+seek_step),
                                                                   ^
  /opt/working/CentOSsimple/main.cpp: In function ‘int main()’:
  /opt/working/CentOSsimple/main.cpp:92:10: error: ‘future1’ does not name a type
       auto future1 = std::async(loadVideo, cap1,0,1);
            ^
  /opt/working/CentOSsimple/main.cpp:93:10: error: ‘future2’ does not name a type
       auto future2 = std::async(loadVideo, cap2,750,2);
            ^
  /opt/working/CentOSsimple/main.cpp:94:10: error: ‘future3’ does not name a type
       auto future3 = std::async(loadVideo, cap3,1000,3);
            ^
  /opt/working/CentOSsimple/main.cpp:96:13: error: ‘future1’ was not declared in this scope
       cout << future1.get() << endl;
               ^
  /opt/working/CentOSsimple/main.cpp:97:13: error: ‘future2’ was not declared in this scope
       cout << future2.get() << endl;
               ^
  /opt/working/CentOSsimple/main.cpp:98:13: error: ‘future3’ was not declared in this scope
       cout << future3.get() << endl;
               ^
  make[2]: *** [CMakeFiles/main.dir/main.cpp.o] Error 1
  make[1]: *** [CMakeFiles/main.dir/all] Error 2
  make: *** [all] Error 2

I've followed this documentation to set opencv and cmake in my machine, I've tested it, its works well too as you can see

    [azdoud@video-processor CentOSsimple]$ make
    Scanning dependencies of target main
    [100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
    Linking CXX executable main
    [100%] Built target main
    [azdoud@video-processor CentOSsimple]$ ll
    total 60
    -rw-rw-r--. 1 azdoud azdoud 13171 Jun  8 11:40 CMakeCache.txt
    drwxrwxr-x. 5 azdoud azdoud  4096 Jun  8 11:41 CMakeFiles
    -rw-rw-r--. 1 azdoud azdoud  1585 Jun  8 11:40 cmake_install.cmake
    -rw-rw-r--. 1 azdoud azdoud   166 Jun  8 11:39 CMakeLists.txt
    -rwxrwxr-x. 1 azdoud azdoud 18912 Jun  8 11:41 main
    -rw-rw-r--. 1 azdoud azdoud   435 Jun  8 11:02 main.cpp
    -rw-rw-r--. 1 azdoud azdoud  4646 Jun  8 11:40 Makefile
    [azdoud@video-processor CentOSsimple]$ ./main
    Width : 37
    Height: 69

This is the simple code that I'm trying to run in linux machine

    #include <iostream> // for standard I/O
    #include <opencv2/core/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
    #include <opencv2 ...
(more)
2018-06-20 14:30:48 -0600 answered a question How to solve problem with VideoCapture loading in linux ?

I solved this issue by installing a new version of opencv3 and I had installed ffmpeg package from another repository.

2018-06-19 04:38:48 -0600 commented question how to enable multi-thread in CMake (centos) ?

Is there no explanation ?

2018-06-18 12:26:31 -0600 edited question how to enable multi-thread in CMake (centos) ?

how to enable multi-thread with CMake (centos) ? hi, I've issue with multi thread and CMAKE I've written this code us

2018-06-18 12:26:01 -0600 asked a question how to enable multi-thread in CMake (centos) ?

how to enable multi-thread with CMake (centos) ? hi, I've issue with multi thread and CMAKE I've written this code us

2018-06-14 14:33:14 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

finally Video I/O: DC1394: NO FFMPEG: YES avcodec:

2018-06-11 09:55:13 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

I have looked for opencv.pc [azdoud@video-processor core]$ sudo find / -name "*opencv.pc*" [sudo] password for azdoud:

2018-06-11 09:16:19 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

changing the OS is not an option for me, I try to run the code with g++ g++ `pkg-config --cflags --libs opencv` -std=

2018-06-11 09:13:31 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

changing the OS is not an option for me

2018-06-11 09:05:59 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

I have updated cmake from 2.8.12.2 to 3.11.3 [azdoud@video-processor CentOSsimple]$ cmake --version cmake version 3.11

2018-06-11 07:19:16 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

what should I do

2018-06-11 07:15:27 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

how to remove the cmake and start from the beginning ?

2018-06-11 07:14:31 -0600 commented answer How to solve problem with VideoCapture loading in linux ?

I got problems I think I have to remove [azdoud@video-processor ~]$ sudo yum install cmake git libgtk2.0-dev pkg-confi

2018-06-11 07:04:57 -0600 commented question How to solve problem with VideoCapture loading in linux ?

I can't understand where I missed it, I had followed this reference of Opencv at page 9.

2018-06-11 07:02:55 -0600 commented question How to solve problem with VideoCapture loading in linux ?

I can't understand where I missed it, I had followed thisreference of Opencv at page 9.

2018-06-11 07:02:10 -0600 commented question How to solve problem with VideoCapture loading in linux ?

I can't understand where I missed it, I had followed it reference of Opencv at page 9.

2018-06-11 06:50:48 -0600 edited question How to solve problem with VideoCapture loading in linux ?

How to solve problem with VideoCapture loading in linux ? Hi, I've written the following code so as to load a mp4 video

2018-06-11 06:49:48 -0600 commented question How to solve problem with VideoCapture loading in linux ?

I did I will but that in the question

2018-06-11 06:45:18 -0600 edited question How to solve problem with VideoCapture loading in linux ?

How to solve problem with VideoCapture loading in linux ? Hi, I've written the following code so as to load a mp4 video

2018-06-11 06:39:49 -0600 edited question How to solve problem with VideoCapture loading in linux ?

How to solve problem with VideoCapture loading in linux ? Hi, I've written the following code so as to load a mp4 video

2018-06-11 06:32:11 -0600 asked a question How to solve problem with VideoCapture loading in linux ?

How to solve problem with VideoCapture loading in linux ? Hi, I've written the following code so as to load a mp4 video

2018-06-08 11:29:02 -0600 marked best answer How to resolve the problem of undefined reference in CMake on linux ?

Hi,

I've written a code and I've used classes, however when I'm trying to compile the code using CMake I got these errors

        [azdoud@video-processor prototype02]$ cmake -DCMAKE_CXX_FLAGS="-std=c++11"
        -- Configuring done
        -- Generating done
        -- Build files have been written to: /home/azdoud/prototype02
        [azdoud@video-processor prototype02]$ make
        Scanning dependencies of target main
        [100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
        Linking CXX executable main
        CMakeFiles/main.dir/main.cpp.o: In function `main':
        main.cpp:(.text+0x60e): undefined reference to `AdFeature::AdFeature(int, int, bool, cv::Mat)'
        main.cpp:(.text+0x668): undefined reference to `AdFeature::~AdFeature()'
        main.cpp:(.text+0xf19): undefined reference to `AdFeature::~AdFeature()'
        CMakeFiles/main.dir/main.cpp.o: In function `ProcessingSimilarty(cv::VideoCapture, std::vector<AdFeature, std::allocator<AdFeature> >, double, seekStep, std::string)':
        main.cpp:(.text+0x13f8): undefined reference to `AdFeature::get_frame()'
        main.cpp:(.text+0x170b): undefined reference to `AdFeature::set_found(bool)'
        main.cpp:(.text+0x1731): undefined reference to `AdFeature::set_indexLocationAD(int)'
        main.cpp:(.text+0x1750): undefined reference to `AdFeature::~AdFeature()'
        CMakeFiles/main.dir/main.cpp.o: In function `cleanAdFeature(std::vector<AdFeature, std::allocator<AdFeature> >)':
        main.cpp:(.text+0x1b77): undefined reference to `AdFeature::set_found(bool)'
        main.cpp:(.text+0x1b97): undefined reference to `AdFeature::set_indexLocationAD(int)'
        CMakeFiles/main.dir/main.cpp.o: In function `findAdLocation(std::vector<AdFeature, std::allocator<AdFeature> >, int, double, double)':
        CMakeFiles/main.dir/main.cpp.o: In function `void __gnu_cxx::new_allocator<AdFeature>::destroy<AdFeature>(AdFeature*)':
        main.cpp:(.text._ZN9__gnu_cxx13new_allocatorI9AdFeatureE7destroyIS1_EEvPT_[_ZN9__gnu_cxx13new_allocatorI9AdFeatureE7destroyIS1_EEvPT_]+0x18): undefined reference to `AdFeature::~AdFeature()'
        CMakeFiles/main.dir/main.cpp.o: In function `void std::_Destroy<AdFeature>(AdFeature*)':
        main.cpp:(.text._ZSt8_DestroyI9AdFeatureEvPT_[_ZSt8_DestroyI9AdFeatureEvPT_]+0x14): undefined reference to `AdFeature::~AdFeature()'
        collect2: error: ld returned 1 exit status
        make[2]: *** [main] Error 1
        make[1]: *** [CMakeFiles/main.dir/all] Error 2
        make: *** [all] Error 2

even though adding include_directories (dir of the code) in CMakeLists.txt did not work

        cmake_minimum_required(VERSION 2.8)
        project( main )
        find_package( OpenCV REQUIRED )
        add_executable( main main.cpp )
        target_link_libraries( main ${OpenCV_LIBS} )
        include_directories(/home/azdoud/prototype02)

So, how Can I make these .h file a definedable reference?

thank you

2018-06-08 11:19:18 -0600 commented question How to resolve the problem of undefined reference in CMake on linux ?

yes, I have 2 add_executable lines there, that was the problem thank you @berak the code run with no problem