RatelSoft.VisionTypes
2.260110.6
dotnet add package RatelSoft.VisionTypes --version 2.260110.6
NuGet\Install-Package RatelSoft.VisionTypes -Version 2.260110.6
<PackageReference Include="RatelSoft.VisionTypes" Version="2.260110.6" />
<PackageVersion Include="RatelSoft.VisionTypes" Version="2.260110.6" />
<PackageReference Include="RatelSoft.VisionTypes" />
paket add RatelSoft.VisionTypes --version 2.260110.6
#r "nuget: RatelSoft.VisionTypes, 2.260110.6"
#:package RatelSoft.VisionTypes@2.260110.6
#addin nuget:?package=RatelSoft.VisionTypes&version=2.260110.6
#tool nuget:?package=RatelSoft.VisionTypes&version=2.260110.6
RatelTypes
RatelTypes는 Ratel Vision 라이브러리의 핵심 타입 정의를 담고 있는 .NET Standard 2.0 라이브러리입니다.
개요
이 라이브러리는 비전 검사 시스템에서 사용되는 기본적인 데이터 타입들과 인터페이스를 제공합니다. 주요 기능으로는 얼룩(Mura) 검사, 스크래치(Scratch) 검사를 위한 설정 및 결과 타입들을 포함하고 있습니다.
지원 플랫폼
- .NET Standard 2.0 - 크로스 플랫폼 호환성
- .NET Framework 4.8 - 레거시 시스템 지원
- .NET 6.0 - 최신 .NET 플랫폼
- .NET 8.0 - 최신 .NET 플랫폼
의존성
- MessagePack (v2.5.192) - 고성능 직렬화/역직렬화
- System.Text.Json (v8.0.5) - JSON 처리
주요 구성 요소
🔍 얼룩 검사 (Mura Detection)
MuraConfig
얼룩 검사를 위한 필터 설정 클래스입니다.
// 4방향 원형 필터 생성
var config = MuraConfig.MakeCir4Config(
sizeX: 32,
sizeY: 32,
blackFactor: 10,
whiteFactor: 10,
diffCount: 4
);
// 수평 방향 필터 생성
var horiConfig = MuraConfig.MakeHoriConfig(256, 16, 10, 10);
// 8방향 원형 필터 생성
var cir8Config = MuraConfig.MakeCir8Config(64, 64, 10, 10);
// 수직 방향 필터 생성
var vertConfig = MuraConfig.MakeVertConfig(16, 256, 10, 10);
주요 속성
- FilterName: 필터 이름
- SizeX, SizeY: 필터 크기
- BlackFactor, WhiteFactor: 검출 임계값
- Angle: 회전 각도
- DiffCount: 비교 카운트
- AverageMethod: 평균 계산 방식 (Rect, Gaussian)
- MergeGroup: 병합 그룹명
IMuraDefect 인터페이스
얼룩 불량 결과를 나타내는 공통 인터페이스입니다.
public interface IMuraDefect
{
double Angle { get; set; }
int DefectNo { get; set; }
string FilterName { get; set; }
Rectangle Rectangle { get; set; }
double DefectLevel { get; set; }
WB WhiteBlack { get; set; }
// ... 기타 속성들
}
🎯 스크래치 검사 (Scratch Detection)
ScratchParams
스크래치 검사를 위한 파라미터 설정 클래스입니다.
var scratchParams = new ScratchParams
{
AngleDeg = 45.0, // 검사 각도
HStep = 4, // 수평 스텝
VStep = 4, // 수직 스텝
MinCount = 4, // 최소 카운트
MinLength = 100, // 최소 길이
Thickness = 32, // 두께
Level = 5.0f // 검출 레벨
};
📐 영역 설정 (SubRect)
SubRect 구조체
검사 영역을 설정하기 위한 구조체입니다.
// 기본 생성
var subRect = new SubRect(10, 10, 100, 100);
// 역방향 마스크
var inverseRect = new SubRect(10, 10, 100, 100, inverse: true);
// Rectangle에서 변환
var rect = new Rectangle(0, 0, 200, 200);
var subRect2 = new SubRect(rect);
// 문자열에서 파싱
var parsed = TypeDescriptor.GetConverter(typeof(SubRect))
.ConvertFromString("10, 10, 100, 100");
🔧 검사 옵션
ThreadType 열거형
검사 실행 방식을 지정합니다.
public enum ThreadType
{
Single, // 단일 스레드
Multi, // 멀티 스레드
Gpu // GPU 가속
}
CompareOption 열거형
비교 옵션을 설정합니다.
public enum CompareOption
{
Count, // 비교 카운트 포함
NoCount, // 평균 계산만 사용
MustNoCount, // 반드시 조건 만족, 레벨 계산 제외
MustCount, // 반드시 조건 만족, 레벨 계산 포함
MustNot // 반드시 조건 불만족
}
WB 열거형
불량 타입을 나타냅니다.
public enum WB
{
White, // 밝은 불량
Black, // 어두운 불량
ND // 미정의
}
사용 예제
기본 얼룩 검사 설정
using Ratel.Vision.Mura;
// 다양한 필터 조합 생성
var configs = new List<MuraConfig>
{
MuraConfig.MakeCir4Config(32, 32, 10, 15, diffCount: 4),
MuraConfig.MakeHoriConfig(128, 16, 8, 12, diffCount: 2),
MuraConfig.MakeCir8Config(64, 64, 12, 18, diffCount: 6)
};
// 각 설정에 공통 옵션 적용
foreach (var config in configs)
{
config.Use = true;
config.FilterName = $"Filter_{config.SizeX}x{config.SizeY}";
config.MinArea = 5;
config.EdgeOffset = 2.0;
}
고급 필터 설정
var advancedConfig = new MuraConfig
{
SizeX = 64,
SizeY = 64,
BlackFactor = 12,
WhiteFactor = 15,
Angle = 45.0, // 45도 회전
DiffCount = 3,
AverageMethod = AverageMethod.Gaussian,
EdgeOffset = 2.0,
EdgeDiffCount = 2, // 에지에서의 DiffCount
MergeGroup = "Advanced"
};
// 사용자 정의 비교 점 설정
advancedConfig.DefectPoints.Add(new SurConfig(0, 0));
advancedConfig.SurPoints.Add(new SurConfig(-1, 0, CompareOption.Count));
advancedConfig.SurPoints.Add(new SurConfig(1, 0, CompareOption.Count));
advancedConfig.SurPoints.Add(new SurConfig(0, -1, CompareOption.Count));
advancedConfig.SurPoints.Add(new SurConfig(0, 1, CompareOption.Count));
SubRect 활용
// 검사 영역 제한
var config = MuraConfig.MakeCir4Config(32, 32, 10, 10);
config.SubRect = new SubRect(50, 50, -50, -50); // 가장자리 50픽셀 제외
// 역방향 마스크 (중앙 영역 제외)
config.SubRect = new SubRect(100, 100, 200, 200, inverse: true);
직렬화 지원
모든 주요 타입들은 MessagePack과 System.Text.Json을 통한 직렬화를 지원합니다.
// MessagePack 직렬화
var bytes = MessagePackSerializer.Serialize(config);
var restoredConfig = MessagePackSerializer.Deserialize<MuraConfig>(bytes);
// JSON 직렬화
var json = JsonSerializer.Serialize(config, new JsonSerializerOptions
{
WriteIndented = true
});
var restoredConfig = JsonSerializer.Deserialize<MuraConfig>(json);
타입 변환 지원
SubRect는 TypeConverter를 통한 문자열 변환을 지원합니다.
// 문자열에서 SubRect로 변환
var converter = TypeDescriptor.GetConverter(typeof(SubRect));
var subRect = (SubRect)converter.ConvertFromString("10, 20, 100, 200");
// SubRect에서 문자열로 변환
var str = converter.ConvertToString(subRect); // "10, 20, 100, 200"
// 역방향 마스크 표현
var inverseStr = converter.ConvertToString(new SubRect(10, 20, 100, 200, true));
// "[10, 20, 100, 200]"
성능 최적화
- MessagePack 직렬화: 바이너리 형태로 빠른 직렬화/역직렬화
- 메모리 효율성: 구조체 기반 설계로 메모리 사용량 최적화
- 멀티 플랫폼: .NET Standard 2.0 기반으로 광범위한 호환성
라이선스
© 2025 RatelSoft. All rights reserved.
버전 정보
- 현재 버전: 25.0805.2
- 어셈블리 버전: 1.2508.5.2
- Repository: https://github.com/jjack000/Library-RatelLib.git
이 라이브러리는 Ratel Vision 시스템의 핵심 구성 요소로, 고성능 비전 검사 애플리케이션 개발을 위한 기본 타입들을 제공합니다.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- MessagePack (>= 2.5.192)
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.0
- MessagePack (>= 2.5.192)
- System.Text.Json (>= 8.0.5)
-
net6.0
- MessagePack (>= 2.5.192)
- System.Text.Json (>= 8.0.5)
-
net8.0
- MessagePack (>= 2.5.192)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.260110.6 | 142 | 1/10/2026 |
| 2.260110.4 | 138 | 1/10/2026 |
| 2.260103.7 | 170 | 1/3/2026 |
| 1.260110.1 | 122 | 1/10/2026 |
| 1.260103.1 | 117 | 1/2/2026 |