modeldata.h: new function get_model_yuv_transform (#20257)
old-commit-hash: 80cc0eefc9f132590e3baad595fdd3c01e85c406
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "common/params.h"
|
||||
#include "common/swaglog.h"
|
||||
#include "common/util.h"
|
||||
#include "modeldata.h"
|
||||
#include "imgproc/utils.h"
|
||||
|
||||
static cl_program build_debayer_program(cl_device_id device_id, cl_context context, const CameraInfo *ci, const CameraBuf *b, const CameraState *s) {
|
||||
@@ -69,16 +70,8 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s,
|
||||
rgb_width = ci->frame_width / 2;
|
||||
rgb_height = ci->frame_height / 2;
|
||||
}
|
||||
float db_s = 0.5;
|
||||
#else
|
||||
float db_s = 1.0;
|
||||
#endif
|
||||
const mat3 transform = (mat3){{
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0
|
||||
}};
|
||||
yuv_transform = ci->bayer ? transform_scale_buffer(transform, db_s) : transform;
|
||||
yuv_transform = get_model_yuv_transform(ci->bayer);
|
||||
|
||||
vipc_server->create_buffers(rgb_type, UI_BUF_COUNT, true, rgb_width, rgb_height);
|
||||
rgb_stride = vipc_server->get_buffer(rgb_type)->stride;
|
||||
|
||||
@@ -34,5 +34,19 @@ const mat3 fcam_intrinsic_matrix = (mat3){{
|
||||
}};
|
||||
#endif
|
||||
|
||||
static inline mat3 get_model_yuv_transform(bool bayer = true) {
|
||||
#ifndef QCOM2
|
||||
float db_s = 0.5; // debayering does a 2x downscale
|
||||
#else
|
||||
float db_s = 1.0;
|
||||
#endif
|
||||
const mat3 transform = (mat3){{
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0
|
||||
}};
|
||||
return bayer ? transform_scale_buffer(transform, db_s) : transform;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -37,17 +37,7 @@ void* live_thread(void *arg) {
|
||||
-1.84808520e-20, 9.00738606e-04,-4.28751576e-02;
|
||||
|
||||
Eigen::Matrix<float, 3, 3> fcam_intrinsics = Eigen::Matrix<float, 3, 3, Eigen::RowMajor>(fcam_intrinsic_matrix.v);
|
||||
#ifndef QCOM2
|
||||
float db_s = 0.5; // debayering does a 2x downscale
|
||||
#else
|
||||
float db_s = 1.0;
|
||||
#endif
|
||||
|
||||
mat3 yuv_transform = transform_scale_buffer((mat3){{
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0,
|
||||
}}, db_s);
|
||||
const mat3 yuv_transform = get_model_yuv_transform();
|
||||
|
||||
while (!do_exit) {
|
||||
if (sm.update(100) > 0){
|
||||
|
||||
Reference in New Issue
Block a user