KillingFusion
KillingFusion copied to clipboard
make error !
Hi, I compile your code and it turns out that
In member function ‘Eigen::Vector3d DisplacementField::computeKillingEnergyGradient(const Vector3i&) const’:
/home/peteryuan/Desktop/KillingFusion/KillingFusion/src/DisplacementField.cpp:276:102: error: no match for ‘operator-’ (operand types are ‘const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >’ and ‘double’)
if ((spatialIndex.array() < 2 * deltaSize).any() || (spatialIndex.array() >= (m_gridSize.array() - 2 * deltaSize)).any())
Seem like type m_gridSize.array() and double can't do minus operation.
Using Eigen 3.3.4 on ubuntu 18.04.
I also don't find overloaded operator in ArrayWrapper. How can I solve this problem, thanks.
@daxiong-123 I dont think this should happen. However, I will need some time to get free to look into this.
Hi, I compile your code and it turns out that
In member function ‘Eigen::Vector3d DisplacementField::computeKillingEnergyGradient(const Vector3i&) const’: /home/peteryuan/Desktop/KillingFusion/KillingFusion/src/DisplacementField.cpp:276:102: error: no match for ‘operator-’ (operand types are ‘const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >’ and ‘double’) if ((spatialIndex.array() < 2 * deltaSize).any() || (spatialIndex.array() >= (m_gridSize.array() - 2 * deltaSize)).any())
Seem like type m_gridSize.array() and double can't do minus operation.
Using Eigen 3.3.4 on ubuntu 18.04.
I also don't find overloaded operator in ArrayWrapper. How can I solve this problem, thanks.
Hello, I have met the same problem. Did you fix it?
@HerB1998 The error is coming from minus operation between an Eigen Vector(const Eigen::ArrayWrapper<const Eigen::Matrix<int, 3, 1> >
) and double
value: m_gridSize.array() - 2 * deltaSize)
.
See scalar subtraction - https://stackoverflow.com/a/35693493/1874627
I dont remember much of the codebase, but it looks almost valid. There might be a gotcha where I might have introduced a bug by trying to subtract a double from an int vector, but I believe this should be supported. If not, you might have to convert m_gridSize.array()
to double before subtraction.
Apologies, but it has been years since I worked on this, can barely recall.