• How to extract specific feature in pattern recognition algorithm in ima

    From bojanjobs@gmail.com@21:1/5 to All on Wed Jul 13 00:54:11 2016
    I would like to detect the object (airplane door) from short distance. The algorithm should be very robust so can be implemented by any plane (with lots of different paintings, logos ) and by any weather condition(sun, rain, day and night).

    I search in OpenCV and implemented some of them feature extracting algorithms such as SURF , SIFT and ORB but the results is not so good.

    Here the code using ORB Feature Detector

    #include "opencv2/opencv_modules.hpp"
    #include <stdio.h>

    #ifndef HAVE_OPENCV_NONFREE

    int main(int, char**)
    {
    printf("The sample requires nonfree module that is not available in your OpenCV distribution.\n");
    return -1;
    }

    #else

    #include "opencv2/core/core.hpp"
    #include "opencv2/features2d/features2d.hpp"
    #include "opencv2/highgui/highgui.hpp"
    #include "opencv2/nonfree/nonfree.hpp"
    #include "opencv2/imgproc/imgproc.hpp"
    #include <iostream>
    #include <stdlib.h>

    using namespace cv;
    using namespace std;

    static void help()
    {
    printf("\nThis program demonstrates using features2d detector, descriptor extractor and simple matcher\n"
    "Using the SURF desriptor:\n"
    "\n"
    "Usage:\n matcher_simple <image1> <image2>\n");
    }

    Mat src;Mat src_gray;
    int thresh = 5;
    int max_thresh = 600;
    RNG rng(12345);

    void thresh_callback(int, void* );

    int main(int argc, char** argv)
    {


    Mat img1;
    Mat img2;
    img1= imread("a350_1.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    resize(img1, img1, Size(700,500), 0, 0, INTER_CUBIC);
    img2= imread("a350_1.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    resize(img2, img2, Size(680,480), 0, 0, INTER_CUBIC);

    Mat image;

    if(! img1.data || ! img1.data)
    {
    cout << "Could not open or find the image" << std::endl ;
    return -1;
    }


    // detecting keypoints
    OrbFeatureDetector detector(1500);
    vector<KeyPoint> keypoints1, keypoints2;
    detector.detect(img1, keypoints1);
    detector.detect(img2, keypoints2);

    // computing descriptors
    OrbDescriptorExtractor extractor;
    Mat descriptors1, descriptors2;
    extractor.compute(img1, keypoints1, descriptors1);
    extractor.compute(img2, keypoints2, descriptors2);

    // matching descriptors
    BFMatcher matcher(NORM_HAMMING);
    vector<DMatch> matches;
    matcher.match(descriptors1, descriptors2, matches);

    // drawing the results
    namedWindow("matches", CV_WINDOW_AUTOSIZE);
    Mat img_matches;
    drawMatches(img1, keypoints1, img2, keypoints2, matches, img_matches);
    imshow("matches", img_matches);
    waitKey(0);

    return 0;
    }

    #endif


    I would like to improve the algorithm’s robustness with respect to the correct matching of features. So, more reliable feature matching for the purpose of object recognition and detection to be more robust and reliable. Like for example, can include
    the distance between the window and door frame (which in every airplane model is fix), then the thickness of the door frame etc.

    I would like to extract some customs features so that the algorithm work for any planes with any paintings and logos. Means the algorithm should be robust to detect the door by any type of plane.Features like Logos of some airlines and paintings should
    not be keypoints/features.

    So because of that I like to extract features that can be general like distance between the window and the door frame(as this feature is always the same for given airplane model). Like for example the minimal distance between the door frame and the
    nearest window in Airbus A350 is let we say 1m. So I would like to use this feature in my algorithm. Any advice how to extract such features?

    Should I use in this case pattern recognition and machine learning techniques such and Deep Neural Networks or KNN?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)