openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4 KiB

#pragma once
#include <memory>
#include "cereal/messaging/messaging.h"
#include "msgq/visionipc/visionipc_server.h"
#include "common/queue.h"
image processing refactor and test (#32249) * it's something * backup * 16:10 * cleanup * this is fine * close * remove some junk * no heck * disos * real 10 * for some reason this is flipped * 20hz * no return * ae * tear * need curve laster * correct real gains * fix time * cleanup * why the scam * disable for now * 0.7 * hdr * that doesnt work * what * hugeoof * clean up * cleanup * fix regs * welp cant * is this corrent * it is sq * remove * back * stg10bit * back2ten * Revert "remove" This reverts commit 18712ab7e103c12621c929cd0f772ecb9b348247. * 20hz and swb * correct height * 10bit * ui hack for now * slight * perfect * blk64 * ccm * fix page faults * template * set 4x * is this fine * try * this seems to work * Revert "this seems to work" This reverts commit d3c9023d3f14bd9394fed2d6276dba777ed0e606. * needs to be static * close * 64 is optimal * 2 * take * not 1 * offset * whats going on * i have no idea * less resistence * box defs * no * reduce blur artifacts * simplify * fix * fake short is too much for bright * can be subzero * should not use lsvc * no wasted bit * cont no slow * no less than 10bit * it is based * wrong * right * quart * shift * raise noise floor * 4.5/4.7 * same ballpark * int is fine * shane owes me m4a4 * Revert "shane owes me m4a4" This reverts commit b4283fee18efebedae628a6cfd926ff1416dcfe5. * back * Revert "4.5/4.7" This reverts commit e38f96e90cb5370bd378f6b66def9e7e3ed0ce5d. * default * oof * clean up * simpilfy * from sensorinfo * no div * better name * not the wrong one * not anymore relevant * too * not call it debayer * cl headers * arg is 2nd * gone is is_bggr * define * no is hdr * rgb_tmp * p1 * clean up * 4 * cant for * fix somewhre else * const * ap * rects * just set staruc * nnew tmp * pull it for now * 12 * common rect * Revert "not anymore relevant" This reverts commit 1d574673a16cc31b7a255609e07775c3579eef15. * Revert "too" This reverts commit c2d4dcc52a859fe799362f9fcc2ffda99b264e50. * Revert "Revert "too"" This reverts commit 0abbabe1fde51592f1619058638b4ac6a6dee4b3. * no tol is fine * rename * sensor id * unsgin * flag * some linalg * cast * should be h ref * cap --------- Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 331c7b103a7e4349c75be373589fc68161e69500
1 year ago
#include "common/util.h"
const int YUV_BUFFER_COUNT = 20;
typedef struct FrameMetadata {
uint32_t frame_id;
uint32_t request_id;
uint64_t timestamp_sof;
uint64_t timestamp_eof;
float processing_time;
} FrameMetadata;
class SpectraCamera;
class CameraState;
image processing refactor and test (#32249) * it's something * backup * 16:10 * cleanup * this is fine * close * remove some junk * no heck * disos * real 10 * for some reason this is flipped * 20hz * no return * ae * tear * need curve laster * correct real gains * fix time * cleanup * why the scam * disable for now * 0.7 * hdr * that doesnt work * what * hugeoof * clean up * cleanup * fix regs * welp cant * is this corrent * it is sq * remove * back * stg10bit * back2ten * Revert "remove" This reverts commit 18712ab7e103c12621c929cd0f772ecb9b348247. * 20hz and swb * correct height * 10bit * ui hack for now * slight * perfect * blk64 * ccm * fix page faults * template * set 4x * is this fine * try * this seems to work * Revert "this seems to work" This reverts commit d3c9023d3f14bd9394fed2d6276dba777ed0e606. * needs to be static * close * 64 is optimal * 2 * take * not 1 * offset * whats going on * i have no idea * less resistence * box defs * no * reduce blur artifacts * simplify * fix * fake short is too much for bright * can be subzero * should not use lsvc * no wasted bit * cont no slow * no less than 10bit * it is based * wrong * right * quart * shift * raise noise floor * 4.5/4.7 * same ballpark * int is fine * shane owes me m4a4 * Revert "shane owes me m4a4" This reverts commit b4283fee18efebedae628a6cfd926ff1416dcfe5. * back * Revert "4.5/4.7" This reverts commit e38f96e90cb5370bd378f6b66def9e7e3ed0ce5d. * default * oof * clean up * simpilfy * from sensorinfo * no div * better name * not the wrong one * not anymore relevant * too * not call it debayer * cl headers * arg is 2nd * gone is is_bggr * define * no is hdr * rgb_tmp * p1 * clean up * 4 * cant for * fix somewhre else * const * ap * rects * just set staruc * nnew tmp * pull it for now * 12 * common rect * Revert "not anymore relevant" This reverts commit 1d574673a16cc31b7a255609e07775c3579eef15. * Revert "too" This reverts commit c2d4dcc52a859fe799362f9fcc2ffda99b264e50. * Revert "Revert "too"" This reverts commit 0abbabe1fde51592f1619058638b4ac6a6dee4b3. * no tol is fine * rename * sensor id * unsgin * flag * some linalg * cast * should be h ref * cap --------- Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 331c7b103a7e4349c75be373589fc68161e69500
1 year ago
class ImgProc;
class CameraBuf {
private:
VisionIpcServer *vipc_server;
image processing refactor and test (#32249) * it's something * backup * 16:10 * cleanup * this is fine * close * remove some junk * no heck * disos * real 10 * for some reason this is flipped * 20hz * no return * ae * tear * need curve laster * correct real gains * fix time * cleanup * why the scam * disable for now * 0.7 * hdr * that doesnt work * what * hugeoof * clean up * cleanup * fix regs * welp cant * is this corrent * it is sq * remove * back * stg10bit * back2ten * Revert "remove" This reverts commit 18712ab7e103c12621c929cd0f772ecb9b348247. * 20hz and swb * correct height * 10bit * ui hack for now * slight * perfect * blk64 * ccm * fix page faults * template * set 4x * is this fine * try * this seems to work * Revert "this seems to work" This reverts commit d3c9023d3f14bd9394fed2d6276dba777ed0e606. * needs to be static * close * 64 is optimal * 2 * take * not 1 * offset * whats going on * i have no idea * less resistence * box defs * no * reduce blur artifacts * simplify * fix * fake short is too much for bright * can be subzero * should not use lsvc * no wasted bit * cont no slow * no less than 10bit * it is based * wrong * right * quart * shift * raise noise floor * 4.5/4.7 * same ballpark * int is fine * shane owes me m4a4 * Revert "shane owes me m4a4" This reverts commit b4283fee18efebedae628a6cfd926ff1416dcfe5. * back * Revert "4.5/4.7" This reverts commit e38f96e90cb5370bd378f6b66def9e7e3ed0ce5d. * default * oof * clean up * simpilfy * from sensorinfo * no div * better name * not the wrong one * not anymore relevant * too * not call it debayer * cl headers * arg is 2nd * gone is is_bggr * define * no is hdr * rgb_tmp * p1 * clean up * 4 * cant for * fix somewhre else * const * ap * rects * just set staruc * nnew tmp * pull it for now * 12 * common rect * Revert "not anymore relevant" This reverts commit 1d574673a16cc31b7a255609e07775c3579eef15. * Revert "too" This reverts commit c2d4dcc52a859fe799362f9fcc2ffda99b264e50. * Revert "Revert "too"" This reverts commit 0abbabe1fde51592f1619058638b4ac6a6dee4b3. * no tol is fine * rename * sensor id * unsgin * flag * some linalg * cast * should be h ref * cap --------- Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 331c7b103a7e4349c75be373589fc68161e69500
1 year ago
ImgProc *imgproc = nullptr;
VisionStreamType stream_type;
int cur_buf_idx;
SafeQueue<int> safe_queue;
int frame_buf_count;
public:
FrameMetadata cur_frame_data;
VisionBuf *cur_yuv_buf;
VisionBuf *cur_camera_buf;
std::unique_ptr<VisionBuf[]> camera_bufs;
std::unique_ptr<FrameMetadata[]> camera_bufs_metadata;
int out_img_width, out_img_height;
CameraBuf() = default;
~CameraBuf();
void init(cl_device_id device_id, cl_context context, SpectraCamera *cam, VisionIpcServer * v, int frame_cnt, VisionStreamType type);
bool acquire(int expo_time);
void queue(size_t buf_idx);
};
void camerad_thread();
kj::Array<uint8_t> get_raw_frame_image(const CameraBuf *b);
image processing refactor and test (#32249) * it's something * backup * 16:10 * cleanup * this is fine * close * remove some junk * no heck * disos * real 10 * for some reason this is flipped * 20hz * no return * ae * tear * need curve laster * correct real gains * fix time * cleanup * why the scam * disable for now * 0.7 * hdr * that doesnt work * what * hugeoof * clean up * cleanup * fix regs * welp cant * is this corrent * it is sq * remove * back * stg10bit * back2ten * Revert "remove" This reverts commit 18712ab7e103c12621c929cd0f772ecb9b348247. * 20hz and swb * correct height * 10bit * ui hack for now * slight * perfect * blk64 * ccm * fix page faults * template * set 4x * is this fine * try * this seems to work * Revert "this seems to work" This reverts commit d3c9023d3f14bd9394fed2d6276dba777ed0e606. * needs to be static * close * 64 is optimal * 2 * take * not 1 * offset * whats going on * i have no idea * less resistence * box defs * no * reduce blur artifacts * simplify * fix * fake short is too much for bright * can be subzero * should not use lsvc * no wasted bit * cont no slow * no less than 10bit * it is based * wrong * right * quart * shift * raise noise floor * 4.5/4.7 * same ballpark * int is fine * shane owes me m4a4 * Revert "shane owes me m4a4" This reverts commit b4283fee18efebedae628a6cfd926ff1416dcfe5. * back * Revert "4.5/4.7" This reverts commit e38f96e90cb5370bd378f6b66def9e7e3ed0ce5d. * default * oof * clean up * simpilfy * from sensorinfo * no div * better name * not the wrong one * not anymore relevant * too * not call it debayer * cl headers * arg is 2nd * gone is is_bggr * define * no is hdr * rgb_tmp * p1 * clean up * 4 * cant for * fix somewhre else * const * ap * rects * just set staruc * nnew tmp * pull it for now * 12 * common rect * Revert "not anymore relevant" This reverts commit 1d574673a16cc31b7a255609e07775c3579eef15. * Revert "too" This reverts commit c2d4dcc52a859fe799362f9fcc2ffda99b264e50. * Revert "Revert "too"" This reverts commit 0abbabe1fde51592f1619058638b4ac6a6dee4b3. * no tol is fine * rename * sensor id * unsgin * flag * some linalg * cast * should be h ref * cap --------- Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 331c7b103a7e4349c75be373589fc68161e69500
1 year ago
float set_exposure_target(const CameraBuf *b, Rect ae_xywh, int x_skip, int y_skip);
void publish_thumbnail(PubMaster *pm, const CameraBuf *b);
int open_v4l_by_name_and_index(const char name[], int index = 0, int flags = O_RDWR | O_NONBLOCK);