Hi GRASS users!
I have an image of a small object (e.g. photograph of blue square 15x5cm) which I want to automatically georeference. In addition, the image contains 6 points where I know the exact coordinates, i.e. these points can be use as ground control points (GCP) for rectifying the image. This is basically a experimental setup, and I could use different colors or shapes for the GCP; the image itself will then be rather a photograph of a fish on a white background than a blue square; I just want to test with a simpler setup before.
However, as I want to automatize the step of rectifying/georeferencing I am looking for a way to autodetect these six points in the image. I am thinking of tools like pattern/face recognition that are able to autodetect objects (e.g. eyes, points etc.) and extract their position (coordinates) within that image. I assume these coordinates together with their “true” position could then be used for rectifying the picture using e.g. i.rectify.
Has anyone done this or a similar exercise before and can recommend tools and approaches to auto-detect GCP from an image?
Any hints are welcome!
Best regards,
Johannes
On 06/10/16 11:59, Johannes Radinger wrote:
Hi GRASS users!
I have an image of a small object (e.g. photograph of blue square
15x5cm) which I want to automatically georeference. In addition, the
image contains 6 points where I know the exact coordinates, i.e. these
points can be use as ground control points (GCP) for rectifying the
image. This is basically a experimental setup, and I could use different
colors or shapes for the GCP; the image itself will then be rather a
photograph of a fish on a white background than a blue square; I just
want to test with a simpler setup before.
However, as I want to automatize the step of rectifying/georeferencing I
am looking for a way to autodetect these six points in the image. I am
thinking of tools like pattern/face recognition that are able to
autodetect objects (e.g. eyes, points etc.) and extract their position
(coordinates) within that image. I assume these coordinates together
with their "true" position could then be used for rectifying the picture
using e.g. i.rectify.
Has anyone done this or a similar exercise before and can recommend
tools and approaches to auto-detect GCP from an image?
I've never used it, but there's i.points.auto in the addons:
https://grass.osgeo.org/grass70/manuals/addons/i.points.auto.html
Moritz
Hi Johannes
However, as I want to automatize the step of rectifying/georeferencing I
am looking for a way to autodetect these six points in the image. I am
thinking of tools like pattern/face recognition that are able to
autodetect objects (e.g. eyes, points etc.) and extract their position
(coordinates) within that image. I assume these coordinates together
with their "true" position could then be used for rectifying the picture
using e.g. i.rectify.
Has anyone done this or a similar exercise before and can recommend
tools and approaches to auto-detect GCP from an image?
For a similar purpose, to automatize image to image registration, I have
used the library OTB toolbox(https://www.orfeo-toolbox.org/) along with
GRASS GIS.
OTB has a module called homologous point extraction which uses algorithms
like SIFT and SURF.
https://www.orfeo-toolbox.org//Applications/HomologousPointsExtraction.html
After getting the gcp's, I used grass plugin m.gcp.filter to filter out the
outliers, followed by i.rectify.
On a GRASS environment, following is what I used - representative code:
#GCP extraction using OTBcli_homologous points
otbcli_HomologousPointsExtraction -in1 input_b1.tif -band1 1 -in2
reference_b1.tif -band2 1 -algorithm sift -mode full -out OUTB1.txt
# Making the text file GRASS compatible
awk '{$5="1\t"$5}1' ${MYTMPDIR}/OUTB1.txt > ${MYTMPDIR}/OUTB1.txt
# importing the input TIFF files
r.in.gdal input=${y}_b1.tif output=${i}_b1 memory=${MEMORY}
#Moving the POINTS file to the GRASS group folder
mv ${MYTMPDIR}/OUTB1.txt ${GRASSLOC}/group/${i}/POINTS
#GCP filtering
m.gcp.filter group=${i} order=1 threshold=500 -b
i.rectify -a group=${i} extension=_rectified order=1 method=nearest --o
In this paper (http://www.mdpi.com/2072-4292/8/3/169/htm) , the steps are
explained and main codes are provided in appendix.
Here is a good link on SIFT, I guess it is more apt for your case with
digital photographs. In the above case, we tried on satellite data.
http://www.aishack.in/tutorials/sift-scale-invariant-feature-transform-introduction/
Hope this helps!!
Sajid