-
Notifications
You must be signed in to change notification settings - Fork 9
Add several interfaces about point cloud etc #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
cfcac33
5c2c437
6c23dad
3d1ba2d
725effe
da04799
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /** | ||
| * @copyright Copyright (c) 2026 B-com http://www.b-com.com/ | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef SOLAR_IKEYFRAMELOADER_H | ||
| #define SOLAR_IKEYFRAMELOADER_H | ||
|
|
||
| #include "datastructure/CameraParametersCollection.h" | ||
| #include "datastructure/KeyframeCollection.h" | ||
| #include <optional> | ||
| #include <xpcf/api/IComponentIntrospect.h> | ||
|
|
||
| namespace SolAR { | ||
| namespace api { | ||
| namespace input { | ||
| namespace files { | ||
jim-bcom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * @class IKeyframeLoader | ||
| * @brief <B>Load a keyframe collection from file.</B> | ||
| * <TT>UUID: 2d1d125c-6bd2-4e2c-af76-f58910cb7791</TT> | ||
| * | ||
| */ | ||
| class XPCF_IGNORE IKeyframeLoader : virtual public org::bcom::xpcf::IComponentIntrospect { | ||
| public: | ||
| /// @brief default constructor | ||
| IKeyframeLoader() = default; | ||
|
|
||
| /// @brief default destructor | ||
| virtual ~IKeyframeLoader() = default; | ||
|
|
||
| /// @brief Load a keyframe collection from file | ||
| /// @param[out] keyframeCollection the loaded keyframe collection (camera ID is set to 0) | ||
| /// @return FrameworkReturnCode::_SUCCESS if load succeeded, else FrameworkReturnCode::_ERROR_ | ||
| virtual FrameworkReturnCode load(SRef<SolAR::datastructure::KeyframeCollection>& keyframeCollection) = 0; | ||
|
|
||
| /// @brief Load a keyframe collection and a camera parameters collection from file | ||
| /// @param[out] keyframeCollection the loaded keyframe collection | ||
| /// @param[out] cameraParametersCollection the loaded camera parameters collection | ||
| /// @return FrameworkReturnCode::_SUCCESS if load succeeded, else FrameworkReturnCode::_ERROR_ | ||
| virtual FrameworkReturnCode load(SRef<SolAR::datastructure::KeyframeCollection>& keyframeCollection, | ||
| SRef<SolAR::datastructure::CameraParametersCollection>& cameraParametersCollection) = 0; | ||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| XPCF_DEFINE_INTERFACE_TRAITS(SolAR::api::input::files::IKeyframeLoader, | ||
| "2d1d125c-6bd2-4e2c-af76-f58910cb7791", | ||
| "IKeyframeLoader", | ||
| "Load a keyframe collection from file"); | ||
|
|
||
|
|
||
| #endif // SOLAR_IKEYFRAMELOADER_H | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,58 @@ | ||
| /** | ||
| * @copyright Copyright (c) 2024 B-com http://www.b-com.com/ | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #ifndef SOLAR_IPOINTCLOUDLOADER_H | ||
| #define SOLAR_IPOINTCLOUDLOADER_H | ||
| #include <xpcf/api/IComponentIntrospect.h> | ||
| #include <xpcf/core/helpers.h> | ||
| #include "core/Messages.h" | ||
| #include "datastructure/Map.h" | ||
| namespace SolAR { | ||
| namespace api { | ||
| namespace input { | ||
| namespace files { | ||
| /** | ||
| * @class IMapLoader | ||
| * @brief <B>Loads a map from a file.</B> | ||
| * <TT>UUID: 84dbbc4f-cc65-40ff-946d-7ed4999fb3a5</TT> | ||
| * | ||
| */ | ||
| class XPCF_IGNORE IMapLoader : | ||
| virtual public org::bcom::xpcf::IComponentIntrospect { | ||
| public: | ||
| IMapLoader() = default; | ||
| virtual ~IMapLoader() = default; | ||
| /// @brief Load a Map from a filepath | ||
| /// @param[out] map the loaded map | ||
| /// @return FrameworkReturnCode::_SUCCESS if load succeed, else FrameworkReturnCode::_ERROR_ | ||
| virtual FrameworkReturnCode load(SRef<SolAR::datastructure::Map> & map) = 0; | ||
| }; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| XPCF_DEFINE_INTERFACE_TRAITS(SolAR::api::input::files::IMapLoader, | ||
| "84dbbc4f-cc65-40ff-946d-7ed4999fb3a5", | ||
| "IMapLoader", | ||
| "Load a map from a file"); | ||
| #endif // SOLAR_IPOINTCLOUDLOADER_H | ||
| /** | ||
| * @copyright Copyright (c) 2024 B-com http://www.b-com.com/ | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef SOLAR_IMAPLOADER_H | ||
| #define SOLAR_IMAPLOADER_H | ||
|
|
||
| #include <xpcf/api/IComponentIntrospect.h> | ||
| #include <xpcf/core/helpers.h> | ||
| #include "core/Messages.h" | ||
| #include "datastructure/Map.h" | ||
|
|
||
| namespace SolAR { | ||
| namespace api { | ||
| namespace input { | ||
| namespace files { | ||
| /** | ||
| * @class IMapLoader | ||
| * @brief <B>Loads a map from a file.</B> | ||
| * <TT>UUID: 84dbbc4f-cc65-40ff-946d-7ed4999fb3a5</TT> | ||
| * | ||
| */ | ||
| class XPCF_IGNORE IMapLoader : | ||
| virtual public org::bcom::xpcf::IComponentIntrospect { | ||
| public: | ||
| IMapLoader() = default; | ||
| virtual ~IMapLoader() = default; | ||
|
|
||
| /// @brief Load a Map from a filepath | ||
| /// @param[out] map the loaded map | ||
| /// @return FrameworkReturnCode::_SUCCESS if load succeed, else FrameworkReturnCode::_ERROR_ | ||
| virtual FrameworkReturnCode load(SRef<SolAR::datastructure::Map> & map) = 0; | ||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| XPCF_DEFINE_INTERFACE_TRAITS(SolAR::api::input::files::IMapLoader, | ||
| "84dbbc4f-cc65-40ff-946d-7ed4999fb3a5", | ||
| "IMapLoader", | ||
| "Load a map from a file"); | ||
|
|
||
|
|
||
| #endif // SOLAR_IMAPLOADER_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /** | ||
| * @copyright Copyright (c) 2026 B-com http://www.b-com.com/ | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef SOLAR_IPCPROJECTONTOIMAGE_H | ||
| #define SOLAR_IPCPROJECTONTOIMAGE_H | ||
|
|
||
| #include "datastructure/CameraDefinitions.h" | ||
| #include "datastructure/Image.h" | ||
| #include "datastructure/PointCloud.h" | ||
| #include <xpcf/api/IComponentIntrospect.h> | ||
| #include <xpcf/core/helpers.h> | ||
|
|
||
| namespace SolAR { | ||
| namespace api { | ||
| namespace pointCloud { | ||
|
|
||
| /** | ||
| * @class IPCProjectOntoImage | ||
| * @brief <B>Project a point cloud onto image.</B> | ||
| * <TT>UUId: 3700812e-0af5-4968-b972-4fdc6d3d7371</TT> | ||
| */ | ||
|
|
||
| class XPCF_IGNORE IPCProjectOntoImage : virtual public org::bcom::xpcf::IComponentIntrospect { | ||
| public: | ||
| /// @brief IPCProjectOntoImage default constructor | ||
| IPCProjectOntoImage() = default; | ||
|
|
||
| /// @brief IPCProjectOntoImage default destructor | ||
| virtual ~IPCProjectOntoImage() = default; | ||
|
|
||
| /// @brief Project a point cloud onto an image plane | ||
| /// @param[in] pointCloud the point cloud | ||
| /// @param[in] cameraParameters the camera parameters | ||
| /// @param[in] pose the camera pose | ||
| /// @param[out] image output image created from the point cloud | ||
| /// @return FrameworkReturnCode::_SUCCESS (pointcloud projected onto image successfully) otherwise FrameworkReturnCode::_ERROR_ (failure) | ||
| virtual FrameworkReturnCode project(SRef<SolAR::datastructure::PointCloud> pointCloud, | ||
| SRef<SolAR::datastructure::CameraParameters> cameraParameters, | ||
| const SolAR::datastructure::Transform3Df& pose, | ||
| SRef<SolAR::datastructure::Image>& image) const = 0; | ||
|
|
||
| }; | ||
| } | ||
| } | ||
| } // end of namespace Solar | ||
|
|
||
| XPCF_DEFINE_INTERFACE_TRAITS(SolAR::api::pointCloud::IPCProjectOntoImage, | ||
| "3700812e-0af5-4968-b972-4fdc6d3d7371", | ||
| "IPCProjectOntoImage", | ||
| "Interface for projecting a point cloud onto image"); | ||
|
|
||
|
|
||
| #endif // SOLAR_IPCPROJECTONTOIMAGE_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /** | ||
| * @copyright Copyright (c) 2026 B-com http://www.b-com.com/ | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #ifndef SOLAR_IPCSEMANTICFROM2D_H | ||
| #define SOLAR_IPCSEMANTICFROM2D_H | ||
|
|
||
| #include "core/Messages.h" | ||
| #include "datastructure/CameraParametersCollection.h" | ||
| #include "datastructure/KeyframeCollection.h" | ||
| #include "datastructure/Mask2DCollection.h" | ||
| #include "datastructure/PointCloud.h" | ||
| #include <xpcf/api/IComponentIntrospect.h> | ||
| #include <xpcf/core/helpers.h> | ||
|
|
||
| namespace SolAR { | ||
| namespace api { | ||
| namespace pointCloud { | ||
|
|
||
| /** | ||
| * @class IPCSemanticFrom2D | ||
| * @brief <B>Estimate semantic Ids of cloud points from 2D information.</B> | ||
| * <TT>UUId: e7f67167-1512-4c1c-808a-adcfb606030e</TT> | ||
| */ | ||
|
|
||
| class XPCF_IGNORE IPCSemanticFrom2D : virtual public org::bcom::xpcf::IComponentIntrospect { | ||
| public: | ||
| /// @brief IPCSemanticFrom2D default constructor | ||
| IPCSemanticFrom2D() = default; | ||
|
|
||
| /// @brief IPCSemanticFrom2D default destructor | ||
| virtual ~IPCSemanticFrom2D() = default; | ||
|
|
||
| /// @brief Estimate point cloud semantic Ids from a keyframe collection and a mask collection | ||
| /// @param[in,out] pointCloud the point cloud for which semantic Ids will be estimated | ||
| /// @param[in] keyframeCollection input list of keyframes | ||
| /// @param[in] cameraParametersCollection input list of camera parameters | ||
| /// @param[in] maskCollection input list of masks | ||
| /// @return FrameworkReturnCode::_SUCCESS (semantic id estimated successfully) otherwise FrameworkReturnCode::_ERROR_ (failure) | ||
| virtual FrameworkReturnCode estimate(SRef<SolAR::datastructure::PointCloud> pointCloud, | ||
| SRef<SolAR::datastructure::KeyframeCollection> keyframeCollection, | ||
| SRef<SolAR::datastructure::CameraParametersCollection> cameraParametersCollection, | ||
| SRef<SolAR::datastructure::Mask2DCollection> maskCollection) const = 0; | ||
|
|
||
| }; | ||
| } | ||
| } | ||
| } // end of namespace Solar | ||
|
|
||
| XPCF_DEFINE_INTERFACE_TRAITS(SolAR::api::pointCloud::IPCSemanticFrom2D, | ||
| "e7f67167-1512-4c1c-808a-adcfb606030e", | ||
| "IPCSemanticFrom2D", | ||
| "Interface for estimating semantic Ids of cloud points from 2D information"); | ||
|
|
||
|
|
||
| #endif // SOLAR_IPCSEMANTICFROM2D_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,6 +98,12 @@ void Map::setKeyframeCollection(const SRef<KeyframeCollection> keyframeCollectio | |
| // we use m_keyframesManager to access the keyframes and optimize their poses | ||
| // the modifs on keyframes' poses will not be applied to the keyframe collection of m_map | ||
| m_keyframeCollection = keyframeCollection; | ||
| if (!m_keyframeCollection) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I don't remember exactly how it is supposed to work, because it's a bit complicated so I'm just wondering:
My question is: is this flag related to the fact that this KF collection has images, is it actually more a decision on whether or not we should serialize images, whether it has them or not?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this flag is only used to indicate if KF collection has images, not related to serialization. m_embedKeyframeImages == true means that at least one of the keyframes in the map have image data
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
// m_embedKeyframeImages is only used in serialization to decide if we serialize images
void Map::embedKeyframeImages()
{
m_embedKeyframeImages = true;
}
This being said, I'll let you the final word on this. |
||
| m_embedKeyframeImages = false; | ||
| } | ||
| else { | ||
| m_embedKeyframeImages = m_keyframeCollection->getNbKeyframesHavingImage() > 0; | ||
| } | ||
| } | ||
|
|
||
| const SRef<CovisibilityGraph> Map::getConstCovisibilityGraph() const | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.