mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-07 21:31:56 +02:00
[ui] ImageGallery: display metadata and lens status flag
This commit is contained in:
parent
86fa806f65
commit
51995f47e4
2 changed files with 67 additions and 13 deletions
|
@ -107,22 +107,65 @@ Panel {
|
||||||
onRemoveRequest: sendRemoveRequest()
|
onRemoveRequest: sendRemoveRequest()
|
||||||
Keys.onDeletePressed: sendRemoveRequest()
|
Keys.onDeletePressed: sendRemoveRequest()
|
||||||
|
|
||||||
// Reconstruction status indicator
|
Row {
|
||||||
Label {
|
|
||||||
id: statusIndicator
|
|
||||||
|
|
||||||
// object can be evaluated to null at some point during creation/deletion
|
|
||||||
property bool inViews: Qt.isQtObject(object) && _reconstruction.sfmReport && _reconstruction.isInViews(object)
|
|
||||||
property bool reconstructed: inViews && _reconstruction.isReconstructed(model.object)
|
|
||||||
|
|
||||||
font.family: MaterialIcons.fontFamily
|
|
||||||
text: reconstructed ? MaterialIcons.check_circle : MaterialIcons.remove_circle
|
|
||||||
color: reconstructed ? "#4CAF50" : "#F44336"
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
font.pointSize: 10
|
// Lens recognized
|
||||||
visible: inViews
|
ToolButton {
|
||||||
|
id: metadataIndicator
|
||||||
|
|
||||||
|
// object can be evaluated to null at some point during creation/deletion
|
||||||
|
property bool valid: Qt.isQtObject(object)
|
||||||
|
property bool hasMetadata: _reconstruction.hasMetadata(model.object)
|
||||||
|
|
||||||
|
contentItem: Label {
|
||||||
|
font.family: MaterialIcons.fontFamily
|
||||||
|
text: MaterialIcons.info_outline
|
||||||
|
color: parent.hasMetadata ? "#4CAF50" : "#F44336"
|
||||||
|
font.pointSize: 10
|
||||||
|
}
|
||||||
|
ToolTip.text: hasMetadata ? "Has Metadata" : "Missing Metadata"
|
||||||
|
ToolTip.visible: pressed
|
||||||
|
visible: valid && !hasMetadata
|
||||||
|
}
|
||||||
|
// Lens recognized
|
||||||
|
ToolButton {
|
||||||
|
id: lensIndicator
|
||||||
|
|
||||||
|
// object can be evaluated to null at some point during creation/deletion
|
||||||
|
property bool valid: Qt.isQtObject(object)
|
||||||
|
property bool hasValidIntrinsic: _reconstruction.hasValidIntrinsic(model.object)
|
||||||
|
|
||||||
|
contentItem: Label {
|
||||||
|
font.family: MaterialIcons.fontFamily
|
||||||
|
text: MaterialIcons.warning
|
||||||
|
color: "#F44336"
|
||||||
|
font.pointSize: 10
|
||||||
|
}
|
||||||
|
visible: valid && !hasValidIntrinsic
|
||||||
|
|
||||||
|
ToolTip.text: "Unable to find camera intrinsic parameters.\nCheck image metadata."
|
||||||
|
ToolTip.visible: pressed
|
||||||
|
}
|
||||||
|
// Reconstruction status indicator
|
||||||
|
ToolButton {
|
||||||
|
id: statusIndicator
|
||||||
|
|
||||||
|
// object can be evaluated to null at some point during creation/deletion
|
||||||
|
property bool inViews: Qt.isQtObject(object) && _reconstruction.sfmReport && _reconstruction.isInViews(object)
|
||||||
|
property bool reconstructed: inViews && _reconstruction.isReconstructed(model.object)
|
||||||
|
|
||||||
|
contentItem: Label {
|
||||||
|
font.family: MaterialIcons.fontFamily
|
||||||
|
text: parent.reconstructed ? MaterialIcons.check_circle : MaterialIcons.remove_circle
|
||||||
|
color: parent.reconstructed ? "#4CAF50" : "#F44336"
|
||||||
|
font.pointSize: 10
|
||||||
|
}
|
||||||
|
ToolTip.text: reconstructed ? "Reconstructed" : "Not Reconstructed"
|
||||||
|
ToolTip.visible: pressed
|
||||||
|
visible: inViews
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,6 +495,17 @@ class Reconstruction(UIGraph):
|
||||||
# keys are strings (faster lookup)
|
# keys are strings (faster lookup)
|
||||||
return str(viewpoint.poseId.value) in self._poses
|
return str(viewpoint.poseId.value) in self._poses
|
||||||
|
|
||||||
|
@Slot(QObject, result=bool)
|
||||||
|
def hasValidIntrinsic(self, viewpoint):
|
||||||
|
# keys are strings (faster lookup)
|
||||||
|
allIntrinsicIds = [i.intrinsicId.value for i in self._cameraInit.intrinsics.value]
|
||||||
|
return viewpoint.intrinsicId.value in allIntrinsicIds
|
||||||
|
|
||||||
|
@Slot(QObject, result=bool)
|
||||||
|
def hasMetadata(self, viewpoint):
|
||||||
|
# Should be greater than 2 to avoid the particular case of ""
|
||||||
|
return len(viewpoint.metadata.value) > 2
|
||||||
|
|
||||||
def setSelectedViewId(self, viewId):
|
def setSelectedViewId(self, viewId):
|
||||||
if viewId == self._selectedViewId:
|
if viewId == self._selectedViewId:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue