Jump to content

Comparing JPEGS


Recommended Posts

I have a web cam that FTP's an image every 5 seconds , I need to process these images to see if anyone is in the lab. I tried inverting one of the images and adding them together , but there are too many changes. the web cam is mounted to an I-beam which does move very slightly so there are always little changes , i have a very crude method that cuts down on the number of images i save but i still get many images with no real changes. I don’t not have any of the NI Vision or IMAQ toolkits and wont be getting them. Anyone have any ideas on how I can process these images more effectively ?

Thanks

Dan

Link to comment

QUOTE (Dan Bookwalter @ Oct 23 2008, 06:15 AM)

I have a web cam that FTP's an image every 5 seconds , I need to process these images to see if anyone is in the lab. I tried inverting one of the images and adding them together , but there are too many changes. the web cam is mounted to an I-beam which does move very slightly so there are always little changes , i have a very crude method that cuts down on the number of images i save but i still get many images with no real changes. I don't not have any of the NI Vision or IMAQ toolkits and wont be getting them. Anyone have any ideas on how I can process these images more effectively ?

I haven't tried this, but if I were to approach the issue without IMAQ or Vision I would start by comparing the image data of the two images. In the image data cluster is "image" array. Compare these arrays to a threshold value. If they differ by more than 80% (you'll have to play with the value) you know you have pretty significant changes in the picture.

-Toby

Link to comment

QUOTE (TobyD @ Oct 23 2008, 11:26 AM)

I haven't tried this, but if I were to approach the issue without IMAQ or Vision I would start by comparing the image data of the two images. In the image data cluster is "image" array. Compare these arrays to a threshold value. If they differ by more than 80% (you'll have to play with the value) you know you have pretty significant changes in the picture.

-Toby

Toby

that basically what i am currently doing , i need to work on how i do the comparison and the percent change , i was hoping maybe others have already gone down this road and could head me in the right direction....

Thanks

Dan

Link to comment

QUOTE (Dan Bookwalter @ Oct 23 2008, 09:15 AM)

I don’t not have any of the NI Vision or IMAQ toolkits and wont be getting them. Anyone have any ideas on how I can process these images more effectively ?

This is kind of a random thought, but have you thought of comparing file sizes? JPG is a compressed format, so for spatially large enough images, the file size will change. Very very generally speaking, the more the image changes, the larger the file size delta*.

* I don't have any data to back that up.

Link to comment

QUOTE (Dan Bookwalter @ Oct 23 2008, 06:15 AM)

I don't not have any of the NI Vision or IMAQ toolkits and wont be getting them.

I'm not trying to be negative here, but what's the motivation behind trying essentially a research-level project without the right set of tools?

With IMAQ you could probably threshold the images to highlight colors of interest (maybe bright colored clothes that a person might be wearing) and then try the Diff of the images. Or split the image into regions and try diff'ing just the regions.

Vision applications are usually quite complex however simple they may seem to (since everyone has eyes, and even a 1-year old can tell when someone's in the room) to the outside observer.

The jpeg file may not be the best for image processing. Try a non-lossy file format like png for better results.

Neville.

Link to comment

QUOTE (Neville D @ Oct 23 2008, 12:37 PM)

I'm not trying to be negative here, but what's the motivation behind trying essentially a research-level project without the right set of tools?

With IMAQ you could probably threshold the images to highlight colors of interest (maybe bright colored clothes that a person might be wearing) and then try the Diff of the images. Or split the image into regions and try diff'ing just the regions.

Vision applications are usually quite complex however simple they may seem to (since everyone has eyes, and even a 1-year old can tell when someone's in the room) to the outside observer.

The jpeg file may not be the best for image processing. Try a non-lossy file format like png for better results.

Neville.

Neville

Well the problem here is that I work in the Auto industry and with the current state of that sector of the economy we are under a spending freeze for the time being. I cant give you actual numbers but we are way down on our budgeted income/profit for this year , all i will say is there are LOTS of zeros and more than one comma in our shortfall :( this is also a side project so i would have no chance of acquiring the IMAQ/Vision stuff at this time, and JPEG is the only format the camera has so it is what i am dealing with. as i said i have a crude method that works fairly well , i dont miss any events , but , i do have extras (too many). Of the 17000+ images that get FTP'ed during the day i end up with less that 600 files which i make into a movie , i just have lots of 'dead space' in my movie(s)....

Dan

Link to comment

Is there any reason why you're not using some freeware application instead? If you don't need the source code, or want to add more features I would recommend trying some freeware webcam surveillance software. Here's a few I found just with a quick google search.

http://www.giveawayoftheday.com/freeware/2...04/19/rise-sun/

http://biphome.spray.se/baxtrom/sscanii.htm

http://www.freedownloadmanager.org/downloa...bcamXP_53830_p/

Keep in mind I haven't used any of these, and there are a ton of other application which aren't free which do the job too.

Link to comment

Hi Dan,

Because you are using a webcam (probaly cmos), I would advise you not just to compare the images pixel for pixel. CMOS cameras mostly have a lot of noise so you have illiminate that first. Make a so called kernel (n x n matrix) that calculate average value of those pixels. In IMAQ you can do this with a filter function.

Alternative you can divide your image into sector (e.g.32x32 pixels) and check for differences using a threshold for each sector, then threshold on the number of changed sectors.

Lots of succes

Patrick

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.