mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-29 11:56:34 +08:00
1、解决因在debug目录下放置多余的dll导致反射时报错的问题
2、解决显示窗口滑动时,坐标及灰度值不实时更新的问题 3、解决模板匹配工具,模板图像不更新的问题 4、将各工具的生成位置改至主程序的debug目录下
This commit is contained in:
@@ -173,8 +173,20 @@ namespace PMAlignTool
|
||||
public bool isAutoConstants { get; set; }
|
||||
public string modelFilePath { get; set; }
|
||||
public RegionType searchRegionType { get; set; }
|
||||
/// <summary>
|
||||
/// 文件存储路径
|
||||
/// </summary>
|
||||
public string trainImgPath, trainShmPath, trainModelPath, dataDirectory;
|
||||
[NonSerialized]
|
||||
public HObject SearchRegion;
|
||||
|
||||
public void InitTool()
|
||||
{
|
||||
trainImgPath = ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}_TrainImage.bmp";
|
||||
trainShmPath = ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm";
|
||||
trainModelPath = ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}_ModelImage.bmp";
|
||||
dataDirectory = ConfigData.ConfigPath + $"\\{bingdingJobName}\\";
|
||||
}
|
||||
public override void Run(SoftwareRunState softwareState)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
@@ -372,9 +384,10 @@ namespace PMAlignTool
|
||||
}
|
||||
isCreateModel = true;
|
||||
// 模板句柄信息
|
||||
Directory.CreateDirectory(ConfigData.ConfigPath + $"\\{bingdingJobName}\\");
|
||||
HOperatorSet.WriteShapeModel(modelID, ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm");
|
||||
|
||||
Directory.CreateDirectory(dataDirectory);
|
||||
HOperatorSet.WriteShapeModel(modelID, trainShmPath);
|
||||
HOperatorSet.WriteImage(inputImage, "bmp", 0, trainImgPath);
|
||||
HOperatorSet.WriteImage(modelPartImage, "bmp", 0, trainModelPath);
|
||||
if (scores != null && scores.Type != HTupleType.EMPTY)
|
||||
{
|
||||
templatePose = new PosXYU { X = rows[0].D, Y = cols[0].D , U = angles[0].D };
|
||||
@@ -397,12 +410,12 @@ namespace PMAlignTool
|
||||
|
||||
public int FindModelTemplate(HObject findModelImage)
|
||||
{
|
||||
if (!File.Exists(ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm"))
|
||||
if (!File.Exists(trainShmPath))
|
||||
{
|
||||
LoggerClass.WriteLog($"{toolName}未创建或加载模板", MsgLevel.Exception);
|
||||
return -1;
|
||||
}
|
||||
HOperatorSet.ReadShapeModel(ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm", out modelID);
|
||||
HOperatorSet.ReadShapeModel(trainShmPath, out modelID);
|
||||
HObject image;
|
||||
if (searchRegionType == RegionType.AllImage)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user