common rect

pull/32249/head
ZwX1616 1 year ago
parent 5a258a5742
commit 4668b8e8b7
  1. 7
      common/util.h
  2. 3
      system/camerad/cameras/camera_common.cc
  3. 10
      system/camerad/cameras/camera_common.h
  4. 2
      system/camerad/cameras/camera_qcom2.h
  5. 2
      system/camerad/sensors/sensor.h
  6. 2
      system/camerad/test/test_ae_gray.cc

@ -179,3 +179,10 @@ void update_max_atomic(std::atomic<T>& max, T const& value) {
T prev = max;
while (prev < value && !max.compare_exchange_weak(prev, value)) {}
}
typedef struct Rect {
int x;
int y;
int w;
int h;
} Rect;

@ -8,7 +8,6 @@
#include "common/clutil.h"
#include "common/swaglog.h"
#include "common/util.h"
#include "third_party/linux/include/msm_media_info.h"
#include "system/camerad/cameras/camera_qcom2.h"
@ -261,7 +260,7 @@ static void publish_thumbnail(PubMaster *pm, const CameraBuf *b) {
pm->send("thumbnail", msg);
}
float set_exposure_target(const CameraBuf *b, AutoExposureRect ae_xywh, int x_skip, int y_skip) {
float set_exposure_target(const CameraBuf *b, Rect ae_xywh, int x_skip, int y_skip) {
int lum_med;
uint32_t lum_binning[256] = {0};
const uint8_t *pix_ptr = b->cur_yuv_buf->y;

@ -7,6 +7,7 @@
#include "cereal/messaging/messaging.h"
#include "cereal/visionipc/visionipc_server.h"
#include "common/queue.h"
#include "common/util.h"
const int YUV_BUFFER_COUNT = 20;
@ -24,13 +25,6 @@ const bool env_debug_frames = getenv("DEBUG_FRAMES") != NULL;
const bool env_log_raw_frames = getenv("LOG_RAW_FRAMES") != NULL;
const bool env_ctrl_exp_from_params = getenv("CTRL_EXP_FROM_PARAMS") != NULL;
typedef struct AutoExposureRect {
int x;
int y;
int w;
int h;
} AutoExposureRect;
typedef struct FrameMetadata {
uint32_t frame_id;
uint32_t request_id;
@ -82,7 +76,7 @@ typedef void (*process_thread_cb)(MultiCameraState *s, CameraState *c, int cnt);
void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data, CameraState *c);
kj::Array<uint8_t> get_raw_frame_image(const CameraBuf *b);
float set_exposure_target(const CameraBuf *b, AutoExposureRect ae_xywh, int x_skip, int y_skip);
float set_exposure_target(const CameraBuf *b, Rect ae_xywh, int x_skip, int y_skip);
std::thread start_process_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback);
void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx);

@ -30,7 +30,7 @@ public:
int new_exp_g;
int new_exp_t;
AutoExposureRect ae_xywh;
Rect ae_xywh;
float measured_grey_fraction;
float target_grey_fraction;

@ -48,7 +48,7 @@ public:
float target_grey_factor;
float min_ev;
float max_ev;
std::vector<AutoExposureRect> ae_areas;
std::vector<Rect> ae_areas;
bool data_word;
uint32_t probe_reg_addr;

@ -36,7 +36,7 @@ TEST_CASE("camera.test_set_exposure_target") {
cb.cur_yuv_buf = &vb;
cb.rgb_width = W;
cb.rgb_height = H;
AutoExposureRect rect = {0, 0, W-1, H-1};
Rect rect = {0, 0, W-1, H-1};
printf("AE test patterns %dx%d\n", cb.rgb_width, cb.rgb_height);

Loading…
Cancel
Save