Ask Your Question

rkotwani's profile - activity

2016-05-24 19:11:33 -0600 asked a question Can I access the query and train descriptors from a flann.knnMatch() function?

For ORB, the match object comes with the descriptors. Can similar information be accessed with SIFT?

               sift = cv2.xfeatures2d.SIFT_create()

                # find the keypoints and descriptors with SIFT
                kp1, des1 = sift.detectAndCompute(img1,None)
                kp2, des2 = sift.detectAndCompute(img2,None)
                # FLANN parameters
                FLANN_INDEX_KDTREE = 0
                index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
                search_params = dict(checks=50)   # or pass empty dictionary

                flann = cv2.FlannBasedMatcher(index_params,search_params)

                matches = flann.knnMatch(des1,des2,k=2)
2016-03-12 20:51:21 -0600 commented answer Detect an object on known color on a green surface?

Awesome! I found that if I subtract 25% of red, 25% of yellow, and 50% of blue from red: I'll be able to detect both yellow and red objects.

What I mean is that this method gives me enough contours to find the image (this works). I'll probably experiment more with the framework you gave me.

Actually, I'll try the HSV inRange when I have time.

2016-03-12 19:26:48 -0600 received badge  Supporter (source)
2016-03-12 19:23:22 -0600 commented answer Detect an object on known color on a green surface?

Actually I have a yellow object to detect also. Are you thresholding before performing the operation above? I posted what I did above.

2016-03-12 14:59:46 -0600 commented question Detect an object on known color on a green surface?

@jmbapps Thanks! I can totally do that. I'm having a hard time scanning for the right thresholds. Let me update my post.

2016-03-12 10:50:53 -0600 commented question Detect an object on known color on a green surface?

Thanks, this was posted kind of late last night, and I didn't think about it.

2016-03-12 10:43:21 -0600 received badge  Editor (source)
2016-03-12 00:43:05 -0600 asked a question Detect an object on known color on a green surface?

On a white surface, the object can be detected by providing a color threshold to filter the image. Then the image is converted gray scale and passed through a medianBlur + Canny filter.

The green surface is actually artificial turf so its shiny and has texture.

image description

I've tried looking at only the green plane instead of graying out the picture. In addition, it helped to remove the Canny filter.

The image can be scanned for the width of the object (if the red color is above a certain threshold). The, the max amount of the red color pixels in a row can be saved into a variable (giving position and size). However, I'm still not sure the correct thresholds to check for and am getting inconsistent results. On the white surface I am getting slightly bigger widths than on the green surface.

new_image = cv2.add(cv2.add(image[:,:,2],-image[:,:,1]/2),-image[:,:,0]/2)

image description