<div>Greetings Mr. Neteler</div>
<div><br>I'm implementing a methodology in GRASS to eliminate training_areas outliers. What I do?<br>1- first I pick up the current training areas for a class and I calculate mean vector and covariance matrix<br>2- Invert the covariance matrix<br>
3- Compare each pixel, that is included in a training_area, with a defined threshold and if it's OK, It's still labeled as 1 or, otherwise, it's eliminated.</div>
<div><br>It would be pointless in developing this function from scratch in GRASS so I used i.gensig that is used to calculate mean vector and covariance matrix for training areas. (This means that step 1 and 2 (by a simple implementation) is covered. (Do anyone suggest other function instead of this?)<br>
</div>
<div>My problem is with the third step (I'm still not very familiar with some GRASS programming functions/functionalities)<br>I have created a cycle that goes for each row and col and I get the correct raster pixel value from group but I'm not being able to retrieve the classification. This is an overview of the approach:<br>
for row=0, row<nrows, row++<br> for col=0, col<ncols, cols++</div>
<div> Check in training area if the pixel value is >-1 (this is the problem I'm not being able to get thiS)<br> for band=0, pband<nbands, pband++<br> pband[band]=cell_value for band "band", in row=row, col=col and that is included in the training area.<br>
- Then apply the compare (easy)<br> - write (I think it's not a problem)<br> }<br> }<br>}<br>In what am I a bit lost:<br>1- How can I get the value from training areas raster?<br>2- How can I only apply this rule only to the pixels that are included in a training_area?</div>
<p><br>Can anyone give me a few tips?</p>
<p><br>Thanks<br>Katrin</p>