Ask Your Question

[email protected]'s profile - activity

2019-08-07 08:28:34 -0600 received badge  Popular Question (source)
2017-04-16 06:52:19 -0600 received badge  Enthusiast
2017-04-15 20:53:28 -0600 commented question create convexhull around detected keypoints

I want to ask about find contours I take the input and output contours .. what will be the input in this case, will it be the MatOfpoint from keypoints list ??

2017-04-15 20:50:07 -0600 commented question create convexhull around detected keypoints

can you give me example for convex hull using java ?

2017-04-15 17:01:29 -0600 commented question create convexhull around detected keypoints

I can not understand this point please more details : sadly it only has the indexed version (do you have to use java ?) so you need to look up the hull points using the indexes returned from your Point array

2017-04-15 08:15:19 -0600 asked a question obstacle detection size expansion algorithm

I try to follow this paper (Monocular Vision-Based Obstacle Detection/Avoidance for Unmanned Aerial Vehicles) to do obstacle detection, I worked with SIFT algorithm in order to detect the keypoints in both images (two consecutive frames), then the Brute-Force Algorithm to match them,. Then I should extract the keypoints that its keypoints are expanding in the second image, this is by comparing the size property of the keypoints and save it in a new vector of keypoints. Finally, I want to use the functions to create the the convex hull around the final keypoints after filtering, and drawing it using findContours function. How to create this convex with key points?

2017-04-15 08:12:30 -0600 commented question create convexhull around detected keypoints

I try to follow this paper (Monocular Vision-Based Obstacle Detection/Avoidance for Unmanned Aerial Vehicles) to do obstacle detection, I worked with SIFT algorithm in order to detect the keypoints in both images (two consecutive frames), then the Brute-Force Algorithm to match them,. Then I should extract the keypoints that its keypoints are expanding in the second image, this is by comparing the size property of the keypoints and save it in a new vector of keypoints. Finally, I want to use the functions to create the the convex hull around the final keypoints after filtering, and drawing it using findContours function. How to do this?

2017-04-14 19:46:36 -0600 asked a question create convexhull around detected keypoints

I read an image in android and detect the keypoints using sift algorithm, then I want to create Object of Interest (OOI) around these keypoints by creating a convex hull of the corresponding points How can I create this convexhull and draw it using findcontours ??? this is my code:

    inputImage = BitmapFactory.decodeResource(getResources(), R.drawable.test);
    Mat rgba = new Mat();
    Mat rgbagray = new Mat(rgba.width(),rgba.height(),CV_8UC1);
    Utils.bitmapToMat(inputImage, rgba);
    Imgproc.cvtColor(rgba, rgbagray, Imgproc.COLOR_RGBA2GRAY);

    MatOfKeyPoint keyPoints = new MatOfKeyPoint();
    detector.detect(rgbagray, keyPoints);

    List<MatOfPoint> contours = new ArrayList<>();
    Mat hierarchy = new Mat();

    List<KeyPoint> listpoint = new ArrayList<KeyPoint>();
    listpoint = keyPoints.toList();
        //
        for (int ind = 0; ind < listpoint.size(); ind++) {

           // find region of interest

        }
2017-03-20 13:28:36 -0600 commented question error with opencv threshold and findcontours

Yes I try to get the convex area around the key points to compare the two convex of the matched keypoints of the two images .. so I can dectec the obstacle due to size expansion algorithm

2017-03-20 10:02:44 -0600 commented question error with opencv threshold and findcontours

the keyPoints Mat is 7 channel how can I convert it to 3 channels so I can apply gray function

2017-03-20 09:03:58 -0600 commented question error with opencv threshold and findcontours

how can I do this ??

2017-03-20 07:27:12 -0600 commented question error with opencv threshold and findcontours

this is the error error: (-215) scn == 3 || scn == 4 in function void cv::cvtColor(cv::InputArray, cv::OutputArray, int, int)

2017-03-20 07:22:31 -0600 asked a question error with opencv threshold and findcontours

I try to load two Images and get the matched keypoints and draw convexhull on the matched keypoints with bigger size ..any help with this error this my code:

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ImageView;

