[Qgis-user] Placing group of image at once
Kirk Schmidt
kirk at nortekresources.com
Tue Aug 26 06:45:19 PDT 2025
Hello All:
I wrongly assumes these were oblique images. Roland raises a few good
points. If you use the same or similar cameras, and mounting heights,
then the process is relatively simple. I assume you are not trying to
create a ortho image which has vertical displacement removed from the
image (which there will be very little of anyway). I would use the xml
coordinates and calculate the top left image coordinates based on ground
sampling distance, azimuth and image size in pixels. You can calculate
the azimuth using the rail line vector data at each image position,
assuming the camera mount for a block remains static. If you are using
UTM, you will traverse a number of zones across Canada and therefor I
would also calculate the convergence (difference between grid north and
true north for each image. This will fine tune the orientation as you
get closer to a utm zone boundary as you head east or west across the
country in your processing.
Depending on the camera/lens combination used, you may find a radial
distortion is an issue in the images. You can adjust for this using a
tool such as Radcor.
Finally, reach out to me privately and I can run your sample image as a
test. I am located in Nova Scotia.
Kirk Schmidt
kirk at nortekresources.com
On 8/26/2025 9:10 AM, Roland Spielhofer via QGIS-User wrote:
> Hi Leopold,
> as others mentioned, the sample image look like to be taken facing
> downward - like an aerial image take by a drone or veritcally from a
> railwagon - is this right?
> If you just want show the images on a map and have sort of a
> high-resolution aerial image of the tracks, you would just need to
> create a world file for each JPG.
> https://en.wikipedia.org/wiki/World_file
> You say you have a location and orientation for all images - this
> should be sufficient to create the world files.
> You would need the coordinate of the upper left corner of the image -
> probably the coordinate you have in your XML is the position of the
> camera that has taken the image. This would be the center of the image
> (assuming the camera looks vertical to the ground) Together with the
> heading (orientation) it would be easy to calculate the position of
> the upper left corner, given that the distance from camera to ground
> is known/fixed. If the camera was mounted on a railcar the distance is
> fixed and should be measured. If the distance between camera and
> ground varies with each image, it gets complicated because ... see below.
> If location accuracy is not that important you could also take the
> location from the XML file directly or apply a fixed offset.
> You then need the size of a pixel of the image on the ground
> (https://en.wikipedia.org/wiki/Ground_sample_distance)
> <https://en.wikipedia.org/wiki/Ground_sample_distance>- you could
> measure the distance between the rails in pixels on the image - the
> track gauge should be known or at least easy to find out (and assume
> that the pixel are square). Then you get the GSD and you can
> calculated the left upper corner location and start filling the world
> file with the other parameters.
> The rotation parmeters can then also be calculated from the
> orientation you have in the XML file.
> I would advise to use a rectangular (projected) coordinate system as
> all calculations are much easier in [m] than in [degrees].
> In any case the images will not match perfectly while they are
> distorted (which they are if they come directly from a camera). To
> avoid that, an elaborate process using a terrain model etc. would be
> necessaery - essentially the process to produce orthophotos.
> To handle the large amount of images there are is something like
> virtual rasters, IIRC.
> hth
> Roland
> *Gesendet: *Mittwoch, 20. August 2025 um 16:20
> *Von: *"Léopold Stoessel via QGIS-User" <qgis-user at lists.osgeo.org>
> *An: *"qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>
> *Betreff: *[Qgis-user] Placing group of image at once
>
> Hello,
>
> Our team is currently working on a project to reconstruct the railways
> of Canada using QGIS. To do this, we collect data directly on the
> rails, taking a photo every 2 meters. Each image (JPG) is accompanied
> by an XML file containing its GPS coordinates (EPSG:4326) and orientation.
>
> Our goal is to display all the images on a QGIS map at their correct
> geographic location and with the proper orientation. (Example image:
> /Try.jpg/)
>
> As far as I understand, a JPG file needs either an associated PGW
> world file or must be converted into a georeferenced TIFF in order to
> be correctly placed on the map.
>
> Here are the challenges we're facing:
>
> * *PGW method*: I tried placing a PNG file with a PGW of the same
> name in the same directory, but QGIS seems to ignore the PGW file
> and creates HTML document with other coordinates instead.
> * *GeoTIFF method*: With over 500,000 images, manually
> georeferencing each one is not feasible.
>
> So I would like to ask for your advice:
>
> * Are we on the right track with our approach?
> * Which method would you recommend in our case?
> * Do you know of any way to automate the image placement and
> orientation based on our XML data?
> * Would it be possible to handle this through the Python console or
> using PyQGIS?
>
> Any guidance or suggestions would be greatly appreciated.
>
> Thanks in advance for your time and help!
>
> **
>
> **
>
> ** <https://www.cefrail.ca/>**
> <https://www.facebook.com/cefrail>**<https://www.linkedin.com/authwall?trk=bf&trkInfo=AQEjKKnHH0hB2QAAAYzqp8YogvhljVV4rfWfPZk4nt7Fxp7t-jgeC03T84SUqgFnFtN8YLHip3me96M7mf832Uiq6YnFyyw3y1AU8c10Tw4twclYPuLl6KexU9lj_p4Hp_UeifI=&original_referer=&sessionRedirect=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcefrail>
>
>
>
> *Léopold Stoessel*
>
> Stagiaire - Génie ferroviaire
>
> 1 866 544-RAIL
>
> _leopold.stoessel at cegepsi.ca <mailto:leopold.stoessel at cegepsi.ca>_
>
> _www.cefrail.ca <http://www.cefrail.ca/> _
>
> /RAIL est un centre intégré au Cégep de Sept-Îles/
>
>
>
> _______________________________________________ QGIS-User mailing list
> QGIS-User at lists.osgeo.org List info:
> https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe:
> https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
--
Kirk Schmidt, MScF, BScF, RPF
General Manager
Nortek Resource Solutions Inc.
26 Church Road
Sutherlands River, NS
B0K 1W0
Tel (902) 922.3607
Email:kirk at nortekresources.com
Web:www.nortekresources.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250826/446e1e3f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 780 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250826/446e1e3f/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 12263 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250826/446e1e3f/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 505 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250826/446e1e3f/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 5823 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250826/446e1e3f/attachment-0005.png>
More information about the QGIS-User
mailing list