IMAGINE Discussions

Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Occasional Contributor
Posts: 7
Registered: ‎06-14-2017
Accepted Solution

Empty classes in Supervised classification attribute table

[ Edited ]

Hey there,

 

 

When I carry out a supervised classification I end up with multiple empty classes along with the classes I've selected with training data. The 'ghost' classes have a value of '0' in the histogram column. I am curious if there is a way to avoid this empty class output. Its a bit of a pain to have to go back and adjust my reference/validation values for the accuracy assessment because it counts these blank outputs as their own class.  Any tips would be appreciated.

 

Thanks,

 

Teri

Highlighted
Technical Evangelist
Posts: 652
Registered: ‎02-02-2016

Re: Empty classes in Supervised classification attribute table

Hi Teri,

 

In order to remove the empty classes from your classified image, you will have to recode the image so that there are no empty class values (rows) between the valid class values. You can use the Recode tool to perform this task.

Raster tab > Raster GIS group > Thematic menu > Recode

 

Your classified image has raster values ranging from 0 to 14 with eight distinct classes that contain pixels: 0, 6, 7, 9, 10, 11, 12, 14. You should recode this image so that its pixel values range from 0-7.

 

When you are setting up the recode, select all of the empty class rows (histogram = 0) and set the new value to 0. Then set the new values for the valid classes.

 

Old Value

New Value

0

0

1

0

2

0

3

0

4

0

5

0

6

1

7

2

8

0

9

3

10

4

11

5

12

6

13

0

14

7

 

 

The drawback of recoding your image to remove the empty classes is that you will lose your class names and colors for each pixel value. You can use the Raster Attribute Table to manually re-enter these attributes.

 

Regards,

 

Stephen Bent

Hexagon Geospatial Support

Highlighted
Occasional Contributor
Posts: 7
Registered: ‎06-14-2017

Re: Empty classes in Supervised classification attribute table

Thanks Stephen, your response was helpful. 

 

 

Another related question: My image used in classification was created by clipping an AOI from a larger image. As the AOI was not a perfect rectangle, it created a black background around the edges to take the shape of a perfect rectanlge. Is this the cause of the creation of empty classes in supervised classification? Can I prevent this from occuring in the future by selecting 'ignore zero in output stats' when clipping my image?

Highlighted
New Contributor
Posts: 4
Registered: ‎11-13-2019

Re: Empty classes in Supervised classification attribute table

hello,

I have recoded an image after unsupervised classification. after that i need to divide one class into (split attributes from on to two). How can I do that?

 

Highlighted
Regular Contributor
Posts: 288
Registered: ‎11-16-2015

Re: Empty classes in Supervised classification attribute table

Hi. Perhaps you could give a little more detail of what the class is and how you want to split it into two - what are the distiguishing features of the two new classes? Johnnie