Home
last modified time | relevance | path

Searched refs:np (Results 1 – 25 of 61) sorted by relevance

123

/cts/apps/CameraITS/utils/
Dnoise_model_utils.py28 import numpy as np namespace
68 def check_noise_model_shape(noise_model: np.ndarray) -> None:
87 noise_model: np.ndarray,
133 gains: np.ndarray,
134 sens_max_analog: np.ndarray,
135 ) -> np.ndarray:
149 digital_gains = np.maximum(gains / sens_max_analog, 1)
150 if not np.all(digital_gains == 1):
189 mean_img: np.ndarray,
190 var_img: np.ndarray,
[all …]
Dsensor_fusion_utils.py28 import numpy as np namespace
138 first_derivative = np.polyder(coefficients, m=1)
139 second_derivative = np.polyder(coefficients, m=2)
140 extrema = np.roots(first_derivative)
143 if np.polyval(second_derivative, extremum) > 0:
387 rotations_sum = np.cumsum(rotations)
410 gyro_times = np.array([e['time'] for e in gyro_events])
411 all_gyro_rots = np.array([e['z'] for e in gyro_events])
451 gyro_rots = np.array(gyro_rots)
470 x0 = (x-x.mean(0)) / np.sqrt(((x-x.mean(0))**2.0).sum())
[all …]
Dcapture_read_noise_utils.py32 import numpy as np namespace
124 iso_sq_values = np.linspace(iso_low**2, iso_high**2, _LINEAR_FIT_NUM_SAMPLES)
161 y_values = np.array(
165 x_ticks = np.linspace(iso_low**2, iso_high**2, _PLOT_AXIS_TICKS)
166 y_ticks = np.linspace(np.min(y_values), np.max(y_values), _PLOT_AXIS_TICKS)
217 mean = np.mean(channel_img[:, :, ch])
218 var = np.var(channel_img[:, :, ch])
260 coeffs = np.polyfit(iso_sq, norm_var, 1)
265 read_noise_coefficients_a = np.asarray(read_noise_coefficients_a)
266 read_noise_coefficients_b = np.asarray(read_noise_coefficients_b)
[all …]
Dimu_processing_utils_tests.py16 import numpy as np namespace
45 self.assertTrue(np.allclose(imu_processing_utils.calc_rv_drift(d), d_drift),
Dcamera_properties_utils.py22 import numpy as np namespace
791 ical = np.array(metadata['android.lens.intrinsicCalibration'])
794 ical = np.array(props['android.lens.intrinsicCalibration'])
827 k = np.array([[ical[0], ical[4], ical[2]],
846 t = np.array(props['android.lens.poseTranslation'])
870 rotation = np.array(props['android.lens.poseRotation'])
884 return np.array([[1-2*y**2-2*z**2, 2*x*y-2*z*w, 2*x*z+2*y*w],
899 dist = np.array(props['android.lens.distortion'])
907 cv2_distort = np.array([dist[0], dist[1], dist[3], dist[4], dist[2]])
Dsensor_fusion_utils_tests.py19 import numpy as np namespace
95 cam_times = np.array(range(pts[0], pts[9], self._CAM_FRAME_TIME))
99 cam_rots = np.array(cam_rots)
136 self.assertTrue(np.allclose(
169 for x in np.arange(-1.1, 1.1, 0.05):
/cts/apps/CameraITS/tests/scene2_a/
Dtest_effects.py20 import numpy as np namespace
93 y_min, y_max = np.amin(y)*_YUV_MAX, np.amax(y)*_YUV_MAX
99 u_min, u_max = np.amin(u) * _YUV_MAX, np.amax(u) * _YUV_MAX
100 v_min, v_max = np.amin(v) * _YUV_MAX, np.amax(v) * _YUV_MAX
112 u_min, u_max = np.amin(u)*_YUV_MAX, np.amax(u)*_YUV_MAX
113 v_min, v_max = np.amin(v)*_YUV_MAX, np.amax(v)*_YUV_MAX
/cts/apps/CameraITS/tests/scene0/
Dtest_test_patterns.py21 import numpy as np namespace
57 np.amax(r_tile), np.amax(gr_tile), np.amax(gb_tile), np.amax(b_tile))
59 np.amin(r_tile), np.amin(gr_tile), np.amin(gb_tile), np.amin(b_tile))
86 img = np.fliplr(img)
94 np.allclose(
Dtest_tonemap_curve.py20 import numpy as np namespace
114 if np.allclose(_COLOR_CHECKER[color], raw_means, atol=_RAW_ATOL):
166 raw_means = np.array(image_processing_utils.compute_image_means(raw_patch))
167 raw_vars = np.array(
169 yuv_means = np.array(image_processing_utils.compute_image_means(yuv_patch))
171 yuv_vars = np.array(
173 if not np.allclose(raw_means, yuv_means, atol=_RGB_MEAN_ATOL):
183 if not np.allclose(raw_vars, yuv_vars, atol=_RGB_VAR_ATOL):
Dtest_vibration_restriction.py21 import numpy as np namespace
77 var_w_vibration = np.var(magnitudes)
84 var_wo_vibration = np.var(magnitudes)
99 var_w_vibration_restricted = np.var(magnitudes)
/cts/apps/CameraITS/tests/scene3/
Dtest_flip_mirror.py22 import numpy as np namespace
75 if np.max(chart_uint8)-np.min(chart_uint8) < 255/8:
80 image_processing_utils.write_image(template[:, :, np.newaxis] / 255,
90 image_processing_utils.write_image(template[:, :, np.newaxis] / 255,
92 image_processing_utils.write_image(chart_uint8[:, :, np.newaxis] / 255,
102 comp_chart = np.flipud(center_uint8)
104 comp_chart = np.fliplr(center_uint8)
106 comp_chart = np.flipud(np.fliplr(center_uint8))
Dtest_imu_drift.py23 import numpy as np namespace
139 pylab.ylim([min([np.amin(x), np.amin(y), np.amin(z), -_GYRO_MEAN_THRESH]),
140 max([np.amax(x), np.amax(y), np.amax(x), _GYRO_MEAN_THRESH])])
200 t = np.array([(e['time'] - events[0]['time'])*t_factor
202 x = np.array([e['x']*xyz_factor for e in events])
203 y = np.array([e['y']*xyz_factor for e in events])
204 z = np.array([e['z']*xyz_factor for e in events])
277 gyro_var = np.var(samples)
/cts/apps/CameraITS/tests/scene4/
Dtest_multi_camera_alignment.py23 import numpy as np namespace
45 _TRANS_MATRIX_REF = np.array([0, 0, 0]) # translation matrix for ref cam is 000
278 k_x1 = np.dot(k[0, :], r[:, 0])
279 k_x2 = np.dot(k[0, :], r[:, 1])
280 k_x3 = z_w * np.dot(k[0, :], r[:, 2]) + np.dot(k[0, :], t)
281 k_y1 = np.dot(k[1, :], r[:, 0])
282 k_y2 = np.dot(k[1, :], r[:, 1])
283 k_y3 = z_w * np.dot(k[1, :], r[:, 2]) + np.dot(k[1, :], t)
285 a = np.array([[x*r[2][0]-k_x1, x*r[2][1]-k_x2],
287 b = np.array([[k_x3-x*c_1], [k_y3-y*c_1]])
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DNinePatchTests.kt51 val np = with(ImageDecoder.createSource(activity.resources, R.drawable.padding_0)) { in <lambda>() constant
59 addCanvasClientWithoutUsingPicture(NinePatchCanvasClient(np, paint), hw) in <lambda>()
64 np.bitmap.recycle() in <lambda>()
69 val np = with(ImageDecoder.createSource(activity.resources, R.drawable.padding_0)) { in <lambda>() constant
80 NinePatchCanvasClient(np, paint).draw(canvas, TEST_WIDTH, TEST_HEIGHT) in <lambda>()
90 for (bitmap in arrayOf(filtered, unfiltered, noPaint, np.bitmap)) { in <lambda>()
/cts/apps/CameraITS/tests/scene_video/
Dtest_preview_frame_drop.py23 import numpy as np namespace
44 output = max(output, np.average(values[i:i+window_size]))
130 frame_deltas = np.array(video_processing_utils.get_frame_deltas(
132 frame_delta_max = np.max(frame_deltas)
133 frame_delta_min = np.min(frame_deltas)
134 frame_delta_avg = np.average(frame_deltas)
135 frame_delta_var = np.var(frame_deltas)
/cts/apps/CameraITS/tests/scene9/
Dtest_jpeg_quality.py24 import numpy as np namespace
89 jpeg = np.concatenate((jpeg[0:i], jpeg[length:]), axis=None)
154 luma = np.array(jpeg[luma_start: luma_start + dqt_size])
155 chroma = np.array(jpeg[chroma_start: chroma_start + dqt_size])
156 lumas.append(np.mean(luma))
157 chromas.append(np.mean(chroma))
168 matrix = np.array(jpeg[start:start + dqt_size])
170 chromas.append(np.mean(matrix))
175 lumas.append(np.mean(matrix))
266 lumas = np.array(lumas)
[all …]
/cts/apps/CameraITS/tests/scene1_1/
Dtest_auto_vs_manual.py21 import numpy as np namespace
127 if not np.allclose(awb_xform, x, atol=_AWB_MANUAL_ATOL, rtol=0):
131 if not np.allclose(awb_gains, g, atol=_AWB_MANUAL_ATOL, rtol=0):
137 if not np.allclose(awb_xform_a, awb_xform, atol=_AWB_AUTO_ATOL,
141 if not np.allclose(awb_gains_a, awb_gains, atol=_AWB_AUTO_ATOL,
Dtest_linearity.py23 import numpy as np namespace
43 _GAMMA_LUT = np.array(
45 _INV_GAMMA_LUT = np.array(
130 line, residuals, _, _, _ = np.polyfit(
/cts/apps/CameraITS/tests/scene_flash/
Dtest_preview_min_frame_rate.py22 import numpy as np namespace
134 frame_deltas = np.array(video_processing_utils.get_frame_deltas(
136 frame_delta_avg = np.average(frame_deltas)
137 frame_delta_var = np.var(frame_deltas)
154 y_avg = np.average(
/cts/apps/CameraITS/tests/sensor_fusion/
Dtest_preview_distortion.py21 import numpy as np namespace
75 image_diagonal = np.sqrt(image.shape[0]**2 + image.shape[1]**2)
139 ideal_points = np.zeros((pattern_size[0] * pattern_size[1], 3), np.float32)
141 np.mgrid[0:pattern_size[0], 0:pattern_size[1]].T.reshape(-1, 2)
187 rms_error = math.sqrt(np.mean(np.square(distortion_errors)))
266 corners = np.concatenate(corners, axis=0).reshape(-1, 4, 2)
281 arranged_corners = np.array([marker_dict[i] for i in range(len(corners))])
284 corners = np.expand_dims(arranged_corners, axis=1)
293 ideal_points = np.delete(ideal_points, middle_index, axis=0)
Dtest_sensor_fusion.py28 import numpy as np namespace
202 starts = np.array([start for start, exptime, readout in cam_events])
203 max_frame_delta_ms = (np.amax(np.subtract(starts[1:], starts[0:-1])) /
210 exptimes = np.array([exptime for start, exptime, readout in cam_events])
211 if not np.all(exptimes == exptimes[0]):
213 readouts = np.array([readout for start, exptime, readout in cam_events])
214 if not np.all(readouts == readouts[0]):
231 xfit = np.arange(x[0], x[-1], 0.05).tolist()
286 frames.append(np.array(img).reshape((h, w, 3)) / 255)
/cts/apps/CameraITS/tests/inprog/rolling_shutter_skew/
Dtest_rolling_shutter_skew.py20 import numpy as np namespace
319 np_cluster = np.array([[c.x, c.y] for c in largest_cluster])
369 img = img.astype(np.uint8)
382 kernel = np.ones((3, 3), np.uint8)
416 self.x = int(np.mean(contour[:, 0, 0]))
417 self.y = int(np.mean(contour[:, 0, 1]))
419 x_r = (np.max(contour[:, 0, 0]) - np.min(contour[:, 0, 0])) / 2.0
420 y_r = (np.max(contour[:, 0, 1]) - np.min(contour[:, 0, 1])) / 2.0
570 points = np.array([[x, y], [x + w, y], [x + w, y + h], [x, y + h]],
571 np.int32)
/cts/apps/CameraITS/tests/scene1_2/
Dtest_yuv_plus_dng.py21 import numpy as np namespace
32 _UNITY_MATRIX = np.array([1, 0, 0,
91 if not np.allclose(calibration_xform, _UNITY_MATRIX,
/cts/apps/CameraITS/tests/scene6/
Dtest_zoom.py26 import numpy as np namespace
60 z_list = np.arange(z_min, z_max, (z_max - z_min) / (_NUM_STEPS - 1))
61 z_list = np.append(z_list, z_max)
63 z_list = np.insert(z_list, 0, 1) # make first (reference) zoom 1x
/cts/apps/CameraITS/tests/scene_extensions/scene_hdr/
Dtest_hdr_extension.py23 import numpy as np namespace
73 tile = tile.astype(np.uint8)
110 sobel = np.float32(np.hypot(sobel_x, sobel_y))
114 opencv_processing_utils.find_all_contours(np.uint8(sobel)), key=len)
142 for a in np.arange(*_CONTRAST_ARANGE):

123