Index error

52 views
Skip to first unread message

Martin Laas

unread,
Jun 3, 2025, 4:40:50 PM6/3/25
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hello 

I am getting this error when running the field index function.

I am unsure how to resolve this error so any help would be greatly appreciated

Thanks
Martin

Error: [lapp] cannot use 'fun'. The number of values returned is less than the number of input cells.

(returning: 1, expecting: 6037)

Perhaps the function is not properly vectorized



Martin Gejl

unread,
Dec 3, 2025, 6:26:48 AM12/3/25
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Martin
I have the same error in qgis version 3.44.3
It is due to the Alpha band, I have fixed it for RGB indexes just putting in RE for the Alpha band  (Red,Green,Blue,RE)
But it would be nice not having to do that.
Regards
Martin

fmatias

unread,
Dec 3, 2025, 6:40:48 AM12/3/25
to FIELDimageR: A R package to analyze orthomosaic images from field trials.

Hi Martin and Martin,

Thank you for reviewing this. Let me clarify the image requirements:

The tool is designed to be flexible and can handle images with any number of layers - not just 3 or 5. While users may work with images containing many more bands, the vegetation indices calculations specifically use:

  • Red
  • Green
  • Blue
  • Red Edge (RE)
  • Near Infrared (NIR)

Alternatively, you can use the myIndex option where you can reference bands using custom names (e.g., "Band1" or "Band35").

Please let me know if you need any additional clarification.

Best regards, 

Filipe



Martin Gejl

unread,
Dec 3, 2025, 8:16:37 AM12/3/25
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Filipe
I am using the folowwing
EGVI,GD,GLI,NGRDI,HUE,S
Mayby I have overseen something using RE

:-)Martin

fmatias

unread,
Dec 3, 2025, 8:29:29 AM12/3/25
to FIELDimageR: A R package to analyze orthomosaic images from field trials.

Hi Martin,

I noticed there might be an issue with the index selection. The ERROR you're receiving is likely because the tool is trying to calculate an index that requires a Red Edge (RE) band, which isn't present in your data.

When selecting indices, please ensure that all required bands for the calculation are available in your image. You can review the complete list of available indices and their required bands in our documentation: https://github.com/pspawar71/FIELDimageR-QGIS?tab=readme-ov-file#p5

If you'd like to share which specific index you're trying to calculate, I can help you verify the required bands.

Best regards,

Filipe

Reply all
Reply to author
Forward
0 new messages