Use shaders to compare images
Do you know how can I write simple shader (hlsl) to compare two images ? I want to get on result percent of similarity ? Is it posible to use shaders in this case ? Can I for example count red pixels on im开发者_如何学Pythonage with shaders ?
It can be done simply by passing two textures to a shader and then running a pixel by pixel comparison in the pixel shader. Though it would take really long to compare the two images, the shader should give you an output image showing the difference!
But, if you want an output number representing the percentage difference, you should just run the comparison on the CPU!
精彩评论