Quickly recognize and track objects in Android

I am working on a game with an addition to reality, which should recognize and track a fast-moving object. I tried the following image processing libraries,

1. OpenCV

2. BoofCv

3. FastCv

I tried the TLD algorithm for object tracking, tracking was successful, but performance was really needed for improvement. If an object moves faster, the result takes time due to the processing time of the algorithms. I also tried circulating, smoothing like algorithms using boofcv.

Check out these demos:

OpenTLD using FastCv

Boofcv Demo

Tracking objects in these two sample files seems good, but the calculation takes time.

Can I go with the following script to make it faster

  • Extract matrix r, g, b of object to track

  • Take the camera frames and convert them to the matrix r, g, b and find the matrix of tracked objects in the camera frame.

Is there a better way to do this?

+8
android image-processing opencv augmented-reality object-recognition
source share
2 answers

I suggest using a gray scale instead of RGB, as is usually done when processing images in such a way that your calculation is reduced to 1 matrix instead of 3.

If you need to check the color, just use rgb when necessary, but not through all the calculations.

Tracking fast moving objects is always difficult. Try using a camera that can take more frames per second, although you need to process more images, and I assume that you are on a mobile device.

You can also reduce the size of the processed image to a smaller window based on the previous position of the object, you can evaluate the next position and limit it to a certain extent and process only these fragments of the image. Briefly perform optical flow only in a specific part of the image (use the gray scale).

+3
source share

I think SIFT and SURF are best suited for this purpose. SIFT or SURF can be used like any other detector and extractor functions:

FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB); // May be SIFT, SURF, etc detector.detect(mat, keypoints); DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.ORB); // May be SIFT, SURF, etc extractor.compute(mat, keypoints, features); 

Use openCv to find out more. And, of course, your path may find a solution to this. Keep trying.

+2
source share

All Articles