import org.opencv.android.Utils;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
import org.opencv.core.MatOfInt;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.MatOfPoint;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.features2d.Features2d;
import org.opencv.features2d.KeyPoint;
import org.opencv.highgui.Highgui;
import org.opencv.imgproc.Imgproc;
import org.opencv.utils.Converters;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import static java.lang.System.in;
import static org.opencv.core.CvType.CV_8UC1;
import static org.opencv.core.CvType.CV_8UC3;
import static org.opencv.features2d.Features2d.drawKeypoints;
import static org.opencv.highgui.Highgui.imread;
import static org.opencv.imgproc.Imgproc.THRESH_BINARY;
import static org.opencv.imgproc.Imgproc.convexHull;
import static org.opencv.imgproc.Imgproc.drawContours;
import static org.opencv.imgproc.Imgproc.findContours;
import static org.opencv.imgproc.Imgproc.threshold;

public class MainActivity extends AppCompatActivity {
    static {
        System.loadLibrary("opencv_java");
        System.loadLibrary("nonfree");
    }
    private ImageView imageView;
    private Bitmap inputImage; // make bitmap from image resource
    private Bitmap inputImage2; // make bitmap from image resource
    private FeatureDetector detector = FeatureDetector.create(FeatureDetector.SIFT);
    DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SIFT);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        imageView = (ImageView) this.findViewById(R.id.imageView);
        sift();
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    public void sift() {
        inputImage = BitmapFactory.decodeResource(getResources(), R.drawable.test);
        inputImage2 = BitmapFactory.decodeResource(getResources(), R.drawable.shot);
        Mat rgba = new Mat();
        Mat rgba2 = new Mat();

        Utils.bitmapToMat(inputImage, rgba);
        Utils.bitmapToMat(inputImage2, rgba2);

        MatOfKeyPoint keyPoints = new MatOfKeyPoint();
        MatOfKeyPoint keypoints2 = new MatOfKeyPoint();

        Imgproc.cvtColor(rgba, rgba, Imgproc.COLOR_RGBA2GRAY);
        Imgproc.cvtColor(rgba2, rgba2, Imgproc.COLOR_RGBA2GRAY);

        detector.detect(rgba, keyPoints);
        detector.detect(rgba2, keypoints2);

        Mat descriptor1 = new Mat();
        Mat descriptor2 = new Mat();

        extractor.compute( rgba, keyPoints, descriptor1 );
        extractor.compute( rgba2, keypoints2, descriptor2 );

        MatOfDMatch matches1 =new MatOfDMatch();

        DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
        matcher.match(descriptor2, descriptor1, matches1 );

        List<KeyPoint>obj=new ArrayList<>();
        List<KeyPoint>scene=new ArrayList<>();
        List<KeyPoint> filtered1=new ArrayList<KeyPoint>();
        List<KeyPoint> filtered2=new ArrayList<KeyPoint>();
        List<Point> filtered11=new ArrayList<>();
       // List<Point> filtered22=new ArrayList<>();

//        //Log.d("MainActivity","matches "+ matches1.size());
      //  List<DMatch> good_matches =new ArrayList<>();

        for (int i=0;i<matches1.toArray().length ;i++) {
            if (matches1.toArray()[i].distance <= 150 ) {
               // good_matches.add(matches1.toArray()[i]);
                DMatch match = matches1.toArray()[i];
                KeyPoint x = keyPoints.toList().get(match.trainIdx);
                obj.add(x);
                filtered11.add(x.pt);
                KeyPoint y = keypoints2.toList().get(match.queryIdx);
                scene.add(y);
               // filtered22.add(y.pt);

                if (y.size > x.size) {
                    filtered1.add(x);
                  //  filtered2.add(y);
                }
            }
        }

        /*********************************/
        Mat cannyMat ...
(more)
2017-02-25 06:22:15 -0600 commented question algorithm to computer vision obstacle detection ??

My objective is to make a simple blind assistant I am using "indoor atlas" for indoor navigation (mobile application) and I am trying to implement obstacle detection while positioning and tracking so the camera will be with some angle in front of him

2017-02-23 05:42:03 -0600 commented question algorithm to computer vision obstacle detection ??

Yes I use only my mobile camera

2017-02-22 18:33:47 -0600 asked a question algorithm to computer vision obstacle detection ??

My graduation project is indoor navigation system for blind people so I need to implement obstacle detection using android and open CV, I followed these steps but accuracy is not good : 1- convert to grayscale 2-canny function to detect edges 3- dilate the detected edges by 500% 4- blur the image using a Gaussian blur 5- use findContours function to detect closed shapes and draw bounding circles around the shapes any help with paper or algorithm I should follow??