Skip to content

Conversation

@JanJaapPoos
Copy link

I changed estimateDistortion and estimateUndistortion. These made calls to nlminb with parameters that were set to NA. In the call to the optimized function there were then set to zero. In the original package this made the optimizer get stuck. In the code, these final to parameters were always set to NAs in the starting values. So they were never actually estimated and always set to zero.

To conserve functionality I, changed to code to be able to receive either 5 or 7 starting parameters. If 5 parameters were sent, (similar to setting them to NA in the current version, which was always the case), then the final two parameters are set to zero. After the call to the optimizer these NAs are then padded to the output, to make sure that 7 parameters are returned (for both estimateDistortion and estimateUndistortion). Minor changes were made to undistortionError and distortionError to allow for the code change

A test of calibrateCameras() on the movie clip that is available as example online shows that the code now runs. I could not check if the outcomes are numerically the same. Thanks again for sharing this code in github. Much appreciated.

removed last three elements from each list member
Removed last two (NA) elements from each list member to make nlminb work again
make if statement for  lengths of p in distaortionerror so that different lengths of p can be sent
made two code paths for distortionError, one for having 5 and one for 7 parameters
made two code paths in undistortionError, one for 5 and one for 7 p values, meaning that the last two parameters can be estimated, or not.
fixed bug I introduced in undistortionError (call to undistort wanted to send objec that was not argument from undistortError.
fixed another (similar) bug that I introduced when copying over code. This time image.size vs img.size
made sure that the length of dist_params is always 7, by padding NAs. Needed now that we can create shorter sets of params
padded parameters with NA at the end so that there are always seven, now that we can send fewer parameters to optimizer
Fixed bug I introduced when padding dist_params
Added nth argument that allows taking every nth frame when extracting frames
changed StereoMorph to SBRUV
Renamed SEXP exports to SBRUV_ from StereoMorph
To look for SBRUV dir when running shiny app
There was one frame in a video from a student that made outlierCorner fail in FindCorners. Then entire calibration halted. That was not needed: if Find corners fails, we have one fewer frames, but program can continue. Ugly fix by adding try() to corner detection for ffmpeg code path
This includes the try() around corner detection in calibrateCameras for ffmpeg code path
For SBRUV, when detecting corners, go through all jpeg files in the first pass, but in second pass go only through files for which first pass succeeded. That speeds up code, but is only smart for less than 3 views (so OK in stereo)
update version, with change to calibrate cams so that second pass of corner detection does not do unnecessary work.
No parallel, eigen or arma
merged Rcpp implementations into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant