Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[-b R B (N-th band from R-th raster)] #5

Open
robeson1010 opened this issue Nov 4, 2017 · 4 comments
Open

[-b R B (N-th band from R-th raster)] #5

robeson1010 opened this issue Nov 4, 2017 · 4 comments

Comments

@robeson1010
Copy link

how to seg only in some band?

@rodolfolotte
Copy link

What you mean? Perform the segmentation itself (createSuperpixelXXX() - based only in some bands), or perform the statistics for some bands? I never used this argument [-b], but I will give you my suggestion.

If it is the first (perform the segmentation), I would recommend to strip out the band you want after the line:

LoadRaster( InFilenames[0], raster );

Check if it s more than one band and then take what you are interested:

size_t m_bands = raster.size();
if (m_bands > 1){ 
STRIP_OUT_THE_BAND 
}

Some link that could help you: http://www.gdal.org/gdal_translate.html
After you get the band, and transform it as a raster, pass it as an argument to "createSuperpixelXXX() instead.

Hope I could help!

@robeson1010
Copy link
Author

I mean I have a raster with 6 bands and I only want segment the raster with band (1,2,3,4). How to deal with it

@rodolfolotte
Copy link

You need to do some process to, first, split out all bands and, second, stack it in a new raster. After to do this process, you call createSuperpixelXXX() with this new image.
What I recommended first was to read more about GDAL (translate).

@robeson1010
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants