Skip to content

Commit

Permalink
Fix alpha/beta adjustment for behav cam. Remove possible anchor loop …
Browse files Browse the repository at this point in the history
…in controlpanel.qml. Extend timeout to 100 for videostream frame acq.
  • Loading branch information
daharoni committed Feb 26, 2020
1 parent 11f4eb9 commit c6980e0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions source/ControlPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ Item {
textFormat: TextEdit.RichText
text: "'Space Bar': screenshot of video stream.<br/>'h': hides/shows video stream controls.<br/>Messages:"
// wrapMode: Text.WrapAnywhere
anchors.fill: parent
// anchors.fill: flick1
font.pointSize: 12
readOnly: true
background: Rectangle {
// radius: rbSelectUserConfig.radius
anchors.fill: parent
// anchors.fill: flick1
// border.width: 1
color: "#ebebeb"
}
Expand Down
13 changes: 8 additions & 5 deletions source/Miniscope-DAQ-QT-Software.pro
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ HEADERS += \
DISTFILES +=


win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_world420
#win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_videoio_ffmpeg420_64
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_world420d
LIBS += -L$$PWD/../../../../../../../opencv-build420/lib/Release/ -lopencv_world420
#LIBS += -L$$PWD/../../../../../../../opencv-build420/lib/Debug/ -lopencv_world420d

#win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_world420
##win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_videoio_ffmpeg420_64
#else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_world420d

#LIBS += -L$$PWD/../../../../../../../opencv-build420/install/x64/vc15/lib/ -lopencv_world420

INCLUDEPATH += $$PWD/../../../../../../../opencv-build420/install/include
DEPENDPATH += $$PWD/../../../../../../../opencv-build420/install/include
INCLUDEPATH += $$PWD/../../../../../../../opencv/build/include
#DEPENDPATH += $$PWD/../../../../../../../opencv-build420/install/include


# Move user and device configs to build directory
Expand Down
3 changes: 2 additions & 1 deletion source/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ void backEnd::testCodecSupport()
{
// This function will test which codecs are supported on host's machine
cv::VideoWriter testVid;
QVector<QString> possibleCodec({"DIB ", "MJPG", "MJ2C", "XVID", "FFV1", "DX50", "FLV1", "H264", "I420","MPEG","mp4v"});
// testVid.open("test.avi", -1,20, cv::Size(640, 480), true);
QVector<QString> possibleCodec({"DIB ", "MJPG", "MJ2C", "XVID", "FFV1", "DX50", "FLV1", "H264", "I420","MPEG","mp4v", "0000", "LAGS", "ASV1", "GREY"});
for (int i = 0; i < possibleCodec.length(); i++) {
testVid.open("test.avi", cv::VideoWriter::fourcc(possibleCodec[i].toStdString()[0],possibleCodec[i].toStdString()[1],possibleCodec[i].toStdString()[2],possibleCodec[i].toStdString()[3]),
20, cv::Size(640, 480), true);
Expand Down
6 changes: 3 additions & 3 deletions source/behaviorCam.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Item {
height: parent.height
state: "controlsShown"
focus: true
signal vidPropChangedSignal(string name, double displayValue, double i2cValue)
signal vidPropChangedSignal(string name, double displayValue, double i2cValue, double i2cValue2)
signal takeScreenShotSignal()

signal camPropsClicked()
Expand Down Expand Up @@ -208,11 +208,11 @@ Item {

Connections{
target: alpha
onValueChangedSignal: vidPropChangedSignal(alpha.objectName, displayValue, i2cValue)
onValueChangedSignal: vidPropChangedSignal(alpha.objectName, displayValue, i2cValue, i2cValue2)
}
Connections{
target: beta
onValueChangedSignal: vidPropChangedSignal(beta.objectName, displayValue, i2cValue)
onValueChangedSignal: vidPropChangedSignal(beta.objectName, displayValue, i2cValue, i2cValue2)
}

states: [
Expand Down
2 changes: 1 addition & 1 deletion source/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Window {
anchors.fill: parent

TextArea {
text: "Miniscope DAQ Software version 0.15 <br/>" +
text: "Miniscope DAQ Software version 0.16 <br/>" +
"Your OpenGL verions: " + OpenGLInfo.majorVersion + "." + OpenGLInfo.minorVersion + "<br/>" +
"Developed by the <a href='https://aharoni-lab.github.io/'>Aharoni Lab</a>, UCLA <br/> " +
"Overview of the UCLA Miniscope project: <a href='http://www.miniscope.org'>click here</a> <br/>" +
Expand Down
2 changes: 1 addition & 1 deletion source/videostreamocv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void VideoStreamOCV::startStream()
sendMessage("Error: " + m_deviceName + " frame buffer is full. Frames will be lost!");
}

if(freeFrames->tryAcquire(1,20)) {
if(freeFrames->tryAcquire(1,100)) {
if (!cam->grab()) {
sendMessage("Warning: " + m_deviceName + " grab frame failed. Attempting to reconnect.");
if (cam->isOpened()) {
Expand Down
2 changes: 1 addition & 1 deletion userConfigs/UserConfigExample_V4_BNO_Miniscope.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"deviceType": "Miniscope_V4_BNO",
"imageRegistration": "Off",
"streamHeadOrientation": true,
"deviceID": 2,
"deviceID": 1,
"showSaturation": true,
"compressionOptions": ["MJPG","MJ2C","XVID","FFV1"],
"compression": "FFV1",
Expand Down

0 comments on commit c6980e0

Please sign in to comment.