Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liupeng89 committed May 2, 2018
1 parent 2e7f5d4 commit eef00e5
Show file tree
Hide file tree
Showing 27 changed files with 15,527 additions and 264 deletions.
Binary file added 0001ding.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0001ding_stroke.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0107亻.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0125仕.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0301健.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0427凹.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0554十.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1133壬.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions background_remove.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import numpy as np
import cv2

path = "seg_test.jpg"

img = cv2.imread(path)

fgbg = cv2.createBackgroundSubtractorMOG2()

fgmask = fgbg.apply(img)

cv2.imshow("mask", fgmask)

cv2.waitKey(0)
cv2.destroyAllWindows()
659 changes: 560 additions & 99 deletions calligraphycomparisonGUI.py

Large diffs are not rendered by default.

76 changes: 67 additions & 9 deletions calligraphycomparisonmainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setupUi(self, MainWindow):
self.cover_gview.setObjectName("cover_gview")
self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3)
self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.whole_cr_tab)
self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(830, 90, 160, 111))
self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(830, 90, 160, 186))
self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
Expand All @@ -53,9 +53,12 @@ def setupUi(self, MainWindow):
self.mizi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
self.mizi_rbtn.setObjectName("mizi_rbtn")
self.verticalLayout_2.addWidget(self.mizi_rbtn)
self.jiugong_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
self.jiugong_rbtn.setObjectName("jiugong_rbtn")
self.verticalLayout_2.addWidget(self.jiugong_rbtn)
self.jingzi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
self.jingzi_rbtn.setObjectName("jingzi_rbtn")
self.verticalLayout_2.addWidget(self.jingzi_rbtn)
self.net_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
self.net_rbtn.setObjectName("net_rbtn")
self.verticalLayout_2.addWidget(self.net_rbtn)
self.cr_calculate_btn = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
self.cr_calculate_btn.setObjectName("cr_calculate_btn")
self.verticalLayout_2.addWidget(self.cr_calculate_btn)
Expand Down Expand Up @@ -96,11 +99,20 @@ def setupUi(self, MainWindow):
self.cog_comparison_gview.setObjectName("cog_comparison_gview")
self.scrollArea_6.setWidget(self.scrollAreaWidgetContents_6)
self.verticalLayoutWidget_3 = QtWidgets.QWidget(self.whole_goc_tab)
self.verticalLayoutWidget_3.setGeometry(QtCore.QRect(470, 570, 146, 41))
self.verticalLayoutWidget_3.setGeometry(QtCore.QRect(460, 520, 146, 96))
self.verticalLayoutWidget_3.setObjectName("verticalLayoutWidget_3")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_3)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.whole_cog_mizi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_3)
self.whole_cog_mizi_rbtn.setObjectName("whole_cog_mizi_rbtn")
self.verticalLayout_3.addWidget(self.whole_cog_mizi_rbtn)
self.whole_cog_jingzi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_3)
self.whole_cog_jingzi_rbtn.setObjectName("whole_cog_jingzi_rbtn")
self.verticalLayout_3.addWidget(self.whole_cog_jingzi_rbtn)
self.whole_cog_net_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_3)
self.whole_cog_net_rbtn.setObjectName("whole_cog_net_rbtn")
self.verticalLayout_3.addWidget(self.whole_cog_net_rbtn)
self.cog_btn = QtWidgets.QPushButton(self.verticalLayoutWidget_3)
self.cog_btn.setObjectName("cog_btn")
self.verticalLayout_3.addWidget(self.cog_btn)
Expand Down Expand Up @@ -154,11 +166,20 @@ def setupUi(self, MainWindow):
self.target_ch_gview.setObjectName("target_ch_gview")
self.scrollArea_8.setWidget(self.scrollAreaWidgetContents_8)
self.verticalLayoutWidget_4 = QtWidgets.QWidget(self.whole_ch_tab)
self.verticalLayoutWidget_4.setGeometry(QtCore.QRect(30, 569, 160, 32))
self.verticalLayoutWidget_4.setGeometry(QtCore.QRect(30, 530, 160, 96))
self.verticalLayoutWidget_4.setObjectName("verticalLayoutWidget_4")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_4)
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.whole_ch_mizi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_4)
self.whole_ch_mizi_rbtn.setObjectName("whole_ch_mizi_rbtn")
self.verticalLayout_4.addWidget(self.whole_ch_mizi_rbtn)
self.whole_ch_jingzi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_4)
self.whole_ch_jingzi_rbtn.setObjectName("whole_ch_jingzi_rbtn")
self.verticalLayout_4.addWidget(self.whole_ch_jingzi_rbtn)
self.whole_ch_net_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_4)
self.whole_ch_net_rbtn.setObjectName("whole_ch_net_rbtn")
self.verticalLayout_4.addWidget(self.whole_ch_net_rbtn)
self.convexhull_btn = QtWidgets.QPushButton(self.verticalLayoutWidget_4)
self.convexhull_btn.setObjectName("convexhull_btn")
self.verticalLayout_4.addWidget(self.convexhull_btn)
Expand Down Expand Up @@ -338,11 +359,20 @@ def setupUi(self, MainWindow):
self.radical_comparison_tab = QtWidgets.QWidget()
self.radical_comparison_tab.setObjectName("radical_comparison_tab")
self.verticalLayoutWidget_6 = QtWidgets.QWidget(self.radical_comparison_tab)
self.verticalLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 160, 51))
self.verticalLayoutWidget_6.setGeometry(QtCore.QRect(10, 50, 160, 96))
self.verticalLayoutWidget_6.setObjectName("verticalLayoutWidget_6")
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_6)
self.verticalLayout_6.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.radicals_jingzi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_6)
self.radicals_jingzi_rbtn.setObjectName("radicals_jingzi_rbtn")
self.verticalLayout_6.addWidget(self.radicals_jingzi_rbtn)
self.radicals_mizi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_6)
self.radicals_mizi_rbtn.setObjectName("radicals_mizi_rbtn")
self.verticalLayout_6.addWidget(self.radicals_mizi_rbtn)
self.radicals_net_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_6)
self.radicals_net_rbtn.setObjectName("radicals_net_rbtn")
self.verticalLayout_6.addWidget(self.radicals_net_rbtn)
self.stroke_layout_btn = QtWidgets.QPushButton(self.verticalLayoutWidget_6)
self.stroke_layout_btn.setObjectName("stroke_layout_btn")
self.verticalLayout_6.addWidget(self.stroke_layout_btn)
Expand Down Expand Up @@ -426,6 +456,21 @@ def setupUi(self, MainWindow):
self.strokes_cr_btn = QtWidgets.QPushButton(self.formLayoutWidget_8)
self.strokes_cr_btn.setObjectName("strokes_cr_btn")
self.formLayout_8.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.strokes_cr_btn)
self.verticalLayoutWidget_8 = QtWidgets.QWidget(self.stroke_cr_tab)
self.verticalLayoutWidget_8.setGeometry(QtCore.QRect(640, 190, 160, 80))
self.verticalLayoutWidget_8.setObjectName("verticalLayoutWidget_8")
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_8)
self.verticalLayout_8.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.stroke_jingzi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_8)
self.stroke_jingzi_rbtn.setObjectName("stroke_jingzi_rbtn")
self.verticalLayout_8.addWidget(self.stroke_jingzi_rbtn)
self.stroke_mizi_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_8)
self.stroke_mizi_rbtn.setObjectName("stroke_mizi_rbtn")
self.verticalLayout_8.addWidget(self.stroke_mizi_rbtn)
self.stroke_net_rbtn = QtWidgets.QRadioButton(self.verticalLayoutWidget_8)
self.stroke_net_rbtn.setObjectName("stroke_net_rbtn")
self.verticalLayout_8.addWidget(self.stroke_net_rbtn)
self.stroke_main_tabwidget.addTab(self.stroke_cr_tab, "")
self.stroke_segment_tab = QtWidgets.QWidget()
self.stroke_segment_tab.setObjectName("stroke_segment_tab")
Expand Down Expand Up @@ -542,16 +587,23 @@ def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_3.setText(_translate("MainWindow", "Max CR:"))
self.maxcr_label.setText(_translate("MainWindow", "0.0"))
self.mizi_rbtn.setText(_translate("MainWindow", "Mizi"))
self.jiugong_rbtn.setText(_translate("MainWindow", "JiuGong"))
self.mizi_rbtn.setText(_translate("MainWindow", "MiZi-Grid"))
self.jingzi_rbtn.setText(_translate("MainWindow", "JingZi-Grid"))
self.net_rbtn.setText(_translate("MainWindow", "20_Net-Grid"))
self.cr_calculate_btn.setText(_translate("MainWindow", "Calculate"))
self.whole_main_tabwidget.setTabText(self.whole_main_tabwidget.indexOf(self.whole_cr_tab), _translate("MainWindow", "Coverage Rate"))
self.whole_cog_mizi_rbtn.setText(_translate("MainWindow", "MiZi-Grid"))
self.whole_cog_jingzi_rbtn.setText(_translate("MainWindow", "JingZi-Grid"))
self.whole_cog_net_rbtn.setText(_translate("MainWindow", "20_Net-Grid"))
self.cog_btn.setText(_translate("MainWindow", "Center of Gravity"))
self.label_4.setText(_translate("MainWindow", "COG:"))
self.template_cog_label.setText(_translate("MainWindow", "(0, 0)"))
self.label_5.setText(_translate("MainWindow", "COG:"))
self.target_cog_label.setText(_translate("MainWindow", "(0, 0)"))
self.whole_main_tabwidget.setTabText(self.whole_main_tabwidget.indexOf(self.whole_goc_tab), _translate("MainWindow", "Gravity of Center"))
self.whole_ch_mizi_rbtn.setText(_translate("MainWindow", "MiZi-Grid"))
self.whole_ch_jingzi_rbtn.setText(_translate("MainWindow", "JingZi-Grid"))
self.whole_ch_net_rbtn.setText(_translate("MainWindow", "20_Net-Grid"))
self.convexhull_btn.setText(_translate("MainWindow", "Convex hull"))
self.label_6.setText(_translate("MainWindow", "Convex hull \n"
" area ratio:"))
Expand Down Expand Up @@ -592,6 +644,9 @@ def retranslateUi(self, MainWindow):
self.variance_y_label.setText(_translate("MainWindow", "0.0"))
self.whole_main_tabwidget.setTabText(self.whole_main_tabwidget.indexOf(self.whole_histogram_tab), _translate("MainWindow", "Histogram"))
self.comparison_main_tab.setTabText(self.comparison_main_tab.indexOf(self.whole_comparison_tab), _translate("MainWindow", "Whole Comparison"))
self.radicals_jingzi_rbtn.setText(_translate("MainWindow", "JingZi-Grid"))
self.radicals_mizi_rbtn.setText(_translate("MainWindow", "MiZi-Grid"))
self.radicals_net_rbtn.setText(_translate("MainWindow", "20_Net-Grid"))
self.stroke_layout_btn.setText(_translate("MainWindow", "Strokes Layout"))
self.label_27.setText(_translate("MainWindow", "Template image"))
self.label_33.setText(_translate("MainWindow", "Target image"))
Expand All @@ -600,6 +655,9 @@ def retranslateUi(self, MainWindow):
self.label_29.setText(_translate("MainWindow", "Max CR:"))
self.strokes_cr_label.setText(_translate("MainWindow", "0.0"))
self.strokes_cr_btn.setText(_translate("MainWindow", "Calculate"))
self.stroke_jingzi_rbtn.setText(_translate("MainWindow", "JingZi-Grid"))
self.stroke_mizi_rbtn.setText(_translate("MainWindow", "MiZi-Grid"))
self.stroke_net_rbtn.setText(_translate("MainWindow", "20_Net-Grid"))
self.stroke_main_tabwidget.setTabText(self.stroke_main_tabwidget.indexOf(self.stroke_cr_tab), _translate("MainWindow", "Coverage Rate"))
self.label_30.setText(_translate("MainWindow", "Template"))
self.label_31.setText(_translate("MainWindow", "Target"))
Expand Down
125 changes: 114 additions & 11 deletions calligraphycomparisonmainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<x>830</x>
<y>90</y>
<width>160</width>
<height>111</height>
<height>186</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand All @@ -110,14 +110,21 @@
<item>
<widget class="QRadioButton" name="mizi_rbtn">
<property name="text">
<string>Mizi</string>
<string>MiZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="jiugong_rbtn">
<widget class="QRadioButton" name="jingzi_rbtn">
<property name="text">
<string>JiuGong</string>
<string>JingZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="net_rbtn">
<property name="text">
<string>20_Net-Grid</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -237,13 +244,34 @@
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>470</x>
<y>570</y>
<x>460</x>
<y>520</y>
<width>146</width>
<height>41</height>
<height>96</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QRadioButton" name="whole_cog_mizi_rbtn">
<property name="text">
<string>MiZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="whole_cog_jingzi_rbtn">
<property name="text">
<string>JingZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="whole_cog_net_rbtn">
<property name="text">
<string>20_Net-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cog_btn">
<property name="text">
Expand Down Expand Up @@ -380,12 +408,33 @@
<property name="geometry">
<rect>
<x>30</x>
<y>569</y>
<y>530</y>
<width>160</width>
<height>32</height>
<height>96</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QRadioButton" name="whole_ch_mizi_rbtn">
<property name="text">
<string>MiZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="whole_ch_jingzi_rbtn">
<property name="text">
<string>JingZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="whole_ch_net_rbtn">
<property name="text">
<string>20_Net-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="convexhull_btn">
<property name="text">
Expand Down Expand Up @@ -818,12 +867,33 @@
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<y>50</y>
<width>160</width>
<height>51</height>
<height>96</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QRadioButton" name="radicals_jingzi_rbtn">
<property name="text">
<string>JingZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radicals_mizi_rbtn">
<property name="text">
<string>MiZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radicals_net_rbtn">
<property name="text">
<string>20_Net-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stroke_layout_btn">
<property name="text">
Expand Down Expand Up @@ -1044,6 +1114,39 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="verticalLayoutWidget_8">
<property name="geometry">
<rect>
<x>640</x>
<y>190</y>
<width>160</width>
<height>80</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QRadioButton" name="stroke_jingzi_rbtn">
<property name="text">
<string>JingZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="stroke_mizi_rbtn">
<property name="text">
<string>MiZi-Grid</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="stroke_net_rbtn">
<property name="text">
<string>20_Net-Grid</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="stroke_segment_tab">
<attribute name="title">
Expand Down
Loading

0 comments on commit eef00e5

Please sign in to comment.