diff --git a/.gitignore b/.gitignore
index 365d1f6..77f0abe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,3 +53,52 @@
*.pb
*.jpg
*.png
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed2/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed2/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed2/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed2/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed2/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed2/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed2/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed1/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropresized/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropresized/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropresized/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropped/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_resized/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_resized/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_resized/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed1/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed1/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed1/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/detection/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/data/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/data/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/data/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed1/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed1/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed1/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output_changed1/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/extraction/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/extraction/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/detection/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/detection/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output256/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output256/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output256/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/output256/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropped/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/cropped/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_final/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_final/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_final/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/mask_changed2/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/gloss/VShot0016.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/gloss/VShot0011.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/extraction/新しいビットマップ イメージ.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/extraction/VShot0020.bmp
+Tongue extraction_cropresizemethod/Tongue extraction/bin/x64/Debug/gloss/VShot0020.bmp
diff --git a/Readme.txt b/Readme.txt
index cc2b99f..3885419 100644
--- a/Readme.txt
+++ b/Readme.txt
@@ -1,31 +1,35 @@
-DeepTongue v1.7
+DeepTongue_GlossExtraction 1.0
�X�V���e�ɂ��āF
-1. ���o�y�ѕ������ꂽ��̈�̏���info�t�H���_��csv�ŏo�͂ł���悤�ɋ@�\��lj����܂����D
-2. �������̃o�O���C�����C���萫�����サ�܂����D
+1. Gloss���o�@�\�̒lj�
+2. ���t�@�N�^�����O�ƍׂ��ȃo�O�̏C��
-��̈撊�o�v���O�����̑���ɂ��āF
-1. ���o��������摜��"data"�t�H���_�ɓ���Ă��������B
-2. "cropped"�t�H���_: �g���~���O�ɂ���Đ������ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
-3. "cropresized"�t�H���_: �T�C�Y�ύX��ɐ������ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
-4. "detection"�t�H���_: �㌟�o���ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
-5. "extraction"�t�H���_: �㒊�o���ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
-6. "mask"�t�H���_: ��̈�mask�͎����I�ɂ����ɕۑ�����܂��B
-7. "mask_changed1"�t�H���_: SRG�㏈��������̈�mask�͎����I�ɂ����ɕۑ�����܂��B
-8. "mask_changed2"�t�H���_: �ŏI�I�Ȑ�̈�mask�͎����I�ɂ����ɕۑ�����܂��B
-9. "output256"�t�H���_: ����������l����摜�͎����I�ɂ����ɕۑ�����܂��B
-10. "output_resized"�t�H���_: ���T�C�Y������l����摜�͎����I�ɂ����ɕۑ�����܂��B
-11. "output_changed1"�t�H���_: SRG1�㏈��������l����摜�͎����I�ɂ����ɕۑ�����܂��B
-12. "output_changed2"�t�H���_: SRG2�㏈��������l����摜�͎����I�ɂ����ɕۑ�����܂��B
-13. "info"�t�H���_: �㌟�o�œ���ꂽ���W�Ɛ㕪���œ���ꂽ�ʐς�csv�ɏ������݂����ɕۑ�����܂��D
-14. "Log.txt": ����������摜�������L�^����܂��D
+Gloss���o�v���O�����̑���ɂ��āF
+1. VShot�摜��"data"�t�H���_�ɓ���Ă��������B
+2. Start���������������B
+
+"cropped"�t�H���_: �g���~���O�ɂ���Đ������ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
+"cropresized"�t�H���_: �T�C�Y�ύX��ɐ������ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
+"detection"�t�H���_: �㌟�o���ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
+"extraction"�t�H���_: �㒊�o���ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
+"gloss"�t�H���_�F�@Gloss���o���ꂽ�摜�͎����I�ɂ����ɕۑ�����܂��B
+
+"mask"�t�H���_: ��̈�mask�͎����I�ɂ����ɕۑ�����܂��B
+"mask_changed1"�t�H���_: SRG�㏈��������̈�mask�͎����I�ɂ����ɕۑ�����܂��B
+"mask_changed2"�t�H���_: �ŏI�I�Ȑ�̈�mask�͎����I�ɂ����ɕۑ�����܂��B
+"output256"�t�H���_: ����������l����摜�͎����I�ɂ����ɕۑ�����܂��B
+"output_resized"�t�H���_: ���T�C�Y������l����摜�͎����I�ɂ����ɕۑ�����܂��B
+"output_changed1"�t�H���_: SRG1�㏈��������l����摜�͎����I�ɂ����ɕۑ�����܂��B
+"output_changed2"�t�H���_: SRG2�㏈��������l����摜�͎����I�ɂ����ɕۑ�����܂��B
+"info"�t�H���_: �㌟�o�œ���ꂽ���W�Ɛ㕪���œ���ꂽ�ʐς�csv�ɏ������݂����ɕۑ�����܂��D
+"Log.txt": ����������摜�������L�^����܂��D
�s��ɂ��āF
�f�[�^�ʂ����������I�[�o�[�����ꍇ�́C�����I�Ƀv���O������������\��������܂��D
���̏ꍇ��"data"�t�H���_���琶���ς݂̎ʐ^��S�č폜������C�Ă�.exe���N�����Ă��������D
���s���ɂ��āF
-Python 3.6.5�i�s�K�v�j�@OpenCV3.2�i�s�K�v�j.Net Framework4.7.1 (�K�v)
+Python 3.6.5�i�s�K�v�j�@OpenCV3.2�i�s�K�v�j .Net Framework4.7.1 (�K�v)
Tips:
����CPU I7�ȏ�@���������� 16G�ȏ�
\ No newline at end of file
diff --git a/Tongue extraction_cropresizemethod/Tongue extraction.sln b/Tongue extraction_cropresizemethod/Tongue extraction.sln
index 488d474..bacdabd 100644
--- a/Tongue extraction_cropresizemethod/Tongue extraction.sln
+++ b/Tongue extraction_cropresizemethod/Tongue extraction.sln
@@ -3,7 +3,7 @@
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepTongue2.0", "Tongue extraction\DeepTongue2.0.csproj", "{AFD610B1-8D23-423A-AA0F-B09BA769BDD7}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepTongue_GlossExtraction1.0", "Tongue extraction\DeepTongue_GlossExtraction1.0.csproj", "{AFD610B1-8D23-423A-AA0F-B09BA769BDD7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue2.0.csproj b/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue2.0.csproj
deleted file mode 100644
index fa9f92b..0000000
--- a/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue2.0.csproj
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
-
-
-
- Debug
- AnyCPU
- {AFD610B1-8D23-423A-AA0F-B09BA769BDD7}
- WinExe
- Properties
- Tongue_extraction
- DeepTongue2.0
- v4.7.1
- 512
- true
-
-
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- DeepTongue_Icon.ico
-
-
-
- Form
-
-
- Form1.cs
-
-
-
-
-
- Form1.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
-
- SettingsSingleFileGenerator
-
-
-
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4.7.1 %28x86 および x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
-
-
- False
- ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.dll
-
-
- False
- ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.Blob.dll
-
-
- False
- ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.Extensions.dll
-
-
- ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.UserInterface.dll
-
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.dll
-
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.Composition.dll
-
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.Composition.Registration.dll
-
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.DataAnnotations.dll
-
-
-
-
-
-
-
-
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Reflection.Context.dll
-
-
- ..\..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll
-
-
-
-
- False
- ..\..\..\packages\TensorFlowSharp.1.11.0\lib\net471\TensorFlowSharp.dll
-
-
-
-
-
- このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue_GlossExtraction1.0.csproj b/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue_GlossExtraction1.0.csproj
new file mode 100644
index 0000000..616ddce
--- /dev/null
+++ b/Tongue extraction_cropresizemethod/Tongue extraction/DeepTongue_GlossExtraction1.0.csproj
@@ -0,0 +1,187 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+ {AFD610B1-8D23-423A-AA0F-B09BA769BDD7}
+ WinExe
+ Properties
+ Tongue_extraction
+ DeepTongue_GlossExtraction1.0
+ v4.7.1
+ 512
+ true
+
+
+
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ DeepTongue_Icon.ico
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+
+ Form1.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+
+ SettingsSingleFileGenerator
+
+
+
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4.7.1 %28x86 および x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+ False
+ ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.dll
+
+
+ False
+ ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.Blob.dll
+
+
+ False
+ ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.Extensions.dll
+
+
+ ..\..\..\packages\OpenCvSharp3-AnyCPU.3.2.0.20170107\lib\net40\OpenCvSharp.UserInterface.dll
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.dll
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.Composition.dll
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.Composition.Registration.dll
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.ComponentModel.DataAnnotations.dll
+
+
+
+
+
+
+
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Reflection.Context.dll
+
+
+ ..\..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll
+
+
+
+
+ False
+ ..\..\..\packages\TensorFlowSharp.1.11.0\lib\net471\TensorFlowSharp.dll
+
+
+
+
+
+ このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Tongue extraction_cropresizemethod/Tongue extraction/Form1.Designer.cs b/Tongue extraction_cropresizemethod/Tongue extraction/Form1.Designer.cs
index a678399..bca39f5 100644
--- a/Tongue extraction_cropresizemethod/Tongue extraction/Form1.Designer.cs
+++ b/Tongue extraction_cropresizemethod/Tongue extraction/Form1.Designer.cs
@@ -48,7 +48,7 @@
this.pictureBox_output = new System.Windows.Forms.PictureBox();
this.pictureBox_outputSRG = new System.Windows.Forms.PictureBox();
this.pictureBox_maskSRG = new System.Windows.Forms.PictureBox();
- this.pictureBox_contract = new System.Windows.Forms.PictureBox();
+ this.pictureBox_gloss = new System.Windows.Forms.PictureBox();
this.label_processingFileName = new System.Windows.Forms.Label();
this.label_totalProgress = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
@@ -63,7 +63,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox_output)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_outputSRG)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_maskSRG)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox_contract)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox_gloss)).BeginInit();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
@@ -147,7 +147,7 @@
this.tableLayoutPanel1.Controls.Add(this.pictureBox_output, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.pictureBox_outputSRG, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.pictureBox_maskSRG, 1, 2);
- this.tableLayoutPanel1.Controls.Add(this.pictureBox_contract, 3, 2);
+ this.tableLayoutPanel1.Controls.Add(this.pictureBox_gloss, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.label_processingFileName, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.label_totalProgress, 2, 5);
this.tableLayoutPanel1.Controls.Add(this.panel2, 3, 4);
@@ -179,10 +179,10 @@
//
// textBox1
//
- this.textBox1.Location = new System.Drawing.Point(489, -1);
+ this.textBox1.Location = new System.Drawing.Point(486, -1);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(269, 51);
+ this.textBox1.Size = new System.Drawing.Size(269, 60);
this.textBox1.TabIndex = 1;
this.textBox1.Visible = false;
//
@@ -312,15 +312,15 @@
this.pictureBox_maskSRG.TabIndex = 17;
this.pictureBox_maskSRG.TabStop = false;
//
- // pictureBox_contract
+ // pictureBox_gloss
//
- this.pictureBox_contract.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pictureBox_contract.Location = new System.Drawing.Point(767, 242);
- this.pictureBox_contract.Name = "pictureBox_contract";
- this.pictureBox_contract.Size = new System.Drawing.Size(246, 207);
- this.pictureBox_contract.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.pictureBox_contract.TabIndex = 18;
- this.pictureBox_contract.TabStop = false;
+ this.pictureBox_gloss.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pictureBox_gloss.Location = new System.Drawing.Point(767, 242);
+ this.pictureBox_gloss.Name = "pictureBox_gloss";
+ this.pictureBox_gloss.Size = new System.Drawing.Size(246, 207);
+ this.pictureBox_gloss.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ this.pictureBox_gloss.TabIndex = 18;
+ this.pictureBox_gloss.TabStop = false;
//
// label_processingFileName
//
@@ -383,7 +383,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(1, 2, 1, 2);
this.Name = "Form1";
- this.Text = "DeepTongue2.0";
+ this.Text = "DeepTongue_GlossExtraction1.0";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_input)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_detection)).EndInit();
@@ -396,7 +396,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox_output)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_outputSRG)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_maskSRG)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox_contract)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox_gloss)).EndInit();
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
@@ -423,7 +423,7 @@
private System.Windows.Forms.PictureBox pictureBox_output;
private System.Windows.Forms.PictureBox pictureBox_outputSRG;
private System.Windows.Forms.PictureBox pictureBox_maskSRG;
- private System.Windows.Forms.PictureBox pictureBox_contract;
+ private System.Windows.Forms.PictureBox pictureBox_gloss;
private System.Windows.Forms.Label label_processingFileName;
private System.Windows.Forms.Label label_totalProgress;
private System.Windows.Forms.Panel panel2;
diff --git a/Tongue extraction_cropresizemethod/Tongue extraction/Form1.cs b/Tongue extraction_cropresizemethod/Tongue extraction/Form1.cs
index c504285..7056177 100644
--- a/Tongue extraction_cropresizemethod/Tongue extraction/Form1.cs
+++ b/Tongue extraction_cropresizemethod/Tongue extraction/Form1.cs
@@ -32,6 +32,7 @@
Mat mat_outputSRGNoBox = new Mat(1024, 1280, MatType.CV_8UC1, 1);
Mat mat_outputSRG = new Mat(1024, 1280, MatType.CV_8UC1, 1);
Mat mat_maskSRG = new Mat(1024, 1280, MatType.CV_8UC1, 1);
+ Mat mat_gloss = new Mat(1024, 1280, MatType.CV_8UC1, 1);
public static Bitmap bitmap_bitch;
string[] path;
@@ -51,6 +52,7 @@
string modelFile;
int ii = 0;
int count;
+ int areaCount;
Rect roi = new Rect();
int mmp = 0;
@@ -73,7 +75,7 @@
sw.WriteLine(
"image" + "," +
"top left X" + "," + "top left Y" + "," + "bottom right X" + "," + "bottom right Y" + "," +
- "Width" + "," + "Height" + "," + "Area");
+ "Width" + "," + "Height" + "," + "Area" + "," + "Gloss Count");
}
[Conditional("DEBUG")]
@@ -102,8 +104,8 @@
pictureBox_maskSRG.Refresh();
pictureBox_extraction.Image = null;
pictureBox_extraction.Refresh();
- pictureBox_contract.Image = null;
- pictureBox_contract.Refresh();
+ pictureBox_gloss.Image = null;
+ pictureBox_gloss.Refresh();
backgroundWorker1.RunWorkerAsync();
}
@@ -347,7 +349,7 @@
label_totalProgress.Text = "Total Progress: " + count + "/" + path.Length;
});
- mat_input = Cv2.ImRead(basepath + "\\data" + imageFile);
+ mat_input = Cv2.ImRead(basepath + "\\data" + imageFile, ImreadModes.Color);
bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_input);
Invoke((MethodInvoker)delegate
{
@@ -432,8 +434,8 @@
pictureBox_maskSRG.Refresh();
pictureBox_extraction.Image = null;
pictureBox_extraction.Refresh();
- pictureBox_contract.Image = null;
- pictureBox_contract.Refresh();
+ pictureBox_gloss.Image = null;
+ pictureBox_gloss.Refresh();
});
bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_input);
byte_inputSegmentation = Bitmap2Byte(bitmap_bitch);
@@ -529,7 +531,7 @@
label6.BackColor = Color.Red;
});
mat_extraction = mat_input.Clone();
- int areaCount_noDetection = 0;
+ areaCount = 0;
for (int i = 0; i < mat_input.Height; i++)
{
for (int j = 0; j < mat_input.Width; j++)
@@ -548,7 +550,7 @@
pix[1] = (byte)(mat_extraction.At(i, j).Item1);
pix[2] = (byte)(mat_extraction.At(i, j).Item2);
mat_extraction.Set(i, j, pix);
- areaCount_noDetection++;
+ areaCount++;
}
}
}
@@ -558,24 +560,75 @@
{
pictureBox_extraction.Image = bitmap_bitch;
pictureBox_extraction.Refresh();
- label6.BackColor = Color.White;
- label7.BackColor = Color.Red;
});
- bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_input);
+ label6.BackColor = Color.White;
+
+
+
+ label7.BackColor = Color.Red;
+ mat_gloss = mat_input.Clone();
+ double sum = 0.0;
+ double sumsq = 0.0;
+ double avg = 0.0;
+ double stdev = 0.0;
+ for (int i = 0; i < mat_input.Height; i++)
+ {
+ for (int j = 0; j < mat_input.Width; j++)
+ {
+ var g_value = mat_gloss.At(i, j).Item1;
+ if (mat_maskSRG.At(i, j) == 0)
+ {
+ }
+ else
+ {
+ sum += g_value; // G チャンネル の和
+ sumsq += g_value * g_value; // G チャンネル の平方和
+ }
+ }
+ }
+ avg = (double)(sum / areaCount); // G チャンネル の平均
+ stdev = Math.Sqrt(Math.Abs((sumsq / areaCount) - (avg * avg))); // 標準偏差
+ double thresh = avg + (stdev * 2.0);
+ int glossCount = 0;
+ for (int i = 0; i < mat_input.Height; i++)
+ {
+ for (int j = 0; j < mat_input.Width; j++)
+ {
+ if (mat_maskSRG.At(i, j) == 0)
+ {
+ }
+ else
+ {
+ Vec3b pix = mat_gloss.At(i, j);
+ if (pix.Item1 > thresh)
+ {
+ glossCount++;
+ pix[0] = (byte)(255);
+ pix[1] = (byte)(0);
+ pix[2] = (byte)(0);
+ mat_gloss.Set(i, j, pix);
+ }
+ }
+
+ }
+ }
+ mat_gloss.SaveImage(basepath + "\\gloss" + imageFile);
+ bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_gloss);
Invoke((MethodInvoker)delegate
{
- pictureBox_contract.Image = bitmap_bitch;
- pictureBox_contract.Refresh();
- label7.BackColor = Color.White;
- label8.BackColor = Color.Red;
+ pictureBox_gloss.Image = bitmap_bitch;
+ pictureBox_gloss.Refresh();
});
+ label7.BackColor = Color.White;
+
+ label8.BackColor = Color.Red;
//csvにboundingbox情報を保存
sw.WriteLine(
imageFile.Substring(1) + ","
+ "None" + "," + "None" + ","
+ "None" + "," + "None" + ","
- + "None" + "," + "None" + "," + areaCount_noDetection.ToString()
+ + "None" + "," + "None" + "," + areaCount.ToString()
);
continue;
@@ -591,6 +644,8 @@
pictureBox_detection.Refresh();
});
label1.BackColor = Color.White;
+
+
label2.BackColor = Color.Red;
// 検出された場合の処理の続き
for (int i = P1.Y; i < P2.Y; i++)
@@ -615,8 +670,9 @@
pictureBox_cropResized.Image = bitmap_bitch;
pictureBox_cropResized.Refresh();
});
-
label2.BackColor = Color.White;
+
+
label3.BackColor = Color.Red;
byte_inputSegmentation = Bitmap2Byte(bitmap_bitch);
Thread.Sleep(1000);
@@ -667,8 +723,9 @@
pictureBox_output.Image = bitmap_bitch;
pictureBox_output.Refresh();
});
-
label3.BackColor = Color.White;
+
+
label4.BackColor = Color.Red;
mat_output.SaveImage(basepath + "\\output256" + imageFile);
try
@@ -688,8 +745,9 @@
pictureBox_outputSRG.Image = bitmap_bitch;
pictureBox_outputSRG.Refresh();
});
-
label4.BackColor = Color.White;
+
+
label5.BackColor = Color.Red;
Cv2.Resize(mat_outputSRG, mat_outputChanged, mat_roisize.Size());
mat_outputChanged.SaveImage(basepath + "\\output_resized" + imageFile);
@@ -721,27 +779,19 @@
mat_maskSRG = new Mat(basepath + "\\mask_changed2" + imageFile, ImreadModes.GrayScale);
Cv2.Threshold(mat_maskSRG, mat_maskSRG, 128, 255, ThresholdTypes.Binary);
+ mat_maskSRG.SaveImage(basepath + "\\mask_final" + imageFile);
bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_maskSRG);
- if (pictureBox_maskSRG.InvokeRequired)
- {
- pictureBox_maskSRG.Invoke((MethodInvoker)delegate
- {
- pictureBox_maskSRG.Image = bitmap_bitch;
- pictureBox_maskSRG.Refresh();
- });
- }
- else
+ Invoke((MethodInvoker)delegate
{
pictureBox_maskSRG.Image = bitmap_bitch;
pictureBox_maskSRG.Refresh();
- }
-
-
+ });
label5.BackColor = Color.White;
- label6.BackColor = Color.Red;
+
+ label6.BackColor = Color.Red;
mat_extraction = mat_input.Clone();
- int areaCount = 0;
+ areaCount = 0;
for (int i = 0; i < mat_input.Height; i++)
{
for (int j = 0; j < mat_input.Width; j++)
@@ -773,15 +823,80 @@
});
label6.BackColor = Color.White;
+
+ /// Gloss抽出処理 extraction結果は使用しない(255,255,255の扱いが煩雑なため)
label7.BackColor = Color.Red;
- bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_input);
+
+ mat_gloss = mat_input.Clone();
+
+ double sum = 0.0;
+ double sumsq = 0.0;
+ double avg = 0.0;
+ double stdev = 0.0;
+ for (int i = 0; i < mat_input.Height; i++)
+ {
+ for (int j = 0; j < mat_input.Width; j++)
+ {
+ var g_value = mat_gloss.At(i, j).Item1;
+ if (mat_maskSRG.At(i, j) == 0)
+ {
+ }
+ else
+ {
+ sum += g_value; // G チャンネル の和
+ sumsq += g_value * g_value; // G チャンネル の平方和
+ }
+ }
+ }
+ avg = (double)(sum / areaCount); // G チャンネル の平均
+ stdev = Math.Sqrt(Math.Abs((sumsq / areaCount) - (avg * avg))); // 標準偏差
+ double thresh = avg + (stdev * 2.0);
+ int glossCount = 0;
+ for (int i = 0; i < mat_input.Height; i++)
+ {
+ for (int j = 0; j < mat_input.Width; j++)
+ {
+ if (mat_maskSRG.At(i, j) == 0)
+ {
+ }
+ else
+ {
+ Vec3b pix = mat_gloss.At(i, j);
+ if (pix.Item1 > thresh)
+ {
+ glossCount++;
+ pix[0] = (byte)(255);
+ pix[1] = (byte)(0);
+ pix[2] = (byte)(0);
+ mat_gloss.Set(i, j, pix);
+ }
+ }
+
+ }
+ }
+
+ /*
+ textBox1.Invoke((MethodInvoker)delegate
+ {
+ textBox1.Text = sum.ToString() + ", ";
+ textBox1.Text += sumsq.ToString() + ",";
+ textBox1.Text += avg.ToString() + Environment.NewLine;
+ textBox1.Text += stdev.ToString() + Environment.NewLine;
+ textBox1.Text += glossCount.ToString();
+ });
+ */
+
+ mat_gloss.SaveImage(basepath + "\\gloss" + imageFile);
+ bitmap_bitch = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat_gloss);
Invoke((MethodInvoker)delegate
{
- pictureBox_contract.Image = bitmap_bitch;
- pictureBox_contract.Refresh();
+ pictureBox_gloss.Image = bitmap_bitch;
+ pictureBox_gloss.Refresh();
});
-
label7.BackColor = Color.White;
+ /// Gloss抽出処理
+
+
label8.BackColor = Color.Red;
time = DateTime.Now.ToLocalTime().ToString();
File.AppendAllText("Log.txt ", time + " " + imageFile + " Done!\n");
@@ -793,7 +908,7 @@
+ P1.X.ToString() + "," + P1.Y.ToString() + ","
+ P2.X.ToString() + "," + P2.Y.ToString() + ","
+ Math.Abs(P1.X - P2.X).ToString() + "," + Math.Abs(P1.Y - P2.Y).ToString() + ","
- + areaCount.ToString()
+ + areaCount.ToString() + "," + mat_gloss.ToString()
);
}