Improve proprietary PHP jpeg image motion detection function

Avg Bid (AUD)
Project Budget (AUD)
$250 - $750

Project Description:
Please make this (currently working) motion detection function faster (a lot - at least 10x) - want to use it to compare single images to check for changes between jpeg images.

Optional: Also, it would be great if this function could deal with light and white balance changes (sun coming out behind the clouds, turning on a light) to prevent false positives. Maybe set with a different option.
Optional: Be able to save the diffs between the images in a proprietary format and be able to patch the previous image with the diff later

I have only implemented this quick and dirty in a few hours years ago - not saying it's the best or easiest or fastest way. Happy to be surprised. May require a PHP extension written in C / C++ - or some external image library.

The function should be able to deal with some random noise from a camera.

img_old = php image object (reference)
img_new_data = jpeg data / image as string
tlx=top left, bottom right etc. for the mask. rectangle - the mask will allow the function to ignore specific parts of the image to be excluded 0<=x<16, 0=<y<12

returns a value between 0 and 1000 - 0 = no change, 1000 = full black/white change - adjusted for the mask

Skills required:
Engineering, PHP, Software Architecture
Additional Files: motion.php
About the employer:
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

$ 750
in 12 days
$ 750
in 10 days
Hire pawanyadav777
$ 500
in 21 days
$ 750
in 30 days
$ 700
in 25 days
$ 350
in 5 days