Coder Social home page Coder Social logo

robotteam / javaphash Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 7.0 10 KB

One JAVA version of PHash (Perceptual Hash) algorithm (JAVA 版本的 官方经典PHash算法)

License: MIT License

Java 100.00%
phash java perceptual hash similarity image-similarity radial

javaphash's Introduction

One JAVA version of PHash (Perceptual Hash) algorithm (JAVA 版本的 PHash算法) 100%源自于C++ 的PHash (Perceptual Hash) algorithm 感知哈希算法 官网:https://www.phash.org/ 可以用于比较两张图片的相似程度 You can get the similarity between two images using this algorithm.

主函数入口:

com.tommy.main.Main

public class Main {

public static void main(String[] args) {
	
	Phash phash = new Phash();
	
	CImage imA=new CImage("D:\\cars\\temp\\3.jpg");// replace this with your own image path
	
	CImage imB=new CImage("D:\\cars\\temp\\4.jpg");// 替换成你自己的图片路径
	
	phash._ph_compare_images(imA, imB);
}

}

javaphash's People

Contributors

robotteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

javaphash's Issues

info about CImgae constuctor

Hi
could you please explain why do you have used that bold number in the formula below?
why we need to use them?
tks

int j = 0;
for (int i = 0; i < bufferSize; i += numComponents) {
float y0 = ### ((tempData[i + 2] & 0xFF) * 25
+ (tempData[i + 1] & 0xFF) * 129 + (tempData[i] & 0xFF) * 66);

int y = Math.round(y0 / 256.0f) + 16;
if (y > 255)
y = 255;
if (y > maxPixel) {
maxPixel = y;
}
this.data[j] = (byte) y;
j++;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.