How to use mask extracted from a product into another one

Exactly after i did classification i want to extract a mask representing only one of the classes obtained in classification output.
With such mask i want to clip the original rasters with land/sea mask applied on it to obtain only those pixel belonging to the class i’m interested and then eventually perform a more detailed classification only in such remaining ROI.
I hope i’ve explained what i mean.

I succeded to get the class-mask but is there a way to use it in land/sea mask on a different product than the classifier output?

Thanks in advance.

A quite similar question was recently asked here: How do I extract value from one raster to another raster

Does my answer there bring you forward?

thanks for helping,
i’ve read that post and that’s similar to my purpose, but the main difference is that i want to clip (land/sea mask) all the rasters in one product using the mask (only one class) i obtained from the classification.
Further use the clipped images to perform a more detailed classification only on those clipped rasters.
From the post you suggest seems that i have to do a collocation with both products (rasters’ file and classification output) then i extract the mask and thus clip them.
Is it right?
And most of all do you think it makes sense or i would obtain the same results if i just use more detailed classes in the main classifier directly?

To me it makes sense to exlcude areas of a pre-classification to have only areas of interest remaining for a second classification.

So you make a mask with the mask manager defining the areas of your class of interest.
In a second step you apply this mask to the product to exclude all pixels outside the mask.
Then you can apply a second classification on the remaining product.

Ok got it, the first step is the collocation and then process all the rest.

I am trying to find out how to build a mask for a specific LC class from a classification. How do i do this?

first you use the pixel info tab and check what’s the pixel value of this class in your classified raster then you create the mask in the Mask manager by an expression like this “classification == 1”

1 Like