Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation incorrectly reprojects image #11

Closed
Chris-Schnaufer opened this issue Jul 21, 2020 · 2 comments
Closed

Rotation incorrectly reprojects image #11

Chris-Schnaufer opened this issue Jul 21, 2020 · 2 comments

Comments

@Chris-Schnaufer
Copy link
Contributor

Rotating the image in the instructions causes the image to reproject. This causes the rotated image to have incorrect geographic coordinates. The pixels need to be rotated and the geographic information to remain intact.

A way to think about this is recognizing that the original image covers a certain area of the ground; represented by the geographic coordinate system and the image geographic extents. When the rotation step is performed, the image still represents the exact same geographic coordinate system and extents as the original image, only the pixel representation is different.

The following, unassociated, link shows the effect of the reprojection geographically: https://gis.stackexchange.com/questions/131465/gdal-rotate-dem (first response, under Update). As can be seen, the image is now covering a different geographic area after rotation.

The two images in the Rotating the image section display the same area of ground, only the pixel representation has changed.

What worked for me
I couldn't find an easy way to rotate the pixels in R, not a strong language for me. What I was able to do is assign the Crop crs and extent back to the rotated image as follows:

crs(EX1.Rotated)<-crs(EX1.Crop)
extent(EX1.Rotated)<-extent(EX1.Crop)

Having a background in GIS, I need to point out that this is an inexact solution that may be considered "close enough".

@filipematias23
Copy link
Collaborator

Hi @Chris-Schnaufer,

I have been thinking on a way to fix this rotation problem. I have some ideas, as soon as I get more improvment on that I will get back to you. Thank you for your suggestion..!!!

Let me know if you have any other idea.

All the best,
Filipe

@filipematias23
Copy link
Collaborator

Hi @Chris-Schnaufer ,

I just uploaded the new version of FIELDimageR (0.2.8). In this version, I fixed the rotation issue. Now, it's possible to fit the shapefile back to the original image using the same CRS.

For more information:
(1) https://github.com/OpenDroneMap/FIELDimageR#P3
(2) https://github.com/OpenDroneMap/FIELDimageR#P5

Thank you for your suggestions...!

All the best,
Filipe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants