hi_isp_piris_attr
Description
Defines the attribute of the P-Iris.
Definition
typedef struct {
hi_bool step_fno_table_change;
hi_bool zero_is_max;
hi_u16 total_step;
hi_u16 step_count;
hi_u16 step_fno_table[HI_ISP_AI_MAX_STEP_FNO_NUM];
hi_isp_iris_f_no max_iris_fno_target;
hi_isp_iris_f_no min_iris_fno_target;
hi_bool fno_ex_valid;
hi_u32 max_iris_fno_target_linear;
hi_u32 min_iris_fno_target_linear;
} hi_isp_piris_attr;
Members
Member |
Description |
|---|---|
step_fno_table_change |
Flag indicating whether the mapping table for the position of the P-Iris stepper motor and the iris f-number is updated. If the value is set to HI_TRUE, the mapping table is updated. If the value is set to HI_FALSE, the mapping table is not updated. |
zero_is_max |
Flag indicating whether the iris is opened to the maximum size when the P-Iris stepper motor is in step 0. The value is related to the P-Iris lens. HI_TRUE indicates that the iris is opened to the maximum size when the stepper motor is in step 0. HI_FALSE indicates that the iris is closed when the stepper motor is in step 0. |
total_step |
Total number of steps for the P-Iris stepper motor. The value is related to the P-Iris lens. Value range: [1, 1024] |
step_count |
Number of available steps for the P-Iris stepper motor. The value is related to the P-Iris lens. Value range: [1, 1024] |
step_fno_table[HI_ISP_AI_MAX_STEP_FNO_NUM] |
Mapping table for the position of the P-Iris stepper motor and the f-number. The value is related to the P-Iris lens. Value range: [1, 1024] #define HI_ISP_AI_MAX_STEP_FNO_NUM 1024 |
max_iris_fno_target |
Maximum iris target value, used for controlling the AE allocation route. The size of the iris that takes effect is related to the P-Iris lens. Value range: [HI_ISP_IRIS_F_NO_32_0, HI_ISP_IRIS_F_NO_1_0] |
min_iris_fno_target |
Minimum iris target value, used for controlling the AE allocation route. The size of the iris that takes effect is related to the P-Iris lens. Value range: [HI_ISP_IRIS_F_NO_32_0, HI_ISP_IRIS_F_NO_1_0] |
fno_ex_valid |
Flag indicating whether the AE allocation route adopts the higher-precision equivalent gain of the iris f-number when the P-Iris is connected. HI_TRUE indicates that the AE allocation route adopts the higher-precision equivalent gain of the iris f-number. The default value is HI_FALSE. |
max_iris_fno_target_linear |
Target value of the equivalent gain of the maximum iris f-number, used for controlling the AE allocation route. The size of the iris that takes effect is related to the P-Iris lens. Value range: [1, 1024] |
min_iris_fno_target_linear |
Target value of the equivalent gain of the minimum iris f-number, used for controlling the AE allocation route. The size of the iris that takes effect is related to the P-Iris lens. Value range: [1, 1024] |
Restrictions
- When the P-Iris lens is changed in online mode, this data structure can be configured by using the corresponding MPI to transfer parameters of the new lens to the AE algorithms and P-Iris driver.
- step_fno_table_change is a write-only register, whose value is always HI_FALSE when it is obtained by calling the corresponding MPI.
- total_step indicates the total number of steps for the P-Iris stepper motor. It can be used for calibrating the start position of the iris.
- step_count indicates the number of available steps for the P-Iris stepper motor, and it is generally smaller than total_step. For the positions near the end at which the iris is disabled, the error is large when the iris aperture is converted into the f-number, and oscillation occurs during iris adjustment. Therefore, these positions are generally not used. If the precision of the P-Iris that supports at most 1024 steps is high and the number of adjustable steps exceeds 1024, you are advised not to use the positions near the end at which the iris is disabled.
- The mapping table (step_fno_table) for the position of the P-Iris stepper motor and the iris f-number is configured based on the mapping relationship between the stepper motor position and iris aperture, which is provided by the lens vendor. The P-Iris is controlled by using the AE allocation route, which requires a good linear relationship between the iris f-number and exposure time as well as gain. Therefore, high precision is required for the mapping table. The value 1024 indicates F1.0, the value 512 indicates F1.4, ..., the value 1 indicates F32.0. During the preparation of the mapping table, the maximum value of the mapping table can be specified based on the actual f-number corresponding to the maximum iris aperture, or the maximum iris aperture can be mapped to 1024 regardless of the actual f-number when the iris is opened to the maximum size. When the focal length of a lens is changed, the value of step_fno_table needs to be changed accordingly.
- The following describes how to configure the parameters related to the lens by taking the Forecam NV03105P P-Iris lens as an example. Table 1 describes the mapping relationship between the stepper motor position and the aperture area, which is provided by the lens vendor. The total number of steps for the stepper motor of this lens is 93. The iris aperture area is the largest when the stepper motor is in step 0. The nominal maximum relative aperture is F1.4. Therefore, the maximum f-number is 512. After the maximum f-number is determined, f-numbers corresponding to other aperture areas can be calculated based on the linear relationship. For example, if the aperture area is 48.835 when the stepper motor is in step 1, the f-number is 506 ((48.835/49.366) x 512). In this way, the f-numbers corresponding to all valid stepper motor positions can be obtained. As shown in the table, the aperture area is very small (the maximum aperture area is tens of thousands of times this value) when the lens is close to the end at which this lens is disabled. The f-number is not precise enough to reflect the change in the aperture area so that the corresponding f-numbers are all 0. Actually, even if the precision of the mapping table is increased, the f-numbers are inaccurate due to the huge difference between the nominal aperture area near the end at which this lens is disabled and the actual aperture area. You are advised not to use these f-numbers; otherwise, oscillation occurs during iris adjustment. You are advised to use only the first 62 steps during the preparation of the mapping table. For parameters related to the lens, see the following table.
- Only the first step_count elements in step_fno_table are valid and will be used by the AE algorithm for calculation. Ensure that the array coordinate is less than step_count and the value monotonically increases. When the array coordinate is (step_count – 1), the maximum f-number of the iris is reached. When the corresponding MPI is called to configure step_fno_table, only the first step_count elements are written to the register. When the corresponding MPI is called to obtain step_fno_table, the read values of only the first step_count elements are valid, and other elements are read as 0.
- When the iris type is P-Iris, the Ascend AE algorithm calculates the maximum or minimum exposure by referring to max_iris_fno_target or min_iris_fno_target (max_iris_fno_target_linear or min_iris_fno_target_linear if fno_ex_valid is true). Therefore, the values of these parameters should match the value of step_fno_table. That is, the maximum or minimum value should fall within the value range of step_fno_table.
- When manually configuring the information of the DCF iris, disable the AI. If the maximum iris value to be configured and the actual iris value are the 10 standard values defined in hi_isp_iris_f_no, set max_iris_fno_target to the maximum iris value and min_iris_fno_target to the actual iris value. If the iris values are not 10 standard values, set fno_ex_valid to HI_TRUE, calculate the actual iris gain and maximum iris equivalent gain based on the F32.0 equivalent gain (1x), set max_iris_fno_target_linear to the maximum iris equivalent gain, and set min_iris_fno_target_linear to the actual iris equivalent gain. If the AI is enabled, calculate the iris value based on the size of the actual iris that takes effect, and then update the DCF information. The minimum iris is F32.0.
Stepper Motor Position |
Aperture Area |
Mapping Table F-number |
Stepper Motor Position |
Aperture Area |
Mapping Table F-number |
Stepper Motor Position |
Aperture Area |
Mapping Table F-number |
|---|---|---|---|---|---|---|---|---|
0 |
49.366 |
512 |
35 |
20.07 |
208 |
70 |
0.136 |
1 |
1 |
48.835 |
506 |
36 |
19.241 |
200 |
71 |
0.095 |
1 |
2 |
48.234 |
500 |
37 |
18.42 |
191 |
72 |
0.067 |
1 |
3 |
47.571 |
493 |
38 |
17.609 |
183 |
73 |
0.045 |
0 |
4 |
46.856 |
486 |
39 |
16.808 |
174 |
74 |
0.028 |
0 |
5 |
46.11 |
478 |
40 |
16.017 |
166 |
75 |
0.016 |
0 |
6 |
45.324 |
470 |
41 |
15.237 |
158 |
76 |
0.008 |
0 |
7 |
44.511 |
462 |
42 |
14.469 |
150 |
77 |
0.004 |
0 |
8 |
43.674 |
453 |
43 |
13.788 |
143 |
78 |
0.003 |
0 |
9 |
42.822 |
444 |
44 |
12.972 |
135 |
79 |
0.003 |
0 |
10 |
41.963 |
435 |
45 |
12.254 |
127 |
80 |
0.002 |
0 |
11 |
41.099 |
426 |
46 |
11.541 |
120 |
81 |
0.002 |
0 |
12 |
40.231 |
417 |
47 |
10.843 |
112 |
82 |
0.001 |
0 |
13 |
39.357 |
408 |
48 |
10.162 |
105 |
83 |
0.001 |
0 |
14 |
38.478 |
399 |
49 |
9.497 |
98 |
84 |
0.001 |
0 |
15 |
37.608 |
390 |
50 |
8.851 |
92 |
85 |
close |
0 |
16 |
36.721 |
381 |
51 |
8.222 |
85 |
86 |
close |
0 |
17 |
35.832 |
372 |
52 |
7.611 |
79 |
87 |
close |
0 |
18 |
34.94 |
362 |
53 |
7.018 |
73 |
88 |
close |
0 |
19 |
34.047 |
353 |
54 |
6.443 |
67 |
89 |
close |
0 |
20 |
33.153 |
344 |
55 |
5.893 |
61 |
90 |
close |
0 |
21 |
32.259 |
335 |
56 |
5.354 |
56 |
91 |
close |
0 |
22 |
31.365 |
325 |
57 |
4.832 |
50 |
92 |
close |
0 |
23 |
30.473 |
316 |
58 |
4.329 |
45 |
93 |
M- stop |
0 |
24 |
29.582 |
307 |
59 |
3.843 |
40 |
- |
- |
- |
25 |
28.706 |
298 |
60 |
3.376 |
35 |
- |
- |
- |
26 |
27.82 |
289 |
61 |
2.926 |
30 |
- |
- |
- |
27 |
26.937 |
279 |
62 |
2.494 |
26 |
- |
- |
- |
28 |
26.059 |
270 |
63 |
2.08 |
22 |
- |
- |
- |
29 |
25.184 |
261 |
64 |
1.684 |
17 |
- |
- |
- |
30 |
24.315 |
252 |
65 |
1.305 |
14 |
- |
- |
- |
31 |
23.451 |
243 |
66 |
0.949 |
10 |
- |
- |
- |
32 |
22.593 |
234 |
67 |
0.607 |
6 |
- |
- |
- |
33 |
21.741 |
225 |
68 |
0.374 |
4 |
- |
- |
- |
34 |
20.896 |
217 |
69 |
0.225 |
2 |
- |
- |
- |
Parameter |
Value |
Remarks |
|---|---|---|
zero_is_max |
HI_TRUE |
Flag indicating whether the iris aperture is the largest when the stepper motor is in step 0 |
total_step |
93 |
Total number of steps for the stepper motor |
step_count |
62 |
Number of available steps for the stepper motor |
step_fno_table |
{30,35,40,45,50,56,61,67,73,79,85,92,98,105,112,120,127,135,143,150,158, 166,174,183,191,200,208,217,225,234,243,252,261,270,279,289,298,307,316,325,335,344, 353,362,372,381,390,399,408,417,426,435,444,453,462,470,478,486,493,500,506,512} |
Mapping table for the position of the P-Iris stepper motor and the iris f-number. According to Table 1, the f-numbers corresponding to the first 62 steps of the stepper motor are sorted in ascending order. Only the first step_count elements of step_fno_table are used for the calculation of the AE algorithm. When the array coordinate is less than step_count, values must be monotonically increasing. When the array coordinate is (step_count − 1), the maximum iris f-number (512) must be reached. |
max_iris_fno_target |
HI_ISP_IRIS_F_NO_1_4 |
Maximum value of the mapping table (512), corresponding to F1.4 |
min_iris_fno_target |
HI_ISP_IRIS_F_NO_5_6 |
Minimum value of the mapping table (30), corresponding to F5.6 |
fno_ex_valid |
HI_FALSE |
The high-precision equivalent gain of the iris f-number is not used by default. |
max_iris_fno_target_ linear |
512 |
Maximum value (512) in the value range of step_fno_table |
min_iris_fno_target_l inear |
30 |
Minimum value (30) in the value range of step_fno_table |