Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
for(i=0,j=0;i<firstCanvasPixels.width, j<firstCanvasPixels.height;i+=4,j+=4)
        {
            for (p = 0, q = 0; p < secondCanvasPixels.width, q < secondCanvasPixels.height; p+=4, q+=4) {
                if (firstCanvasPixels[i][j] != secondCanvasPixels[p][q]) {
                    document.getElementById("showError").value = "Detected";
                }
                else {
                    document.getElementById("showError").value = "Not detected";
                }
            }

        }



I am working on windows 8 app development. I need to compare two images data in pixels. so please help me to correct this code. or tell me that code is feasible or not. I am writing code in HTML5, JavaScript.
Posted
Comments
Zoltán Zörgő 12-Mar-13 4:30am    
Comparing captured images pixel by pixel? Are you serious?
NachiketM 12-Mar-13 4:36am    
yes actually i wanted to detect motion, if any help is there tell me
Zoltán Zörgő 12-Mar-13 4:44am    
It is not that simple. Look here first: http://experiments.davidhunterdesign.com/?p=226
NachiketM 12-Mar-13 6:46am    
thank you, its just a demo. What can I use to do such program?
Zoltán Zörgő 12-Mar-13 8:19am    
Might be just a demo, but it is better than yours. So just view it's source and see how it is made - and copy what you need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900