सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.Algorithms.Image.Segmentation.SNIC
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
एसएनआईसी (सिंपल नॉन-इटरेटिव क्लस्टरिंग) पर आधारित सुपरपिक्सल क्लस्टरिंग. यह फ़ंक्शन, क्लस्टर आईडी का बैंड और इनपुट बैंड में मौजूद हर क्लस्टर के लिए औसत वैल्यू दिखाता है. अगर इनपुट के तौर पर 'seeds' इमेज नहीं दी जाती है, तो आउटपुट में 'seeds' बैंड शामिल होगा. इसमें जनरेट की गई सीड की जगहें शामिल होंगी. देखें: अचांता, राधाकृष्ण और ससट्रंक, सबीन, 'सुपरपिक्सल और पॉलीगॉन का इस्तेमाल करके, सामान्य नॉन-इटरेटिव क्लस्टरिंग', सीवीपीआर, 2017.
| इस्तेमाल | रिटर्न |
|---|
ee.Algorithms.Image.Segmentation.SNIC(image, size, compactness, connectivity, neighborhoodSize, seeds) | इमेज |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|
image | इमेज | क्लस्टरिंग के लिए इनपुट इमेज. |
size | पूर्णांक, डिफ़ॉल्ट: 5 | सुपरपिक्सेल सीड की जगह की दूरी, पिक्सल में. अगर 'सीड' इमेज दी जाती है, तो कोई ग्रिड नहीं बनाई जाती. |
compactness | फ़्लोट, डिफ़ॉल्ट: 1 | कॉम्पैक्टनेस फ़ैक्टर. ज़्यादा बड़ी वैल्यू की वजह से क्लस्टर ज़्यादा कॉम्पैक्ट (स्क्वेयर) हो जाते हैं. इसे 0 पर सेट करने से, दूरी के हिसाब से वज़न तय करने की सुविधा बंद हो जाती है. |
connectivity | पूर्णांक, डिफ़ॉल्ट: 8 | कनेक्टिविटी पर टैप करें. यह वैल्यू 4 या 8 होनी चाहिए. |
neighborhoodSize | पूर्णांक, डिफ़ॉल्ट: null | टाइल के आस-पास के पिक्सल का साइज़. इससे टाइल की सीमा पर दिखने वाली गड़बड़ियों से बचा जा सकता है. डिफ़ॉल्ट रूप से, यह वैल्यू 2 * साइज़ पर सेट होती है. |
seeds | इमेज, डिफ़ॉल्ट: null | अगर यह जानकारी दी जाती है, तो शून्य से ज़्यादा वैल्यू वाले पिक्सल का इस्तेमाल, सीड लोकेशन के तौर पर किया जाता है. 'कनेक्टिविटी' के हिसाब से, एक-दूसरे से जुड़े पिक्सल को एक ही क्लस्टर का हिस्सा माना जाता है. |
उदाहरण
कोड एडिटर (JavaScript)
// Note that the compactness and size parameters can have a significant impact
// on the result. They must be adjusted to meet image-specific characteristics
// and patterns, typically through trial. Pixel scale (map zoom level) is also
// important to consider. When exploring interactively through map tile
// visualization, the segmentation result it dependent on zoom level. If you
// need to evaluate the result at a specific scale, call .reproject() on the
// result, but do so with caution because it overrides the default scaling
// behavior that makes tile computation fast and efficient.
// Load a NAIP image for a neighborhood in Las Vegas.
var naip = ee.Image('USDA/NAIP/DOQQ/m_3611554_sw_11_1_20170613');
// Apply the SNIC algorithm to the image.
var snic = ee.Algorithms.Image.Segmentation.SNIC({
image: naip,
size: 30,
compactness: 0.1,
connectivity: 8,
});
// Display the original NAIP image as RGB.
// Lock map zoom to maintain the desired scale of the segmentation computation.
Map.setLocked(false, 18, 18);
Map.setCenter(-115.32053, 36.182016, 18);
Map.addLayer(naip, null, 'NAIP RGB');
// Display the clusters.
Map.addLayer(snic.randomVisualizer(), null, 'Clusters');
// Display the RGB cluster means.
var visParams = {
bands: ['R_mean', 'G_mean', 'B_mean'],
min: 0,
max: 255
};
Map.addLayer(snic, visParams, 'RGB cluster means');
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Note that the compactness and size parameters can have a significant impact
# on the result. They must be adjusted to meet image-specific characteristics
# and patterns, typically through trial. Pixel scale (map zoom level) is also
# important to consider. When exploring interactively through map tile
# visualization, the segmentation result it dependent on zoom level. If you
# need to evaluate the result at a specific scale, call .reproject() on the
# result, but do so with caution because it overrides the default scaling
# behavior that makes tile computation fast and efficient.
# Load a NAIP image for a neighborhood in Las Vegas.
naip = ee.Image('USDA/NAIP/DOQQ/m_3611554_sw_11_1_20170613')
# Apply the SNIC algorithm to the image.
snic = ee.Algorithms.Image.Segmentation.SNIC(
image=naip, size=30, compactness=0.1, connectivity=8
)
# Display the original NAIP image as RGB.
m = geemap.Map()
m.set_center(-115.32053, 36.182016, 18)
m.add_layer(naip, None, 'NAIP RGB')
# Display the clusters.
m.add_layer(snic.randomVisualizer(), None, 'Clusters')
# Display the RGB cluster means.
vis_params = {'bands': ['R_mean', 'G_mean', 'B_mean'], 'min': 0, 'max': 255}
m.add_layer(snic, vis_params, 'RGB cluster means')
m
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],["SNIC clustering segments an image into superpixels, outputting cluster IDs and per-cluster averages for each input band. Key parameters include `size` (seed spacing), `compactness` (cluster shape), and `connectivity`. A user can provide `seeds` to define seed locations; otherwise, they are generated. The output `Image` includes cluster IDs, band averages, and optionally generated seed locations. Adjusting `size` and `compactness` is crucial for optimal results, which are also affected by pixel scale.\n"]]