-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
74 lines (66 loc) · 1.6 KB
/
types.ts
File metadata and controls
74 lines (66 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
export interface CalibrationPoint {
concentration: number;
rgb: number; // Total RGB value (R + G + B)
}
export interface AnalysisResult {
pesticide: string;
rgb: number; // Total RGB value (R + G + B)
brightness?: number; // Optional for backward compatibility
concentration: number;
confidence?: 'high' | 'medium' | 'low';
}
// New types for calibration strip approach
export interface CalibrationStrip {
name: string;
roi: {
x: number;
y: number;
width: number;
height: number;
};
concentrations: number[]; // Known concentrations on the strip (left to right)
}
export interface CalibrationResult {
pesticide: string;
testRGB: number;
testBrightness?: number; // Optional for backward compatibility
calibrationRGBs: number[];
calibrationBrightnesses?: number[]; // Optional for backward compatibility
estimatedConcentration: number;
confidence: 'high' | 'medium' | 'low';
isCaptureMode?: boolean; // Track if this result came from capture mode analysis
}
export interface HistoryRecord {
id: string;
name: string;
timestamp: string;
imageSrc: string;
results: AnalysisResult[];
}
export type Screen =
| 'capture'
| 'history'
| 'settings'
| 'analysis'
| 'alignment';
export interface PesticideROI {
name: string;
roi: {
x: number;
y: number;
width: number;
height: number;
};
}
// Detection mode types
export type DetectionMode = 'calibration' | 'normalization';
export interface ROI {
x: number;
y: number;
width: number;
height: number;
}
export interface NormalizationResult {
name: string;
brightness: number;
}