Skip to content

Commit 8cc3dc1

Browse files
1.24 版本上传 (#11)
* 1.24 update * 新版本发布 紧急修复 * Update pom.xml
1 parent 666cf07 commit 8cc3dc1

File tree

7 files changed

+198
-169
lines changed

7 files changed

+198
-169
lines changed

src_code/README-Chinese.md

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,7 @@
88

99
### 更新日志
1010

11-
* 框架版本:1.22 - 1.23
12-
* 针对图像处理库的 parse 函数,支持针对 File 文件对象进行解析,不需要再通过旧版本中的转换来实现了
11+
* 框架版本:1.23 - 1.24
12+
* 紧急修复:针对 AS图像处理库 中的show 函数生成的窗口关闭之后会退出程序的问题进行了优化和处理,使得窗口点击关闭之后不会退出程序
1313

14-
```java
15-
package zhao.algorithmMagic;
16-
17-
18-
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
19-
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
20-
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
21-
import zhao.algorithmMagic.utils.ASIO;
22-
23-
import java.awt.*;
24-
import java.io.File;
25-
import java.io.IOException;
26-
27-
public class MAIN1 {
28-
public static void main(String[] args) {
29-
// 准备一个需要被读取的文件对象
30-
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
31-
32-
// TODO 旧版本中的操作
33-
try {
34-
// 首先通过 file 对象获取到图像数组
35-
final Color[][] colors = ASIO.parseImageGetColorArray(file);
36-
// 通过 AS 的基本图像处理库解析 File 对象
37-
ColorMatrix.parse(colors).show("old_colorMat", 200, 100);
38-
// 通过 AS 的哈希图像处理库解析 File 对象
39-
HashColorMatrix.parse(colors).show("old_HashMat", 200, 100);
40-
// 通过 AS 的图像矩阵处理库解析 File 对象
41-
ImageMatrix.parse(colors).show("old_imageMat", 200, 100);
42-
} catch (IOException e) {
43-
e.printStackTrace();
44-
return;
45-
}
46-
47-
// TODO 新版本中的操作 可以直接将 File 对象传递进来
48-
// 通过 AS 的基本图像处理库解析 File 对象
49-
ColorMatrix.parse(file).show("colorMat", 200, 100);
50-
// 通过 AS 的哈希图像处理库解析 File 对象
51-
HashColorMatrix.parse(file).show("HashMat", 200, 100);
52-
// 通过 AS 的图像矩阵处理库解析 File 对象
53-
ImageMatrix.parse(file).show("imageMat", 200, 100);
54-
}
55-
}
56-
```
57-
58-
* 图像处理库中的灰度图像解析函数支持读取尺寸的设置。
59-
60-
```java
61-
package zhao.algorithmMagic;
62-
63-
64-
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
65-
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
66-
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
67-
import zhao.algorithmMagic.utils.ASIO;
68-
69-
import java.awt.*;
70-
import java.io.File;
71-
import java.io.IOException;
72-
73-
public class MAIN1 {
74-
public static void main(String[] args) {
75-
// 准备一个需要被读取的文件对象
76-
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
77-
// 通过 AS 的基本图像处理库解析 File 对象 TODO 在这里以及后面的所有灰度解析函数中都设置了尺寸
78-
ColorMatrix.parseGrayscale(file, 200, 100).show("colorMat");
79-
// 通过 AS 的哈希图像处理库解析 File 对象
80-
HashColorMatrix.parseGrayscale(file, 200, 100).show("HashMat");
81-
// 通过 AS 的图像矩阵处理库解析 File 对象
82-
ImageMatrix.parseGrayscale(file, 200, 100).show("imageMat");
83-
}
84-
}
85-
```
86-
87-
### Version update date : 2023-08-27
14+
### Version update date : 2023-08-28

src_code/README.md

Lines changed: 4 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,8 @@
88

99
### Update log:
1010

11-
* Framework version: 1.22 - 1.23
12-
* The parse function for image processing libraries now supports parsing the File file object. There is no longer any
13-
need to perform conversion through old versions of this feature.
11+
* Framework version: 1.23 - 1.24
12+
* Emergency fix: Optimized and addressed the issue of the window generated by the show function in the AS image
13+
processing library exiting the program after closing, so that clicking to close the window will not exit the program.
1414

15-
```java
16-
package zhao.algorithmMagic;
17-
18-
19-
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
20-
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
21-
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
22-
import zhao.algorithmMagic.utils.ASIO;
23-
24-
import java.awt.*;
25-
import java.io.File;
26-
import java.io.IOException;
27-
28-
public class MAIN1 {
29-
public static void main(String[] args) {
30-
// 准备一个需要被读取的文件对象
31-
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
32-
33-
// TODO 旧版本中的操作
34-
try {
35-
// 首先通过 file 对象获取到图像数组
36-
final Color[][] colors = ASIO.parseImageGetColorArray(file);
37-
// 通过 AS 的基本图像处理库解析 File 对象
38-
ColorMatrix.parse(colors).show("old_colorMat", 200, 100);
39-
// 通过 AS 的哈希图像处理库解析 File 对象
40-
HashColorMatrix.parse(colors).show("old_HashMat", 200, 100);
41-
// 通过 AS 的图像矩阵处理库解析 File 对象
42-
ImageMatrix.parse(colors).show("old_imageMat", 200, 100);
43-
} catch (IOException e) {
44-
e.printStackTrace();
45-
return;
46-
}
47-
48-
// TODO 新版本中的操作 可以直接将 File 对象传递进来
49-
// 通过 AS 的基本图像处理库解析 File 对象
50-
ColorMatrix.parse(file).show("colorMat", 200, 100);
51-
// 通过 AS 的哈希图像处理库解析 File 对象
52-
HashColorMatrix.parse(file).show("HashMat", 200, 100);
53-
// 通过 AS 的图像矩阵处理库解析 File 对象
54-
ImageMatrix.parse(file).show("imageMat", 200, 100);
55-
}
56-
}
57-
```
58-
59-
The grayscale image analysis function in the image processing library supports the setting of reading dimensions.
60-
61-
```java
62-
package zhao.algorithmMagic;
63-
64-
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
65-
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
66-
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
67-
import zhao.algorithmMagic.utils.ASIO;
68-
69-
import java.awt.*;
70-
import java.io.File;
71-
import java.io.IOException;
72-
73-
public class MAIN1 {
74-
public static void main(String[] args) {
75-
// Prepare a file object that needs to be read
76-
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
77-
// Parse the File object through the basic image processing library of AS. TODO sets the size here and in all grayscale parsing functions later.
78-
ColorMatrix.parseGrayscale(file, 200, 100).show("colorMat");
79-
// parse the File object through the AS's hash image processing library
80-
HashColorMatrix.parseGrayscale(file, 200, 100).show("HashMat");
81-
// parse the File object through the image matrix processing library of the AS
82-
ImageMatrix.parseGrayscale(file, 200, 100).show("imageMat");
83-
}
84-
}
85-
```
86-
87-
### Version update date : 2023-08-27
15+
### Version update date : 2023-08-28

src_code/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.github.BeardedManZhao</groupId>
77
<artifactId>algorithmStar</artifactId>
8-
<version>1.23</version>
8+
<version>1.24</version>
99
<packaging>jar</packaging>
1010
<name>algorithmStar</name>
1111
<description>algorithmStar-java</description>

src_code/src/main/java/zhao/algorithmMagic/operands/matrix/ColorMatrix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ public final void show(String title, int width, int height) {
23892389
int rowCount = this.getRowCount();
23902390
boolean needCorrection = colCount != width || rowCount != height;
23912391
JFrame jFrame = new JFrame();
2392-
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
2392+
jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
23932393
jFrame.setSize(width, height);
23942394
jFrame.setVisible(true);
23952395
jFrame.setTitle(title);

src_code/src/main/java/zhao/algorithmMagic/operands/vector/SparkVector.scala

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ final class SparkVector(sparkContext: SparkContext, vector: org.apache.spark.mll
137137
*/
138138
override def shuffle(seed: Long): SparkVector = SparkVector.parse(sparkContext, ASMath.shuffle(this.copyToNewArray(), seed, false))
139139

140+
/**
141+
*
142+
* @return 将本对象中存储的向量序列数组拷贝到一个新数组并将新数组返回,这里返回的是一个新数组,支持修改等操作。
143+
*
144+
* Copy the vector sequence array stored in this object to a new array and return the new array. Here, a new array is returned, which supports modification and other operations.
145+
*/
146+
override def copyToNewArray(): Array[Double] = vector.toArray
147+
140148
/**
141149
* 将两个操作数进行求和的方法,具体用法请参阅API说明。
142150
* <p>
@@ -157,6 +165,13 @@ final class SparkVector(sparkContext: SparkContext, vector: org.apache.spark.mll
157165
SparkVector.parse(sparkContext, doubles)
158166
}
159167

168+
/**
169+
* @return 向量中包含的维度数量
170+
* <p>
171+
* the number of dimensions contained in the vector
172+
*/
173+
override def getNumberOfDimensions: Int = size
174+
160175
/**
161176
* 在两个操作数之间做差的方法,具体用法请参阅API说明。
162177
* <p>
@@ -176,21 +191,6 @@ final class SparkVector(sparkContext: SparkContext, vector: org.apache.spark.mll
176191
SparkVector.parse(sparkContext, doubles)
177192
}
178193

179-
/**
180-
* @return 向量中包含的维度数量
181-
* <p>
182-
* the number of dimensions contained in the vector
183-
*/
184-
override def getNumberOfDimensions: Int = size
185-
186-
/**
187-
*
188-
* @return 将本对象中存储的向量序列数组拷贝到一个新数组并将新数组返回,这里返回的是一个新数组,支持修改等操作。
189-
*
190-
* Copy the vector sequence array stored in this object to a new array and return the new array. Here, a new array is returned, which supports modification and other operations.
191-
*/
192-
override def copyToNewArray(): Array[Double] = vector.toArray
193-
194194
/**
195195
* 将当前对象转换成为其子类实现,其具有强大的类型拓展效果,能够实现父类到子类的转换操作。
196196
*
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# ![image](https://user-images.githubusercontent.com/113756063/194830221-abe24fcc-484b-4769-b3b7-ec6d8138f436.png) 算法之星-机器大脑
2+
3+
- Switch to [English Document](https://github.com/BeardedManZhao/algorithmStar/blob/Zhao-develop/src_code/README.md)
4+
- knowledge base
5+
<a href="https://github.com/BeardedManZhao/algorithmStar/blob/main/KnowledgeDocument/knowledge%20base-Chinese.md">
6+
<img src = "https://user-images.githubusercontent.com/113756063/194838003-7ad14dac-b38c-4b57-a942-ba58f00baaf7.png"/>
7+
</a>
8+
9+
### 更新日志
10+
11+
* 框架版本:1.22 - 1.23
12+
* 针对图像处理库的 parse 函数,支持针对 File 文件对象进行解析,不需要再通过旧版本中的转换来实现了。
13+
14+
```java
15+
package zhao.algorithmMagic;
16+
17+
18+
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
19+
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
20+
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
21+
import zhao.algorithmMagic.utils.ASIO;
22+
23+
import java.awt.*;
24+
import java.io.File;
25+
import java.io.IOException;
26+
27+
public class MAIN1 {
28+
public static void main(String[] args) {
29+
// 准备一个需要被读取的文件对象
30+
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
31+
32+
// TODO 旧版本中的操作
33+
try {
34+
// 首先通过 file 对象获取到图像数组
35+
final Color[][] colors = ASIO.parseImageGetColorArray(file);
36+
// 通过 AS 的基本图像处理库解析 File 对象
37+
ColorMatrix.parse(colors).show("old_colorMat", 200, 100);
38+
// 通过 AS 的哈希图像处理库解析 File 对象
39+
HashColorMatrix.parse(colors).show("old_HashMat", 200, 100);
40+
// 通过 AS 的图像矩阵处理库解析 File 对象
41+
ImageMatrix.parse(colors).show("old_imageMat", 200, 100);
42+
} catch (IOException e) {
43+
e.printStackTrace();
44+
return;
45+
}
46+
47+
// TODO 新版本中的操作 可以直接将 File 对象传递进来
48+
// 通过 AS 的基本图像处理库解析 File 对象
49+
ColorMatrix.parse(file).show("colorMat", 200, 100);
50+
// 通过 AS 的哈希图像处理库解析 File 对象
51+
HashColorMatrix.parse(file).show("HashMat", 200, 100);
52+
// 通过 AS 的图像矩阵处理库解析 File 对象
53+
ImageMatrix.parse(file).show("imageMat", 200, 100);
54+
}
55+
}
56+
```
57+
58+
* 图像处理库中的灰度图像解析函数支持读取尺寸的设置。
59+
60+
```java
61+
package zhao.algorithmMagic;
62+
63+
64+
import zhao.algorithmMagic.operands.matrix.ColorMatrix;
65+
import zhao.algorithmMagic.operands.matrix.HashColorMatrix;
66+
import zhao.algorithmMagic.operands.matrix.ImageMatrix;
67+
import zhao.algorithmMagic.utils.ASIO;
68+
69+
import java.awt.*;
70+
import java.io.File;
71+
import java.io.IOException;
72+
73+
public class MAIN1 {
74+
public static void main(String[] args) {
75+
// 准备一个需要被读取的文件对象
76+
final File file = new File("C:\\Users\\zhao\\Desktop\\wifi.bmp");
77+
// 通过 AS 的基本图像处理库解析 File 对象 TODO 在这里以及后面的所有灰度解析函数中都设置了尺寸
78+
ColorMatrix.parseGrayscale(file, 200, 100).show("colorMat");
79+
// 通过 AS 的哈希图像处理库解析 File 对象
80+
HashColorMatrix.parseGrayscale(file, 200, 100).show("HashMat");
81+
// 通过 AS 的图像矩阵处理库解析 File 对象
82+
ImageMatrix.parseGrayscale(file, 200, 100).show("imageMat");
83+
}
84+
}
85+
```
86+
87+
### Version update date : 2023-08-27

0 commit comments

Comments
 (0)