get_x_in_webpage_picture
get_x_in_webpage_picture($picture_filepath,$similar_koeff=0.95,$similar_algoritm=5); - get the x coordinate of the specified image on the current page
The function accepts parameters as input:
- $picture_filepath – path to the image file
- $similar_koeff – similarity coefficient (from 0 to 1) - available from version 7.0.3
- $similar_algoritm – similarity search algorithm (from 0 to 5) - available from version 7.0.3 :
- 0 - R(x,y)=sumx',y'[T(x',y')-I(x+x',y+y')]2 - Squared difference (the difference in the square)
- 1 - R(x,y)=sumx',y'[T(x',y')-I(x+x',y+y')]2/sqrt[sumx',y'T(x',y')2 sumx',y'I(x+x',y+y')2] - (normalized difference in square)
- 2 - R(x,y)=sumx',y'[T(x',y') I(x+x',y+y')] - Cross correlation (a correlation)
- 3 - R(x,y)=sumx',y'[T(x',y') I(x+x',y+y')]/sqrt[sumx',y'T(x',y')2 sumx',y'I(x+x',y+y')2] - Normalized cross correlation)
- 4 - R(x,y)=sumx',y'[T'(x',y') I'(x+x',y+y')], where T'(x',y')=T(x',y') - 1/(wxh) sumx",y"T(x",y") I'(x+x',y+y')=I(x+x',y+y') - 1/(wxh) sumx",y"I(x+x",y+y") - Cosine coefficient)
- 5 - R(x,y)=sumx',y'[T'(x',y') I'(x+x',y+y')]/sqrt[sumx',y'T'(x',y')2 sumx',y'I'(x+x',y+y')2] - Normalized cosine coefficient (normalized cosine coefficient)
After testing, the function returns the result of its work to the script :
X – X - coordinate of the specified image on the page