I'm pretty new to computer vision, but I'm trying to basically find all the straight lines in a hand drawn image as seen by the camera. I'm using the GPUImage library by Brad Larson, and I'm able to find the lines using a Hough Transform, but this gives me slopes and intercepts. Is there a way to get the endpoints? It's not really possible to determine the lengths via intersections due to the nature of the images. I've started looking into the full OpenCV library, but that seems considerably more complicated.
Related
I'm attempting to take two images in OpenCV, both drawn with a program like MS Paint or a simple drawing app, and gauge their percent similarity to each other. I have passing familiarity with some OpenCV image processing methods, but the approaches I've tried so far haven't been effective.
What I've thought of doing so far has been:
Simplest approach - comparing the two images pixel by pixel. This is easy to code up but scale / rotation invariant. The solution needs to be able to recognize an imperfect version
Hausdorff distance. This seems readymade for this problem, and I read a couple of other stack overflow posts about using it, but it takes in contours and I'm not sure how to extract contours from one image and match them to contours in another. One of the images might be empty, or they might be drastically different.
Feature extraction / matching - The approach I've tried so far has been to use feature detectors (ORB, AKAZE) paired with a Flann-based matcher, and have gotten extremely poor results so far. I'm currently changing this to SIFT/SURF and brute-force, but it doesn't seem like this has worked very well.
What are other possible computer vision algorithms I can try? I attached two sample images that are representative of what I'm trying to compare (and I did grayscale the image before processing, so color is not a factor).
Thank you!
I would like some hints, maybe more, on detecting a custom image marker in a real-time video feed. I'm using OpenCV, iPhone and the camera feed.
By custom image marker I'm referring to a predefined image, but it can be any kind of image (not a specific designed marker). For example, it can be a picture of some skyscrapers.
I've already worked with ARTags and understand how they are detected, but how would I detect this custom image and especially find out its position & orientation?
What makes a good custom image to be detected successfully?
Thanks
The most popular markers used in AR are
AR markers (a simple form of QR codes) - those detected by AR tookit & others
QR codes. There are plenty of examples on how to create/detect/read QR.
Dot grids. Similar with the chess grids used in calibration. It seems their detection can be more robust than the classical chess grid. OpenCV has codes related to dot grid detection in the calibration part. Also, the OpenCV codebase offers a good starting point to extract 3D position and orientation.
Chess grids. Similar to dot grids. They were the standard calibration pattern, and some people used them for marker detection of a long time. But they lost their position to dot grids recently, when some people discovered that dots can be detected with better accuracy.
Note:
Grids are symmetrical. I bet you already know that. But that means you will not be able to
recover full orientation data from them. You will get the plane where the grid lies, but nothing more.
Final note:
Code and examples for the first two are easily found on the Internet. They are considered the best by many people. If you decide to use the grid patterns, you have to enjoy some math and image processing work :) And it will take more.
This answer is valid no more since Vuforia is now a paid engine.
I think you should give Vuforia a try. It's a AR engine that can use any image you want as a marker. What makes a good marker for Vuforia is high frequency images.
http://www.qualcomm.com/solutions/augmented-reality
Vuforia is a free to use engine.
I am currently trying to detect [P Plates]
in images made from panoramas off the top of a car (so the P plates could be coming from in front or behind me, and may be distorted). There may be more than 2 P plates so I would need the ability to detect more than 1 at a time. I have used OpenCV template matching with mixed success, it doesn't seem to cope with P plates on an angle well and I cannot seem to get it to recognise 2 in an image. I have also tried SURF but with no luck. Does anyone have any recommendations for the kind of algorithm I should use here (preferably one that is integrated into OpenCV).
You may want to go with SIFT using Rob Hess' SIFT Library. It's using OpenCV and is pretty fast.
Another way is to detect squares and than use content of the square for further processing.
I need to count out boxes in a warehouse by using edge detection techniques; images will be taken from a 3D model of a warehouse and the propose system will be used 3 images in 3 different angles to cover the whole area of a warehouse.
As I have no experience in image processing before I'm a bit confused about which algorithm to use.
For a quick start I would suggest looking at those two:
Sobel operator
Canny operator
These are the most widely used edge detection filters with pretty good results.
If you are starting to learn computer vision, you should also learn about typical operations in image processing and convolution.
The OpenCV library is a great library which implements many algorithms of computer vision, including the two operators mentioned above.
Check out AForge. It has full C# implementation of some edge detection algorithms.
Take a look at Image Processing Library for C++ question. You can find several useful links there. The suggested libraries not only have algorithm description but also their implementations.
OpenCV has a very nice algorithm which detects closed contours in an image and returns them as lists of points. You can then throw away all contours which don't have 4 points, and then check some constraints of the remaining ones (aspect ratio of the rectangles, etc...) to find your remaining box sides. This should at least solve the image processing part of your problem, though turning this list of contours into a count of boxes in your warehouse is going to be tough.
Check here for the OpenCV function:
http://opencv.willowgarage.com/documentation/structural_analysis_and_shape_descriptors.html#findcontours
http://opencv.willowgarage.com/documentation/drawing_functions.html#drawcontours
'Sujoy Filter' is better than Sobel Filter for Edge-detection. Here's the Julia implementation (with paper link): Sujoy Filter
I need to count out boxes in a warehouse by using edge detection techniques; images will be taken from a 3D model of a warehouse and the propose system will be used 3 images in 3 different angles to cover the whole area of a warehouse.
As I have no experience in image processing before I'm a bit confused about which algorithm to use.
For a quick start I would suggest looking at those two:
Sobel operator
Canny operator
These are the most widely used edge detection filters with pretty good results.
If you are starting to learn computer vision, you should also learn about typical operations in image processing and convolution.
The OpenCV library is a great library which implements many algorithms of computer vision, including the two operators mentioned above.
Check out AForge. It has full C# implementation of some edge detection algorithms.
Take a look at Image Processing Library for C++ question. You can find several useful links there. The suggested libraries not only have algorithm description but also their implementations.
OpenCV has a very nice algorithm which detects closed contours in an image and returns them as lists of points. You can then throw away all contours which don't have 4 points, and then check some constraints of the remaining ones (aspect ratio of the rectangles, etc...) to find your remaining box sides. This should at least solve the image processing part of your problem, though turning this list of contours into a count of boxes in your warehouse is going to be tough.
Check here for the OpenCV function:
http://opencv.willowgarage.com/documentation/structural_analysis_and_shape_descriptors.html#findcontours
http://opencv.willowgarage.com/documentation/drawing_functions.html#drawcontours
'Sujoy Filter' is better than Sobel Filter for Edge-detection. Here's the Julia implementation (with paper link): Sujoy Filter