Efficient Image comparision and sending Image Difference  
Author Message
sarika





PostPosted: Architecture General, Efficient Image comparision and sending Image Difference Top

Scenario:

Client Program needs to send Screen shot after every 100 milli seconds.

Now i want to compare 1st sent screen shot with the next captured screen shot. I want to calculate the image difference and send only the difference betwwen the two screenshots to the server. and then  the 2nd Screenshot will be genrated on the server.

Conversion to byte array and then comparision is possible but that is very slow.

I need an efficient method. Because speed is the concern overhere.

regards

 




Architecture2  
 
 
sarika





PostPosted: Architecture General, Efficient Image comparision and sending Image Difference Top

Its Done!

Using XOR operator.

Process

Image1 XOR Image2 = Result

Passing Result to Server that has only the difference in Image

And at server end

Image1 XOR Result = Image2

regards

Sarika



 
 
sarika





PostPosted: Architecture General, Efficient Image comparision and sending Image Difference Top

Hi

I am sending byte array from client to server. The image genearted at server end is different while the sent Byte array and recd Byte array is same.

Can anybody help

Code Sample

Client

CompareImage.LogicalOperator LO = new CompareImage.LogicalOperator();

Bitmap i1 = new Bitmap(LO.XORing(oldImage, newImage,ref isSame));

i1 - will get the Image difference

Server

CompareImage.LogicalOperator LO = new CompareImage.LogicalOperator();

oldImage = newImage;

newImage = LO.XORing(oldImage, diffImage, ref isSame);

this.pictureBox1.Image = newImage;

Assumption - Server will have the first complete image.

regards



 
 
karwai





PostPosted: Architecture General, Efficient Image comparision and sending Image Difference Top

I'm not too sure about the code, but it seems ok.

Anyway, you can try encode the difference by some algorithm such as run length encoding, since most of the time the screenshot wouldn't have much difference, which yeilds many zeroes.