হিস্টেরেসিস বলতে একটি ফলাফলের ল্যাগিং ইফেক্টকে বোঝায়। থ্রেশোল্ডিং-র ক্ষেত্রে হিস্টেরেসিস নির্দেশ করে নিম্ন থ্রেশোল্ডের উপরে থাকা এলাকা বা উন্নত থ্রেশোল্ডের উপরে থাকা এলাকা। এটি উচ্চ-আত্মবিশ্বাসযুক্ত এলাকা বোঝায়।
হিস্টেরেসিস দিয়ে ইমেজের অবজেক্টের এজের বাইরের নয়েজ উপেক্ষা করা যায়।
scikit-learn দিয়ে হিস্টেরেসিস থ্রেশোল্ডিং
import matplotlib.pyplot as plt
from skimage import data, filters
fig, ax = plt.subplots(nrows=2, ncols=2)
orig_img = data.coins()
edges = filters.sobel(orig_img)
low = 0.1
high = 0.4
lowt = (edges > low).astype(int)
hight = (edges > high).astype(int)
hyst = filters.apply_hysteresis_threshold(edges, low, high)
ax[0, 0].imshow(orig_img, cmap='gray')
ax[0, 0].set_title('Original image')
ax[0, 1].imshow(edges, cmap='magma')
ax[0, 1].set_title('Sobel edges')
ax[1, 0].imshow(lowt, cmap='magma')
ax[1, 0].set_title('Low threshold')
ax[1, 1].imshow(hight + hyst, cmap='magma')
ax[1, 1].set_title('Hysteresis threshold')
for a in ax.ravel():
a.axis('off')
plt.tight_layout()
plt.show()
আউটপুট

ব্যাখ্যা
- প্রয়োজনীয় লাইব্রেরি ইমপোর্ট করা হয়েছে।
- সাবপ্লট ফাংশন দিয়ে প্লট এরিয়া সেট করা হয়েছে।
- scikit-learn-র
coinsডেটা ইনপুট হিসেবে ব্যবহার করা হয়েছে। sobelফিল্টার দিয়ে এজ এমফাসাইজ করা হয়েছে।apply_hysteresis_thresholdফাংশন দিয়ে থ্রেশোল্ডিং করা হয়েছে।imshowদিয়ে ডেটা কনসোলে দেখানো হয়েছে।