Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Accept portrait imagery/video as input #132

Merged
merged 4 commits into from
Oct 13, 2019
Merged

Accept portrait imagery/video as input #132

merged 4 commits into from
Oct 13, 2019

Conversation

MikiyaShibuya
Copy link
Collaborator

Fix the crash when the portrait images or videos are feed.

When any portrait images are given as input, the orb feature extractor made crashes due to only landscape imagery input are assumed.
In order to fix the problem, I make some additional processes to accept the portrait images or videos.

Copy link
Collaborator

@shinsumicco shinsumicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the nice code and the PR.
Would you check some comments?

Comment on lines 492 to 496
// If the aspect ratio is less than 1, the patches are made in a vertical direction
num_x_grid = 1;
num_y_grid = std::round(1 / ratio);
delta_x = max_x - min_y;
delta_y = static_cast<double>(max_y - min_y) / num_y_grid;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scope seems to be processed when the aspect ratio is equal to or less than 1.
Could you modify the comment?

@@ -500,7 +524,12 @@ std::list<orb_extractor_node> orb_extractor::initialize_nodes(const std::vector<

// Assign all keypoints to initial nodes which own keypoint's position
for (const auto& keypt : keypts_to_distribute) {
initial_nodes.at(keypt.pt.x / delta_x)->keypts_.push_back(keypt);
// x / y index of the patch where the keypt place
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the keypt place" -> "the keypt is placed" ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still run failed

@fangxu622
Copy link

hi ,I changed the code according to your change, but it still runs failed on portrait imagery/video

@shinsumicco
Copy link
Collaborator

shinsumicco commented Oct 10, 2019

@fangxu622
Could you tell us the more details?
(error message, stack trace, image size, etc.)

@MikiyaShibuya
Is there something for this?

@shinsumicco shinsumicco added the bug Something isn't working label Oct 10, 2019
@fangxu622
Copy link

fangxu622 commented Oct 11, 2019

@fangxu622
Could you tell us the more details?
(error message, stack trace, image size, etc.)

@MikiyaShibuya
Is there something for this?

I‘m sorry for late., the error message like this , when the portrait imagery appears on the video

[2019-10-11 20:42:13.300] [I] loading ORB vocabulary: /media/fangxu/Segate3T/Linux-Proj/SLAM/openv-slam/vslam-data/orb_vocab/orb_vocab.dbow2
[2019-10-11 20:42:14.471] [I] startup SLAM system
[2019-10-11 20:42:14.472] [I] start mapping module
[2019-10-11 20:42:14.472] [I] start global optimization module
*** Aborted at 1570797746 (unix time) try "date -d @1570797746" if you are using GNU date ***
PC: @     0x7f76cf06742e Eigen::JacobiSVD<>::compute()
*** SIGSEGV (@0x0) received by PID 4811 (TID 0x7f7609fff700) from PID 0; stack trace: ***
    @     0x7f76cc1b84b0 (unknown)
    @     0x7f76cf06742e Eigen::JacobiSVD<>::compute()
    @     0x7f76cf04d1ed openvslam::solve::homography_solver::compute_H_21()
    @     0x7f76cf04e8be openvslam::solve::homography_solver::find_via_ransac()
    @     0x7f76cc81bc80 (unknown)
    @     0x7f76cec686ba start_thread
    @     0x7f76cc28a41d clone
    @                0x0 (unknown)
段错误 (核心已转储)

the image size
Camera.cols: 2704
Camera.rows: 2028
image

@shinsumicco
Copy link
Collaborator

@fangxu622
Thank you for posting the error message.
The image you uploaded is landscape (cols > rows), isn't it?
The error message seems to be caused by not the feature extractor but the homography solver.
Could you create the new issue about it?

@shinsumicco
Copy link
Collaborator

According to #124, I conclude that the problem the feature extractor could not accept portrait imagery has been solved.
Thanks @MikiyaShibuya and @pouyaAB.

@shinsumicco shinsumicco merged commit 8a3ec4f into xdspacelab:develop Oct 13, 2019
@fangxu622
Copy link

@fangxu622
Thank you for posting the error message.
The image you uploaded is landscape (cols > rows), isn't it?
The error message seems to be caused by not the feature extractor but the homography solver.
Could you create a new issue about it?

@shinsumicco @MikiyaShibuya Hi , Sorry , My video data have some bug that was resulted in this bug. It's my problem

@MikiyaShibuya MikiyaShibuya deleted the portrait-image branch December 24, 2019 11:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants