Example #1
0
ap.add_argument("-i", "--index", required=True, help="Path to where the computed index will be stored")
args = vars(ap.parse_args())


# initialize the index dictionary to store our our quantifed
# images, with the 'key' of the dictionary being the image
# filename and the 'value' our computed features

# if(os.path.isfile(args["index"])):
#
#     index = cPickle.loads(open(args["index"]).read())
#     if(index.has_key(args["file"])):
#         print "has exist"
#         sys.exit(0)
s = SimilarImages()
i = s.findByName(args["file"])
if i != None:
    print "has exist"
    sys.exit(0)

index = {}

# initialize our image descriptor -- a 3D RGB histogram with
# 8 bins per channel
desc = RGBHistogram([8, 8, 8])


# load the image, describe it using our RGB histogram
# descriptor, and update the index
image = cv2.imread(args["dataset"] + "/" + args["file"])
features = desc.describe(image)
Example #2
0
                required=True,
                help="Path to where the computed index will be stored")
args = vars(ap.parse_args())

# initialize the index dictionary to store our our quantifed
# images, with the 'key' of the dictionary being the image
# filename and the 'value' our computed features

# if(os.path.isfile(args["index"])):
#
#     index = cPickle.loads(open(args["index"]).read())
#     if(index.has_key(args["file"])):
#         print "has exist"
#         sys.exit(0)
s = SimilarImages()
i = s.findByName(args["file"])
if (i != None):
    print "has exist"
    sys.exit(0)

index = {}

# initialize our image descriptor -- a 3D RGB histogram with
# 8 bins per channel
desc = RGBHistogram([8, 8, 8])

# load the image, describe it using our RGB histogram
# descriptor, and update the index
image = cv2.imread(args["dataset"] + "/" + args["file"])
features = desc.describe(image)
index[args["file"]] = features