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

Icub23 code #136

Merged
merged 9 commits into from
May 3, 2021
Merged

Icub23 code #136

merged 9 commits into from
May 3, 2021

Conversation

lunagava
Copy link
Contributor

In the case the user wants to remove lens distortion when launching vPreProcess module, he/she has to specify the calibration folder containing the calibration file (e.g. atis_calib.ini), using the just added parameters calibContext and calibFile from terminal or within vPreProcess.ini .

@lunagava lunagava requested a review from arrenglover April 26, 2021 16:28
@arrenglover
Copy link
Collaborator

Hi @lunagava - I made a change to remove the declaration of the strings from the class. Does it still work as I have changed it?

@arrenglover arrenglover self-assigned this Apr 27, 2021
@lunagava
Copy link
Contributor Author

Hi @arrenglover, I've just tested and it still works.

I am wondering if it would be appropriate to add a print of intrinsic and extrinsic parameters in vIPT.cpp, so that the user can check these are taken correctly from the specified calibration file.

@arrenglover
Copy link
Collaborator

arrenglover commented Apr 27, 2021

good idea: I would suggest having an additional argument bool verbose = false at this function:

bool vIPT::importIntrinsics(int cam, Bottle &parameters)

then if verbose = true you can print the calibration parameters read.

by the way there are the functions

void vIPT::showMonoProjections(int cam, double seconds)
that show the projections based on the parameters, that can be useful to "debug" the calibration is correct.

can we add these changes to this pull request please?

@lunagava
Copy link
Contributor Author

@arrenglover, I've just pushed the changes you required. Let me know, if they are okay.

@arrenglover
Copy link
Collaborator

sorry I think you misunderstood. I think we should make the function like:
bool vIPT::importIntrinsics(int cam, Bottle &parameters, bool verbose = false)

then inside the function

if(verbose) {
 yInfo() << parameters.getContent().toString();
}

we don't need to pass the resources find into the importIntrinsics function because the parameters argument is already the extracted parameters.

we should also do the same thing for the importStereo function to display the stereo values.

@lunagava
Copy link
Contributor Author

Sorry @arrenglover, I misunderstood. I've just corrected the code according to what you said, also adding stereo printing. Tell me if it is finally okay.

@arrenglover
Copy link
Collaborator

@lunagava - please check you can find the calibration file using
--camera_calibration_file <path>
The found camera parameters are now output to the terminal using the default opencv Mat printing funciton. Is it okay for you?

@lunagava
Copy link
Contributor Author

@arrenglover Well done Arren, I've just tried to pass the calibration file path and it has worked. In my opinion, the printing is well-organized now.

/usr/local/src/event-driven/cmake-build-debug/bin/vPreProcess --undistort true --camera_calibration_file /usr/local/share/event-driven/contexts/camera/atis_calib.ini --flipx true --flipy true --filter_spatial true --filter_temporal true --sf_tsize 0.05 -split_stereo true --combined_stereo false
[INFO] Flipping vision horizontally
[INFO] Flipping vision vertically
[INFO] Applying spatial "salt and pepper" filter
[INFO] Applying temporal "refractory" filter
[INFO] Applying camera undistortion
[INFO] Splitting into left/right streams
[INFO] Camera 0 and Camera 1 is and Extrinsic parameters exist - creating rectified transforms
[INFO] Printing non-empty intrinsic and extrinsic parameters:
[INFO] size_cam[0]
[304 x 240]
[INFO] cam_matrix[0]
[192.578, 0, 151.638;
 0, 192.318, 113.121;
 0, 0, 1]
[INFO] dist_coeff[0]
[-0.294963;
 0.0771249;
 -0.0006767709999999999;
 0.00170161]
[INFO] size_cam[1]
[304 x 240]
[INFO] cam_matrix[1]
[177.611, 0, 150.974;
 0, 177.935, 113.802;
 0, 0, 1]
[INFO] dist_coeff[1]
[-0.333412;
 0.122394;
 0.00245141;
 0.000201785]
[INFO] stereo_translation
[-0.07308729999999999;
 0.00079387;
 -0.00796638]
[INFO] stereo_rotation
[0.996733, 0.00941561, -0.0802102;
 -0.00669509, 0.999395, 0.0341191;
 0.080483, -0.0334706, 0.996194]
[INFO] |yarp.os.Port| Port /vPreProcess/left:o active at tcp://172.17.0.2:10002/
[INFO] |yarp.os.Port| Port /vPreProcess/right:o active at tcp://172.17.0.2:10003/
[INFO] |yarp.os.Port| Port /vPreProcess/aps_left:o active at tcp://172.17.0.2:10004/
[INFO] |yarp.os.Port| Port /vPreProcess/aps_right:o active at tcp://172.17.0.2:10005/
[INFO] |yarp.os.Port| Port /vPreProcess/imu_samples:o active at tcp://172.17.0.2:10006/
[INFO] |yarp.os.Port| Port /vPreProcess/audio:o active at tcp://172.17.0.2:10007/
[INFO] |yarp.os.Port| Port /vPreProcess/skin:o active at tcp://172.17.0.2:10008/
[INFO] |yarp.os.Port| Port /vPreProcess/skin_samples:o active at tcp://172.17.0.2:10009/
[INFO] |yarp.os.Port| Port /vPreProcess/AE:i active at tcp://172.17.0.2:10010/
[INFO] |yarp.os.Port| Port /vPreProcess/rate:o active at tcp://172.17.0.2:10011/

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.

2 participants