2

I want to differentiate two component as shown in this picture. The marked section is my original crop and all other area is weed and I want to detect my only crop section. How to do that in python?

TheMaster
  • 45,448
  • 6
  • 62
  • 85
  • How are you detecting the components? Can you share your code and your results? What criteria do you use to distinguish the component you're looking for? – beaker Nov 14 '17 at 17:45
  • I am going to detect weed(unnecessary crop in field) from the field. so what to do if both are merged and differentiate them. – nishchay trivedi Nov 14 '17 at 19:25
  • The components do not appear to be merged in your example image, so it's difficult to determine what type of help you need. Have you tried applying `connectedComponents` to this image? – beaker Nov 14 '17 at 22:16
  • Using connectedComponents and contours I got my desired result....Thank you – nishchay trivedi Nov 15 '17 at 05:44

2 Answers2

1

I would start with findContours and drawContours functions, they are described here.

Also it would be possible to find all closed shapes with floodFill (with mask).

scope
  • 1,967
  • 14
  • 15
1

you should try to identify closed loop object in your shape, not sure but it may helps you.

Java-Dev
  • 438
  • 4
  • 20