iamdonovan / spymicmac

A python package for processing KH-9 and historical aerial imagery using MicMac
GNU General Public License v3.0
12 stars 4 forks source link

OSError: [Errno 22] Invalid argument #11

Closed gyp-1991-gq closed 1 year ago

gyp-1991-gq commented 2 years ago

image image What is the cause of this error? Please help me, thank you!

iamdonovan commented 2 years ago

This looks either like an issue with the filename/path that you're using, or that 'Ori-InterneScan' hasn't been created. Can you check whether 'Ori-InterneScan' exists in the directory after you run the script, and let me know what filename you're feeding to image.find_reseau_grid()?

gyp-1991-gq commented 2 years ago

Thank you very much for your answer! I have solved the problem.

gyp-1991-gq commented 2 years ago

When I run find_reseau_grid DZB1211-500125L005001_a.tif, I get an error. image If I try to ignore this error, run the remove_cross command. Unfortunately, the cross on the image cannot be removed. Please help me, thank you!

iamdonovan commented 2 years ago

Right, because remove_cross depends on the output of find_reseau_grid.

Do you see the white line near the top of the image, outside of the border? Try cropping the image to remove that.

gyp-1991-gq commented 2 years ago

Can this step be operated directly in ArcGIS? Or which command of micmac? Thank you very much!

gyp-1991-gq commented 2 years ago

image Is it this white line?

iamdonovan commented 2 years ago

Yes, it's that white line. You might be able to do it in ArcGIS, but for gdal_translate it would be something like:

gdal_translate -srcwin 0 yoff xsize (ysize-yoff) in.tif out.tif

where yoff is the line where the line ends, and (xsize, ysize) are the size of the image in (columns, rows).

gyp-1991-gq commented 2 years ago

Thank you very much!

gyp-1991-gq commented 2 years ago

image image ![Uploading image.png…]() I successfully ran the relevant command, but I still didn't remove the "cross". Why is that?

gyp-1991-gq commented 2 years ago

image Why does this error occur?

iamdonovan commented 2 years ago

Try this with the changes in 18d5ff0418452d2f2102c244495d7a03da73ecca - I tested find_reseau_grid on both DZB1211-500125L005001_a.tif and DZB1211-500125L005001_b.tif, with no errors.

gyp-1991-gq commented 2 years ago

Can you tell me the parameters you entered with gdal_translate -srcwin clipping? Please help me, thank you!

gyp-1991-gq commented 2 years ago

Are images clipped before running Generate_MICMAC_measures -joined?

gyp-1991-gq commented 2 years ago

Why do I get an error <tifffile.TiffFile 'DZB1211-500125L005001_a_c.tif'> shaped series shape does not match page shape running find_reseau_grid DZb1211-500125L005001_a_c.tif after clipping? I also get another error C: Miniconda3 envs KH9 lib site-packages matplotlib quiver.py:671: RuntimeWarning: Mean of empty slice. mean = a [~ self.Umask].mean () image

gyp-1991-gq commented 2 years ago

There are no red arrows in the matching image.

iamdonovan commented 2 years ago

Can you tell me the parameters you entered with gdal_translate -srcwin clipping? Please help me, thank you!

I didn't clip the images before running - the change to image.get_rough_frame in https://github.com/iamdonovan/sPyMicMac/commit/18d5ff0418452d2f2102c244495d7a03da73ecca should eliminate the need to clip the image beforehand.

Why do I get an error <tifffile.TiffFile 'DZB1211-500125L005001_a_c.tif'> shaped series shape does not match page shape running find_reseau_grid DZb1211-500125L005001_a_c.tif after clipping?

This isn't an error, it's a warning. My guess is that gdal_translate didn't update the metadata tags, but it shouldn't have any actual effect on the output.

gyp-1991-gq commented 2 years ago

Thank you very much for your patient answer.