ee.Algorithms.Image.Segmentation.SNIC

SNIC (সিম্পল নন-ইটারেটিভ ক্লাস্টারিং) ভিত্তিক সুপারপিক্সেল ক্লাস্টারিং। এটি ক্লাস্টার আইডিগুলোর একটি ব্যান্ড এবং প্রতিটি ইনপুট ব্যান্ডের জন্য ক্লাস্টার-ভিত্তিক গড় আউটপুট হিসেবে দেয়। যদি 'সিডস' ইমেজটি ইনপুট হিসেবে প্রদান করা না হয়, তাহলে আউটপুটে একটি 'সিডস' ব্যান্ড অন্তর্ভুক্ত থাকবে, যেখানে তৈরি করা সিডগুলোর অবস্থান থাকবে।

দেখুন: অচন্তা, রাধাকৃষ্ণা এবং সাসট্রাঙ্ক, সাবিন, 'সিম্পল নন-ইটারেটিভ ক্লাস্টারিং ব্যবহার করে সুপারপিক্সেল এবং বহুভুজ', সিভিপিআর, ২০১৭।

ব্যবহার ফেরত
ee.Algorithms.Image.Segmentation.SNIC(image, size , compactness , connectivity , neighborhoodSize , seeds ) ছবি
যুক্তি প্রকার বিস্তারিত
image ছবি ক্লাস্টারিংয়ের জন্য ইনপুট চিত্র।
size পূর্ণসংখ্যা, ডিফল্ট: ৫ সুপারপিক্সেল সীড অবস্থানের ব্যবধান, পিক্সেলে। যদি 'সীড' ইমেজ প্রদান করা হয়, তাহলে কোনো গ্রিড তৈরি করা হয় না।
compactness ফ্লোট, ডিফল্ট: ১ সংহতকরণ গুণক। এর মান যত বেশি হবে, ক্লাস্টারগুলো তত বেশি সংহত (বর্গাকার) হবে। এটিকে ০-তে সেট করলে স্থানিক দূরত্বের ওয়েটিং নিষ্ক্রিয় হয়ে যায়।
connectivity পূর্ণসংখ্যা, ডিফল্ট: ৮ সংযোগ ক্ষমতা। হয় ৪ অথবা ৮।
neighborhoodSize পূর্ণসংখ্যা, ডিফল্ট: নাল টাইল প্রতিবেশের আকার (টাইল সীমানার ত্রুটি এড়ানোর জন্য)। ডিফল্ট মান হলো আকারের ২ গুণ।
seeds ছবি, ডিফল্ট: নাল প্রদান করা হলে, যেকোনো অশূন্য মানের পিক্সেলকে সীড লোকেশন হিসেবে ব্যবহার করা হয়। যে পিক্সেলগুলো একে অপরকে স্পর্শ করে ('কানেক্টিভিটি' দ্বারা নির্দিষ্ট করা অনুযায়ী), সেগুলোকে একই ক্লাস্টারের অন্তর্গত বলে গণ্য করা হয়।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// 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');

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহারের তথ্যের জন্য পাইথন এনভায়রনমেন্ট পেজটি দেখুন।

import ee
import geemap.core as geemap

কোলাব (পাইথন)

# 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