Skip to content

Commit

Permalink
v0.2.0更新
Browse files Browse the repository at this point in the history
  • Loading branch information
GarthTB committed Dec 8, 2024
1 parent 75b0660 commit ff5d64e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LightCurve/Core/ImgAna.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal void Run()
{
using Mat image = Cv2.ImRead(files[i].FullName);
using Mat roi = ImgProc.GetROI(image, x, y, w, h);
values[i] = ImgProc.GetValue(roi, channel);
values[i] = ImgProc.MeanValue(roi, channel);
});

var outName = Tools.File.GenOutName(files);
Expand Down
2 changes: 1 addition & 1 deletion LightCurve/Core/ImgProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static Mat GetROI(Mat image, uint? x, uint? y, uint? w, uint? h)
}

/// <summary> 计算一块ROI中指定指标的均值 </summary>
internal static double GetValue(Mat image, int channel)
internal static double MeanValue(Mat image, int channel)
=> image.Channels() switch
{
1 => ValCvt.MeanValue1(image, channel), // 单色图
Expand Down
6 changes: 4 additions & 2 deletions LightCurve/Core/Tools/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ private static void OutputPlot(double[] values, string dir, string name)
plot.YLabel("Value");
plot.ScaleFactor = 2;

if (values.Length > 1) plot.Axes.SetLimits(1, indexes[^1], 0, 1);
else plot.Axes.SetLimits(0, 2, 0, 1);
if (values.Length == 1) plot.Axes.SetLimitsX(0, 2);
else plot.Axes.SetLimitsX(1, indexes[^1]);
if (values.Max() > 0.3) plot.Axes.SetLimitsY(0, 1);
else plot.Axes.SetLimitsY(0, values.Max() * 1.1); // 优化线性图

plot.Axes.AntiAlias(true);
var plotWidth = values.Length switch
Expand Down
6 changes: 3 additions & 3 deletions LightCurve/Core/VidAna.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ internal void Run()
var values = vid.FrameCount > 0
? new List<double>(vid.FrameCount) : [];

Mat frame = new(), roi = new();
Mat frame = new();
while (vid.Read(frame))
{
roi = ImgProc.GetROI(frame, x, y, w, h);
values.Add(ImgProc.GetValue(roi, channel));
Mat roi = ImgProc.GetROI(frame, x, y, w, h);
values.Add(ImgProc.MeanValue(roi, channel));
}

var outName = Tools.File.GenOutName([file]);
Expand Down
2 changes: 1 addition & 1 deletion LightCurve/LightCurve.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<StartupObject>LightCurve.App</StartupObject>
<Title>LightCurve</Title>
<PackageId>LightCurve</PackageId>
<Version>0.1.0</Version>
<Version>0.2.0</Version>
<Authors>GarthTB</Authors>
<Company>GarthTB</Company>
<Product>LightCurve</Product>
Expand Down
2 changes: 1 addition & 1 deletion LightCurve/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void ReOrderFiles(int orderIndex, bool descending)

private void BtRun_Click(object sender, RoutedEventArgs e)
{
MW.Title = "LightCurve 处理中...";
MW.Title = "LightCurve 处理中,请勿关闭...";
if (mode == 1) // 图片
{
Core.ImgAna analyzer = CBFullFrame.IsChecked == true
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

## 注意

- 此程序不使用GPU。在统计大文件时可能卡顿。
- 每一组照片或一个视频文件进行一次统计。照片和视频不能混合处理。
- 选择输出位置时的文件名不是最终的文件名。最终的文件根据原文件来命名。
- 此程序不使用GPU。在统计大文件时可能卡顿。
- 折线图的高度固定为2000像素,宽度在2000至4800之间浮动。

## 快捷键
Expand All @@ -29,6 +29,12 @@

## 版本日志

### [0.1.0] - 20241208
### [v0.2.0](https://github.com/GarthTB/LightCurve/releases/tag/v0.2.0) - 20241208

- 修复:特殊视频文件无法读取的问题
- 优化:微调界面,增加拖放功能
- 优化:折线图外观

### [v0.1.0](https://github.com/GarthTB/LightCurve/releases/tag/v0.1.0) - 20241208

- 发布

0 comments on commit ff5d64e

Please # to comment.