1 | initial version |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it ead an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
2 | No.2 Revision |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it ead read an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
3 | No.3 Revision |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it read an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
then, NO, feature matching can't be abused for object detection
you can only use it to find a part of a known scene, not with arbitrary images.
4 | No.4 Revision |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it read an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
then, NO, feature matching can't be abused for object detection
you can only use it to find a part of a known scene, not with arbitrary images.images. (you'll have to re-think the whole (broken !) approach)
also:
good_matches=[]
for m,n in matches:
if m.distance < 0.7 * n.distance:
good_matches.append(m)
return len(good_matches) ## what ? indentation error (it will return after the 1st) ?
please also learn, that the number of matches is entirely irrelevant here, it's NOT a measure for "similarity" or such.
5 | No.5 Revision |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it read an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
then, NO, feature matching can't be abused for object detection
you can only use it to find a part of a known scene, not with arbitrary images. (you'll have to re-think the whole (broken !) approach)
also:
good_matches=[]
for m,n in matches:
if m.distance < 0.7 * n.distance:
good_matches.append(m)
return len(good_matches) ## what ? indentation error (it will return after the 1st) ?
please also learn, that the number of matches is entirely irrelevant here, it's NOT here. if you happen to have a measure for "similarity" or such.
6 | No.6 Revision |
python noobs NEVER validate their input, thus the funny errors.
did your capture open at all ? did it read an image ? was the imread() output valid ?
you HAVE TO CHECK ALL OF THOSE !
then, NO, feature matching can't be abused for object detection
you can only use it to find a part of a known scene, not with arbitrary images. (you'll have to re-think the whole (broken !) approach)
also:
good_matches=[]
for m,n in matches:
if m.distance < 0.7 * n.distance:
good_matches.append(m)
return len(good_matches) ## what ? indentation error (it will return after the 1st) ?
please also learn, that the number of matches is entirely irrelevant here. if you happen to have a potted plant in the background in both images, it will happily take most matches from there. it does not at all know, "what you're looking for", so results are arbitrary.
so, "back to the drawing board" for you. discard this attempt, don't copypaste code without understanding it, and do some proper research on "object recognition" first.