-
Notifications
You must be signed in to change notification settings - Fork 7
Fixed estimateDistortion and estimateUndistortion that got stuck in optimizer when calling calibrateCameras #15
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
Open
JanJaapPoos
wants to merge
69
commits into
aaronolsen:master
Choose a base branch
from
JanJaapPoos:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
included renaming methods
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.