Skip to content
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

Create albedo texture for a model from calibrated images #6806

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions cpp/open3d/core/TensorKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class TensorKey {
/// For TensorKeyMode::Slice only.
int64_t GetStart() const;

/// Get stop index. Throws exception if start is None.
/// Get stop index. Throws exception if stop is None.
/// For TensorKeyMode::Slice only.
int64_t GetStop() const;

/// Get step index. Throws exception if start is None.
/// Get step index. Throws exception if step is None.
/// For TensorKeyMode::Slice only.
int64_t GetStep() const;

Expand Down
3 changes: 2 additions & 1 deletion cpp/open3d/io/ImageIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ bool WriteImage(const std::string &filename,
auto map_itr = file_extension_to_image_write_function.find(filename_ext);
if (map_itr == file_extension_to_image_write_function.end()) {
utility::LogWarning(
"Write geometry::Image failed: unknown file extension.");
"Write geometry::Image failed: file extension {} unknown.",
filename_ext);
return false;
}
return map_itr->second(filename, image, quality);
Expand Down
6 changes: 6 additions & 0 deletions cpp/open3d/t/geometry/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ Image Image::Resize(float sampling_rate, InterpType interp_type) const {
if (sampling_rate == 1.0f) {
return *this;
}
if (GetDtype() == core::Bool) { // Resize via UInt8
return Image(Image(data_.ReinterpretCast(core::UInt8))
.Resize(sampling_rate, interp_type)
.AsTensor()
.ReinterpretCast(core::Bool));
}

static const dtype_channels_pairs npp_supported{
{core::UInt8, 1}, {core::UInt16, 1}, {core::Float32, 1},
Expand Down
3 changes: 1 addition & 2 deletions cpp/open3d/t/geometry/RaycastingScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ uint32_t RaycastingScene::AddTriangles(const TriangleMesh& mesh) {
}

std::unordered_map<std::string, core::Tensor> RaycastingScene::CastRays(
const core::Tensor& rays, const int nthreads) {
const core::Tensor& rays, const int nthreads) const {
AssertTensorDtypeLastDimDeviceMinNDim<float>(rays, "rays", 6,
impl_->tensor_device_);
auto shape = rays.GetShape();
Expand Down Expand Up @@ -1723,7 +1723,6 @@ uint32_t RaycastingScene::INVALID_ID() { return RTC_INVALID_GEOMETRY_ID; }
} // namespace geometry
} // namespace t
} // namespace open3d

namespace fmt {
template <>
struct formatter<RTCError> {
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/t/geometry/RaycastingScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RaycastingScene {
/// - \b primitive_normals A tensor with the normals of the hit
/// triangles. The shape is {.., 3}.
std::unordered_map<std::string, core::Tensor> CastRays(
const core::Tensor &rays, const int nthreads = 0);
const core::Tensor &rays, const int nthreads = 0) const;

/// \brief Checks if the rays have any intersection with the scene.
/// \param rays A tensor with >=2 dims, shape {.., 6}, and Dtype Float32
Expand Down
Loading
Loading