Example #1
0
def test_JCD(im, silence=False):
    """ Testing: Joint Color Descriptor (JCD) """
    if not silence:
        print ""
        print "JCD:"
    jcd = JCD()
    jcd.extract(im)
    return (
        "n/a", #jcd.getStringRepresentation()
        Base64.encodeBase64String(
            jcd.getByteArrayRepresentation()),
        ParallelSolrIndexer.arrayToString(
            BitSampling.generateHashes(
                jcd.getDoubleHistogram())))
Example #2
0
def test_edge_histogram(im, silence=False):
    """ Testing: edge histogram """
    if not silence:
        print ""
        print "Edge Histogram:"
    edgehist = EdgeHistogram()
    edgehist.extract(im)
    return (
        edgehist.getStringRepresentation(),
        Base64.encodeBase64String(
            edgehist.getByteArrayRepresentation()),
        ParallelSolrIndexer.arrayToString(
            BitSampling.generateHashes(
                edgehist.getDoubleHistogram())))
Example #3
0
def test_PHOG(im, silence=False):
    """ Testing: Pyramidal Histogram of Gradient (PHOG) Descriptor """
    if not silence:
        print ""
        print "PHOG:"
    phog = PHOG()
    phog.extract(im)
    return (
        "n/a", # phog.getStringRepresentation()
        Base64.encodeBase64String(
            phog.getByteArrayRepresentation()),
        ParallelSolrIndexer.arrayToString(
            BitSampling.generateHashes(
                phog.getDoubleHistogram())))
Example #4
0
def test_color_layout(im, silence=False):
    """ Testing: color layout """
    if not silence:
        print ""
        print "Color Layout:"
    colorlay = ColorLayout()
    colorlay.extract(im)
    return (
        colorlay.getStringRepresentation(),
        Base64.encodeBase64String(
            colorlay.getByteArrayRepresentation()),
        ParallelSolrIndexer.arrayToString(
            BitSampling.generateHashes(
                colorlay.getDoubleHistogram())))
Example #5
0
def test_opponent_histogram(im, silence=False):
    """ Testing: opponent histogram """
    # sb.append(arrayToString(BitSampling.generateHashes(feature.getDoubleHistogram())));
    if not silence:
        print ""
        print "Opponent Histogram:"
    opphist = OpponentHistogram()
    opphist.extract(im)
    return (
        opphist.getStringRepresentation(),
        Base64.encodeBase64String(
            opphist.getByteArrayRepresentation()),
        ParallelSolrIndexer.arrayToString(
            BitSampling.generateHashes(
                opphist.getDoubleHistogram())))