Results 1 to 5 of 5
  1. #1
    anouar2002 is offline Member
    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0

    Default Indexing and Picture Similair Search

    Good evening guys,
    Is there a solution in Java so that I could search for images similar to a selected image.
    NB: images are stored in an ORACLE database.
    I await your response.
    Thank you in advance.
    Last edited by Fubarable; 04-22-2012 at 01:02 AM. Reason: distracting formatting removed.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  3. #3
    anouar2002 is offline Member
    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0

    Default Re: Indexing and Picture Similair Search

    I mean by similair : pictures which have some similarity in the color and pixels (signature).
    Like Google, when you drug and drop a picture in 'Google Search Images', it give the similaires pictures.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Indexing and Picture Similair Search

    I do not know of Java code for image similarity, but Google gave some decent results when searching for "image similarity algorithm java". Have you tried any of the hits to be found there?

  5. #5
    anouar2002 is offline Member
    Join Date
    Apr 2012
    Posts
    13
    Rep Power
    0

    Default Re: Indexing and Picture Similair Search

    Quote Originally Posted by Fubarable View Post
    I do not know of Java code for image similarity, but Google gave some decent results when searching for "image similarity algorithm java". Have you tried any of the hits to be found there?
    I found this but it is a comparaison between images :

    Java Code:
    // Importation des packages importants
    import java.sql.*; // Pour la connexion avec Oracle
    import java.io.*; // Pour les entrée sorties
    import oracle.jdbc.*; // Pour les pilotes Oracle
    import oracle.sql.*; // Pour les spécificité SQL d'Oracle
    import oracle.ord.im.OrdImage; // Pour la classe OrdImage
    import oracle.ord.im.OrdImageSignature; // Pour la classe OrdImageSignature
    
    public class Comparer_image {
    public static void main(String[] args) {
    try {
    // Etape 1 : Connexion à la base et désactivation de l'autocommit
    // Enregistrement du pilote Oracle
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    // Ouverture de la connexion
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@pagnol:1521:m205", // url de la base
    "benoit", // utilisateur
    "secret"); // mot de passe
    // Mise à false de l'autocommit
    conn.setAutoCommit(false);
    // Etape 2 : Récupération des descripteurs de signatures des deux images
    // Création d'une instance de l'objet Statement pour l'exécution de requête
    Statement stmt = conn.createStatement();
    // Ecriture de la requête de récupération des signatures des 2 images
    String sql = "SELECT signature FROM maTable WHERE id BETWEEN 1 AND 2 FOR UPDATE";
    // Execution et récupération du résultat e la requête
    OracleResultSet rset = (OracleResultSet) stmt.executeQuery(sql);
    // Déclaration des instances de l'objet OrdImageSignature
    OrdImageSignature signature1 = null;
    OrdImageSignature signature2 = null;
    // s'il y a un résultat
    if(rset.next()) {
    // Récupération du descripteur de l'OrdImageSignature de l'image 1
    signature1 = (OrdImageSignature) rset.getORAData(1,
    OrdImageSignature.getORADataFactory());
    // s'il y a un 2ieme résultat
    if(rset.next()) {
    // Récupération du descripteur de l'OrdImageSignature de l'image 2
    signature2 = (OrdImageSignature) rset.getORAData(1,
    OrdImageSignature.getORADataFactory());
    // Etape 3 : Comparaison des signatures
    // Ecriture de la commande définissant les coef. des critères de // comparaisons
    String commande = "color=1 texture=0 shape=0 location=0";
    // Comparaison par évaluation du score
    float f = OrdImageSignature.evaluateScore(signature1, signature2,commande);
    // Affichage de la comparaison
    System.out.println("Resultat de la comparaison : "+f);
    // Définition du seuil
    float seuil = 20;
    // Comparaison par la méthode isSimilar()
    int similaire = OrdImageSignature.isSimilar(signature1,signature2,
    commande,seuil);
    // Affichage de la comparaison
    System.out.println("image 1 similaire à l'image 2 ? "+similaire);
    }
    }
    // Etape 4 : Fermeture
    // Fermeture
    stmt.close();
    conn.close();
    } catch(SQLException e) { e.printStackTrace() ;}
    }

Similar Threads

  1. Need help with indexing
    By Link in forum New To Java
    Replies: 0
    Last Post: 03-12-2012, 04:08 AM
  2. Replies: 0
    Last Post: 02-24-2012, 08:39 AM
  3. Replies: 4
    Last Post: 03-24-2011, 11:50 PM
  4. Replies: 0
    Last Post: 10-29-2009, 09:28 AM
  5. Replies: 5
    Last Post: 08-26-2008, 03:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •