Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
The threshold will be image dependent. You will have to try to figure out what is a good value for your images. Or try some of my scripts that do thresholding. See, trianglethresh, kmeansthresh, kapurthresh, otsuthresh and others.
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
I just realized I lost resolution after transferring to Photobucket.
Since that image is a way too low resolution, below you will find a single row where you can see that the dog image is getting confused with the grass (the color of the dog seems to be similar to the grass).
[img]
http://i1039.photobucket.com/albums/a47 ... qjxyvt.jpg
[/img]
Since that image is a way too low resolution, below you will find a single row where you can see that the dog image is getting confused with the grass (the color of the dog seems to be similar to the grass).
[img]
http://i1039.photobucket.com/albums/a47 ... qjxyvt.jpg
[/img]
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Please upload your two input images separately. It is too unreliable for me to crop them consistently. In the future, please always post separate images, if you expect others to work on them for you.
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
I am using 6.7.7-10
I will update it...
I will update it...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Please also provide your platform!
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
ok. Sorry. I didn't realize the issue.
I will separate the images as follows:
here it goes:
I will separate the images as follows:
here it goes:
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
I use Linux: Ubuntu 14.x
I guess apt-get will update it???
I guess apt-get will update it???
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Sorry, I am on a Mac and know little about installing on Linux.
You only posted one image. I was suggesting you post both input images at full resolution. I don't see any change in size of the image you posted, if you say you earlier posted a low resolution version. Perhaps your image hosting service limits the size. Perhaps try another such as dropbox.com, if you really have a higher resolution (larger) pair of images.
You only posted one image. I was suggesting you post both input images at full resolution. I don't see any change in size of the image you posted, if you say you earlier posted a low resolution version. Perhaps your image hosting service limits the size. Perhaps try another such as dropbox.com, if you really have a higher resolution (larger) pair of images.
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Here goes the reference image:
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
This is the information provided by ImageMagick "identify":
a0.jpg JPEG 320x240 320x240+0+0 8-bit DirectClass 14.4KB 0.000u 0:00.000
transparent_dog.jpg JPEG 320x240 320x240+0+0 8-bit DirectClass 15.5KB 0.000u 0:00.000
So, both images are 320x240.
Thanks for your help!
a0.jpg JPEG 320x240 320x240+0+0 8-bit DirectClass 14.4KB 0.000u 0:00.000
transparent_dog.jpg JPEG 320x240 320x240+0+0 8-bit DirectClass 15.5KB 0.000u 0:00.000
So, both images are 320x240.
Thanks for your help!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
You have several objects in that pair that have changed. You need to adjust the threshold and pick the area that limits you to those objects. Not quite as easy as with only one object that changes.
This seems to work for me:
Each separate region in the thresholded diff image that remains is coded with a different grayscale so it can be identified later. You can threshold this image to create a binary mask (-threshold 0) and use the mask with input image that has the new objects to see what it has selected.
Also I would suggest you start with non-compressed images, such as png rather than jpg. JPG is lossy and would contribute to the noise in your images.
This seems to work for me:
Code: Select all
convert sample1.jpg sample2.jpg -compose difference -composite diff2.png
convert diff2.png -auto-level -threshold 12% diff2_t12.png
convert diff2_t12.png -define connected-components:verbose=true -connected-components 4 null:
convert diff2_t12.png -define connected-components:area-threshold=141 -connected-components 4 -auto-level changes.gif
Each separate region in the thresholded diff image that remains is coded with a different grayscale so it can be identified later. You can threshold this image to create a binary mask (-threshold 0) and use the mask with input image that has the new objects to see what it has selected.
Code: Select all
convert sample2.jpg \( changes.gif -threshold 0 \) -alpha off -compose copy_opacity -composite color_changes.png
Also I would suggest you start with non-compressed images, such as png rather than jpg. JPG is lossy and would contribute to the noise in your images.
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Wow! This is great.
I think I can later select the object by its shape.
Now the issue is the variations of contrast... Do you think ImageMagick has "image registration" capabilities?
This sounds as a powerful technique to keep the image steady, no mater the ilumination issues.
I think I can later select the object by its shape.
Now the issue is the variations of contrast... Do you think ImageMagick has "image registration" capabilities?
This sounds as a powerful technique to keep the image steady, no mater the ilumination issues.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
Once you have found it once, you can track it by its centroid in the CCL stats. That way you can filter it by tracking the coordinates in subsequent image or using a combination of coordinates, area, color and/or bounding box.I think I can later select the object by its shape.
Also you can threshold each object so that you only have one feature in the CCL color output, then run
Code: Select all
identify -verbose -moments ccl_color_output.gif
Yes, in IM you can use compare to locate the shift in an image relative to a slightly larger image.Now the issue is the variations of contrast... Do you think ImageMagick has "image registration" capabilities?
But I have a script, phasecorr, that will tell you the offset of two same sized images. But you need to run IM in HDRI mode and install the FFTW delegate library.
Also you might try running a mild blur or median filter on each image to reduce the noise and keep the objects more together as some have been broken into two or more parts.
Re: Using ImageMagick to identify a person walking over grass for a fixed camera in a sunny day
I will study these ideas.
How likely will my software be able to raise a warning in case of detecting a human being?
How about applications for blind people? Do you invision the use of ImageMagick to help blind people? I am not talking about OCR techniques, which are very well known.
I am focused on detecting human image in a door bell camera, so the person inside the house is able to tell how many people is there in front of the door, etc...
How likely will my software be able to raise a warning in case of detecting a human being?
How about applications for blind people? Do you invision the use of ImageMagick to help blind people? I am not talking about OCR techniques, which are very well known.
I am focused on detecting human image in a door bell camera, so the person inside the house is able to tell how many people is there in front of the door, etc...