Skip to content

Band order passing incorrectly inside the Classification processing script #410

@Cenan-Alhassan

Description

@Cenan-Alhassan

Hello, Mr. Congedo! During my personal project, I was using the classification processing script (ID: scp_8:classification) when I realised that its output differs from the classification found in the "Band processing" menu, even though they're using the same function (rs.band_classification).

After a lot of debugging, I realised it was due to a difference in the order of the bands being passed.

Using the classification from the "Band processing" menu, the bands are passed using my defined band set. I was using Sentinel-2 images, which contain the B8A band. The correct order of this band is after the B08 band, which can be defined in the band set, and the result is accurate.

It is a different story when using the scp_8:classification script. For example, here I am using the processing script to choose my input band set from my Sentinel-2 data:

Image

The critical issue lies in the fact that the order cannot be changed. The B8A band is alphanumerically after B12, not B08, and I cannot change that. Therefore, the BA8 band will be after B12 in the input_bands variable being passed to rs.band_classification:

Image

This obviously causes the classification to be incorrect.

I was able to solve this by applying a sorting function for the input_bands variable, but that is specific to Sentinel-2 data. Your feedback on this issue is much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions