Jump to content

image navigation

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
cecio

cecio

    Newbie

  • Members
  • Pip
  • 2 posts
hi guys,

i am looking for help because i don't know how engine like google or altavista or yahoo and many other can make different assumption on similar serarches....

just allow me to do an example to be understand...


my proble is about image indexing

e.g.

if a make a search on google (google only for example) and the key word is "penguin", i will find ( in the image section) images of that animal and many other images...

if a add a word....and my key become "penguin iceberg" i will find only that images that belogs to the animal....the penguin off course!!

but if my key is: "penguin linux", i ll only find TUX........

now i can understand that engines like those must work not only by matching images but also the context (the environment (as you want to call it)) in wich they are...

but how to formalize thath problem, and encode it?...how to build an application that do it for me (using , if is possible, php)?

if anybody know something about that plese whisp to me:)


thank for reading my poor english
yours faithfully


cecio

#2
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Well.. i guess it goes like this:

<?php


// Connect to database

$con = mysql_connect("localhost", "username", "password");

if(!$con){

die(mysql_error());

}

// Select a database

$selDb = mysql_select_db("database", $con);

if(!$selDb){

die(mysql_error());

}


// Your search term

$term = "penguin";


// Select all images what has a keyword like are your search term

$query = "SELECT * FROM images WHERE keyword LIKE '%$term%'";

$query = mysql_query($query, $con);


// Close connection

mysql_close($con);


?>

This part:
$query = "SELECT * FROM images WHERE keyword LIKE '%$term%'";

searches keywords that includes your search term.. that means if you enter one simple word.. penguin for example then you can find lot's of penguin's pictures but if you search linux penguin then it has more information what picture you wanna find.. :) that's why you get linux penguins not just penguins :)

i hope it helped