diff --git a/apps/specular_estimation/CMakeFiles/specular_estimation.dir/src/specular_estimation.cc.o b/apps/specular_estimation/CMakeFiles/specular_estimation.dir/src/specular_estimation.cc.o index 29f286b396353394d9c6de2eded299c2d79ce50a..8fdb5fd66b50683eaab1cb5b09a01b2498042308 100644 Binary files a/apps/specular_estimation/CMakeFiles/specular_estimation.dir/src/specular_estimation.cc.o and b/apps/specular_estimation/CMakeFiles/specular_estimation.dir/src/specular_estimation.cc.o differ diff --git a/apps/specular_estimation/src/Charuco.h b/apps/specular_estimation/src/Charuco.h index 6ae96fdc7b598250eee9df4f1612144642ba1288..75d48e75bc2e9f3035c9510d698a7aeb76a29161 100644 --- a/apps/specular_estimation/src/Charuco.h +++ b/apps/specular_estimation/src/Charuco.h @@ -32,8 +32,8 @@ void charucoCalibration(int width, int height, cv::Ptr<cv::aruco::CharucoBoard> cv::Ptr<cv::aruco::Dictionary> dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME(dictionaryId)); // Create a ChArUco board - int xSquares = 9; - int ySquares = 11; + int xSquares = 11; + int ySquares = 9; float squareSideLength = 0.04f; float markerSideLength = 0.02f; charucoBoard = cv::aruco::CharucoBoard::create(xSquares, ySquares, squareSideLength, markerSideLength, dictionary); @@ -41,8 +41,8 @@ void charucoCalibration(int width, int height, cv::Ptr<cv::aruco::CharucoBoard> //charucoBoardImage = drawCharuco(charucoBoard, height, ((height * xSquares) / ySquares), false, false); // Rotate ChArUco board - cv::Mat tempImage = drawCharuco(charucoBoard, ((width * ySquares) / xSquares), width, false, false); - cv::rotate(tempImage, charucoBoardImage, cv::ROTATE_90_COUNTERCLOCKWISE); + //cv::Mat tempImage = drawCharuco(charucoBoard, ((width * ySquares) / xSquares), width, false, false); + //cv::rotate(tempImage, charucoBoardImage, cv::ROTATE_90_COUNTERCLOCKWISE); // Calibrate the camera using the ChArUco board images to obtain the camera matrix and distortion coefficients calibrateCamera(xSquares, ySquares, squareSideLength, markerSideLength, dictionaryId, charucoImages, cameraMatrix, distortionCoefficients); diff --git a/apps/specular_estimation/src/OpenGL.h b/apps/specular_estimation/src/OpenGL.h index 484f93187543058daf87c24adfa35fad84d7c92a..48bd920ab4e8253cb1d0d1a4e2c3a9836de3026f 100644 --- a/apps/specular_estimation/src/OpenGL.h +++ b/apps/specular_estimation/src/OpenGL.h @@ -112,7 +112,7 @@ void initialiseOpenGL(cv::Mat cv_depth, cv::Mat cv_normals, cv::Mat cv_texture, glBindVertexArray(VertexArrayID); // Create and compile the GLSL program from the shaders - depthProgramID = LoadShaders("DepthRTT.vertexshader", "DepthRTT.fragmentshader"); + depthProgramID = LoadShaders("/home/thomas/Documents/Minimisation/apps/specular_estimation/src/DepthRTT.vertexshader", "/home/thomas/Documents/Minimisation/apps/specular_estimation/src/DepthRTT.fragmentshader"); // Get a handle for the "MVP" uniform GLuint depthMatrixID = glGetUniformLocation(depthProgramID, "depthMVP"); @@ -200,13 +200,13 @@ void initialiseOpenGL(cv::Mat cv_depth, cv::Mat cv_normals, cv::Mat cv_texture, glBufferData(GL_ARRAY_BUFFER, sizeof(g_quad_vertex_buffer_data), g_quad_vertex_buffer_data, GL_STATIC_DRAW); // Create and compile the GLSL program from the shaders - quad_programID = LoadShaders("Passthrough.vertexshader", "SimpleTexture.fragmentshader"); + quad_programID = LoadShaders("/home/thomas/Documents/Minimisation/apps/specular_estimation/src/Passthrough.vertexshader", "/home/thomas/Documents/Minimisation/apps/specular_estimation/src/SimpleTexture.fragmentshader"); std::cout << "Shaders loaded.\n"; GLuint texID = glGetUniformLocation(quad_programID, "texture"); std::cout << "Uniform Location of texture found.\n"; // Create and compile the GLSL program from the shaders - programID = LoadShaders("ShadowMapping.vertexshader", "ShadowMapping.fragmentshader"); + programID = LoadShaders("/home/thomas/Documents/Minimisation/apps/specular_estimation/src/ShadowMapping.vertexshader", "/home/thomas/Documents/Minimisation/apps/specular_estimation/src/ShadowMapping.fragmentshader"); // Get a handle for the "myTextureSampler" uniform TextureID = glGetUniformLocation(programID, "myTextureSampler"); diff --git a/apps/specular_estimation/src/specular_estimation.cc b/apps/specular_estimation/src/specular_estimation.cc index c955a26ba939630766a1cd2a4381af04eec1077f..be1f60ca97999a89c0e77cdbb1aa13ebbb81b6f5 100644 --- a/apps/specular_estimation/src/specular_estimation.cc +++ b/apps/specular_estimation/src/specular_estimation.cc @@ -108,7 +108,16 @@ int main(int argc, char** argv) { charucoCalibration(width, height, charucoBoard, charucoBoardImage, cameraMatrix, distortionCoefficients); - charucoAlignment(charucoImages, textureImages, numberOfLights, width, height, rotationMatrix, rotationVector, perspectiveTransform, lightDirections, lightDirectionsPerspective, rvecs, tvecs, charucoBoard, charucoBoardImage, cameraMatrix, distortionCoefficients); + //charucoAlignment(charucoImages, textureImages, numberOfLights, width, height, rotationMatrix, rotationVector, perspectiveTransform, lightDirections, lightDirectionsPerspective, rvecs, tvecs, charucoBoard, charucoBoardImage, cameraMatrix, distortionCoefficients); + +/* + rotationMatrix = + rotationVector = + perspectiveTransform = + lightDirectionsPerspective = + std::vector< cv::Vec3d > & rvecs + std::vector< cv::Vec3d > & tvecs +*/ photometricStereo(imageName, calibration, modelPath, imageScale, cropping, showTexture, heightMap, normalMap, texture, lightDirections, lightDirectionsPerspective, textureImages, modelImages, calibrationImages, calibrationBoundingBox, width, height, rvecs, tvecs); //photometricStereo(imageName, calibration, modelPath, imageScale, cropping, showTexture, heightMap, normalMap, texture, lightDirections, lightDirectionsPerspective, charucoImages, modelImages, calibrationImages, calibrationBoundingBox, width, height, rvecs, tvecs); diff --git a/bin/specular_estimation b/bin/specular_estimation index 83432c42febbb68c2d0b017531d9c95b7f3c6914..655deac80b3188a31c444e3a1e56a6db0efa6f1b 100755 Binary files a/bin/specular_estimation and b/bin/specular_estimation differ