Skip to content

Commit b4e0cda

Browse files
committed
Merge branch 'test-reg' of github.com:stereolabs/zed-open-capture into test-reg
2 parents e6f3b80 + c574b54 commit b4e0cda

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

examples/zed_oc_video_reg_log.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,29 @@ int main(int argc, char *argv[])
9494
lastFrameTs = frame.timestamp;
9595
#endif
9696

97-
// if (f_count!=0 && f_count%10==0)
97+
98+
99+
if (f_count%10==0)
100+
{
101+
/* cap.
102+
cap.saveAllISPRegisters("ov580_lr_"+std::to_string(f_count)+".csv");
103+
cap.saveAllSensorsRegisters("ov4689_lr_"+std::to_string(f_count)+".csv");
104+
std::cout<<" Save Data for f_count "<<f_count<<std::endl;*/
105+
if (f_count%20==0)
106+
cap.setColorBars(0,true);
107+
else
108+
cap.setColorBars(0,false);
109+
}
110+
111+
// if (f_count!=0 && f_count%10==0)
98112
// {
99113
// cap.saveAllISPRegisters("ov580_lr_"+std::to_string(f_count)+".csv");
100114
// cap.saveAllSensorsRegisters("ov4689_lr_"+std::to_string(f_count)+".csv");
101115
// std::cout<<" Save Data for f_count "<<f_count<<std::endl;
102116
// }
103117

104118

119+
105120
// ----> Conversion from YUV 4:2:2 to BGR for visualization
106121
cv::Mat frameYUV = cv::Mat( frame.height, frame.width, CV_8UC2, frame.data );
107122
cv::Mat frameBGR;

include/videocapture.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ class SL_OC_EXPORT VideoCapture
340340
*/
341341
int getSerialNumber();
342342

343+
/*!
344+
* \brief Utils fct to set Color Bars on Image
345+
*/
346+
void setColorBars(int side, bool c);
347+
343348
#ifdef SENSOR_LOG_AVAILABLE
344349
/*!
345350
* \brief Start logging to file of AEG/AGC camera registers

src/videocapture.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,18 @@ bool VideoCapture::enableAecAgcSensLogging(bool enable, int frame_skip/*=10*/)
20082008
return true;
20092009
}
20102010

2011+
void VideoCapture::setColorBars(int side, bool c)
2012+
{
2013+
2014+
2015+
unsigned long long ulAddr2 = 0x80181080;
2016+
if (side==1)
2017+
ulAddr2 = 0x80181880;
2018+
2019+
unsigned char ulValue2 =c?128:0;
2020+
ll_write_system_register(ulAddr2,ulValue2);
2021+
}
2022+
20112023

20122024
void VideoCapture::saveAllISPRegisters(std::string filename)
20132025
{
@@ -2023,7 +2035,7 @@ void VideoCapture::saveAllISPRegisters(std::string filename)
20232035
res += ll_read_system_register( ulAddrL+p, &valL);
20242036
res += ll_read_system_register( ulAddrR+p, &valR);
20252037

2026-
logFile <<"0x" << std::hex << std::setfill('0') << std::setw(8) << static_cast<unsigned long long>(ulAddrL)<<" , "<<std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned long long>(valL)<<" , "<<std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned long long>(valR)<<std::endl;
2038+
logFile <<"0x" << std::hex << std::setfill('0') << std::setw(8) << static_cast<unsigned long long>(ulAddrL+p)<<" , "<<std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned long long>(valL)<<" , "<<std::hex << std::setfill('0') << std::setw(2) << static_cast<unsigned long long>(valR)<<std::endl;
20272039
usleep(10);
20282040
}
20292041

0 commit comments

Comments
 (0)