Image moved Left, Right, Up or down?
Image moved Left, Right, Up or down?
I have a master image and I want to compare to like images to see if the like image has moved left, right, up or down from the master. Is this possible with Imagemagick?
I'm using VB6 with COM DLL
I'm using VB6 with COM DLL
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image moved Left, Right, Up or down?
You can use compare on two different image of the same size to see if different, but not the direction. But you can use one larger image and a smaller image to find the best match and offset using compare as well.
see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/ (see section on statistics for fuzz metric)
An old example is at
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
but you now need to add -subimage-search to inform IM that the two images are different sizes. see
http://www.imagemagick.org/script/comma ... age-search
If the search bails without a match, you may also need to use -dissimilarity-threshold. see
http://www.imagemagick.org/script/comma ... -threshold
see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/ (see section on statistics for fuzz metric)
An old example is at
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
but you now need to add -subimage-search to inform IM that the two images are different sizes. see
http://www.imagemagick.org/script/comma ... age-search
If the search bails without a match, you may also need to use -dissimilarity-threshold. see
http://www.imagemagick.org/script/comma ... -threshold
Re: Image moved Left, Right, Up or down?
So would I need to resize my secondary images, then compare master image?
Re: Image moved Left, Right, Up or down?
I found this at one of the links you suggested. (http://www.imagemagick.org/Usage/compare/#camera)
I am getting an "average" difference for all the images and then if the individual difference is greater than the average difference I keep the image as it has something in it.
How would I do this?
I am getting an "average" difference for all the images and then if the individual difference is greater than the average difference I keep the image as it has something in it.
How would I do this?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Image moved Left, Right, Up or down?
Yes. One method is to crop a small area from the "other" image, and search for that in the master. If it occurs in the same place, it hasn't moved.cambob wrote:I have a master image and I want to compare to like images to see if the like image has moved left, right, up or down from the master. Is this possible with Imagemagick?
Code: Select all
convert other.jpg -crop 100x100+300+400 crop.png
compare -metric RMSE master.jpg crop.png -subimage-search null:
snibgo's IM pages: im.snibgo.com
Re: Image moved Left, Right, Up or down?
How would I issues these commands using the dll? or a script?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Image moved Left, Right, Up or down?
You can type them at the command line. Or put them in a script.
snibgo's IM pages: im.snibgo.com
Re: Image moved Left, Right, Up or down?
No way to issue and get result using Dll in Visual Basic?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Image moved Left, Right, Up or down?
Yes, Visual Basic, or VBScript, or C, or PHP, or pretty much anyhow you want.
snibgo's IM pages: im.snibgo.com
Re: Image moved Left, Right, Up or down?
Do you know where I can get a sample of its use using commands in VB?
convert other.jpg -crop 100x100+300+400 crop.png
compare -metric RMSE master.jpg crop.png -subimage-search null:
convert other.jpg -crop 100x100+300+400 crop.png
compare -metric RMSE master.jpg crop.png -subimage-search null:
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Image moved Left, Right, Up or down?
There are examples on these forums, and Google finds many more.
snibgo's IM pages: im.snibgo.com