-
Notifications
You must be signed in to change notification settings - Fork 3
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
OPTICS+denoise #16
Labels
Comments
OPTICS로 변환시켜주는 함수 from sklearn.cluster import OPTICS, cluster_optics_dbscan
def get_optics(x):
x[x==1] = 0
coor = np.argwhere(x==2)
optic = OPTICS(min_samples=2, eps=3).fit(coor)
coor = coor[:, 0], coor[:, 1]
x[coor] = optic.labels_+1
return x |
denoising하는 함수 def calculate_area(x):
cluster_num = np.unique(x)
cluster_num = np.delete(cluster_num, 0)
cnt_array = np.array([])
for num in cluster_num:
cnt = len(x[x == num])
cnt_array = np.append(cnt_array, cnt)
temp = cnt_array.copy()
temp.sort()
max_ = temp[-3 if len(temp) >= 3 else -1]
for num in cluster_num:
if cnt_array[num - 1] < max_:
x[x == num] = 0
return x |
|
다른 denoise와 비교할 것 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
주영이가 WM을 OPTICS로 변환시켜주는 함수를 짜주었고 변환된 이미지에서 넓이가 넓은 순서대로 3번째까지만 표현되도록 denoising하였다.
The text was updated successfully, but these errors were encountered: