[Panorama Viewer] Change the method to get the fisheye circle parameters

This commit is contained in:
Nils Landrodie 2021-08-27 18:37:34 +02:00 committed by Fabien Castan
parent 3fad2faa87
commit f25b5fe755
2 changed files with 6 additions and 17 deletions

View file

@ -40,9 +40,7 @@ AliceVision.PanoramaViewer {
property int mouseMultiplier: 1 property int mouseMultiplier: 1
property bool isFisheyePano: false property bool cropFisheyePano: false
property vector3d fisheyeCircleParametersPano
property var idSelected : -1 property var idSelected : -1
@ -250,8 +248,7 @@ AliceVision.PanoramaViewer {
'surface.viewerType': AliceVision.Surface.EViewerType.PANORAMA, 'surface.viewerType': AliceVision.Surface.EViewerType.PANORAMA,
'viewerTypeString': 'panorama', 'viewerTypeString': 'panorama',
'surface.subdivisions': Qt.binding(function() { return subdivisionsPano; }), 'surface.subdivisions': Qt.binding(function() { return subdivisionsPano; }),
'surface.isFisheye' : Qt.binding(function(){ return isFisheyePano; }), 'cropFisheye' : Qt.binding(function(){ return cropFisheyePano; }),
'fisheyeCircleParameters': Qt.binding(function(){ return fisheyeCircleParametersPano; }),
'surface.pitch': Qt.binding(function() { return root.pitch; }), 'surface.pitch': Qt.binding(function() { return root.pitch; }),
'surface.yaw': Qt.binding(function() { return root.yaw; }), 'surface.yaw': Qt.binding(function() { return root.yaw; }),
'surface.roll': Qt.binding(function() { return root.roll; }), 'surface.roll': Qt.binding(function() { return root.roll; }),

View file

@ -20,15 +20,7 @@ FocusScope {
property alias usePanoramaViewer: displayPanoramaViewer.checked property alias usePanoramaViewer: displayPanoramaViewer.checked
property var activeNodeFisheye: _reconstruction.activeNodes.get("PanoramaInit").node property var activeNodeFisheye: _reconstruction.activeNodes.get("PanoramaInit").node
property bool isFisheye : activeNodeFisheye ? activeNodeFisheye.attribute("useFisheye").value : false property bool cropFisheye : activeNodeFisheye ? activeNodeFisheye.attribute("useFisheye").value : false
property bool useAutoFisheye: activeNodeFisheye ? activeNodeFisheye.attribute("estimateFisheyeCircle").value : true
property real userFisheyeRadius: activeNodeFisheye ? activeNodeFisheye.attribute("fisheyeRadius").value : 0
property variant fisheyeAutoParams: activeNodeFisheye ? _reconstruction.getAutoFisheyeCircle(activeNodeFisheye) : null
property real fisheyeCircleX: useAutoFisheye ? (fisheyeAutoParams ? (fisheyeAutoParams.x) : 0) : activeNodeFisheye.attribute("fisheyeCenterOffset.fisheyeCenterOffset_x").value
property real fisheyeCircleY: useAutoFisheye ? (fisheyeAutoParams ? (fisheyeAutoParams.y) : 0) : activeNodeFisheye.attribute("fisheyeCenterOffset.fisheyeCenterOffset_y").value
property vector3d fisheyeCircleParametersVec: Qt.vector3d(fisheyeCircleX, fisheyeCircleY, userFisheyeRadius)
QtObject { QtObject {
id: m id: m
@ -297,7 +289,8 @@ FocusScope {
'sfmRequired': Qt.binding(function(){ return displayLensDistortionViewer.checked ? true : false;}), 'sfmRequired': Qt.binding(function(){ return displayLensDistortionViewer.checked ? true : false;}),
'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), 'surface.msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }),
'canBeHovered': false, 'canBeHovered': false,
'idView': Qt.binding(function() { return _reconstruction.selectedViewId; }) 'idView': Qt.binding(function() { return _reconstruction.selectedViewId; }),
'cropFisheye': false
}) })
} else { } else {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 // Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@ -318,8 +311,7 @@ FocusScope {
if(active) { if(active) {
setSource("PanoramaViewer.qml", { setSource("PanoramaViewer.qml", {
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}), 'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
'isFisheyePano': Qt.binding(function(){ return root.isFisheye;}), 'cropFisheyePano': Qt.binding(function(){ return root.cropFisheye;}),
'fisheyeCircleParametersPano' : Qt.binding(function(){ return root.fisheyeCircleParametersVec;}),
'downscale': Qt.binding(function(){ return panoramaViewerToolbar.downscaleValue;}), 'downscale': Qt.binding(function(){ return panoramaViewerToolbar.downscaleValue;}),
'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}), 'isEditable': Qt.binding(function(){ return panoramaViewerToolbar.enableEdit;}),
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}), 'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),