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

cl-stitch: feature match support opencv capi #495

Merged
merged 1 commit into from
Oct 25, 2017
Merged

Conversation

zongwave
Copy link
Collaborator

No description provided.

Copy link
Contributor

@windyuan windyuan left a comment

Choose a reason for hiding this comment

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

please see comments.
others look good to me.

@@ -738,8 +738,11 @@ CLImage360Stitch::sub_handler_execute_done (SmartPtr<CLImageHandler> &handler)
convert_to_cv_rect (_img_merge_info[i].right, crop_left);
convert_to_cv_rect (_img_merge_info[idx_next].left, crop_right);

Copy link
Contributor

Choose a reason for hiding this comment

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

crop_left/crop_right is not useful any more. please remove them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

modified function convert_to_cv_rect, please help review.

#include <ocl/cl_memory.h>

#include <opencv2/opencv.hpp>
#include <opencv2/core/ocl.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

Move all opencv headers to cv_feature_match and cv_capi_feature_match.
and cv_base_class should be only used in cv_feature_match.
ocl/cl_xxx.h should be removed here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed.

};

class FeatureMatch
: public CVBaseClass
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to derive from CVBaseClass.
cv_capi_feature_match doesn't need CVBaseClass.
FeatureMatch is only like a interface for other features.
CVFeatureMatch can derive from both FeatureMatch and CVBaseClass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

@@ -0,0 +1,100 @@
/*
* cv_feature_match.h - optical flow feature match
Copy link
Contributor

Choose a reason for hiding this comment

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

feature_match.h

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

modified.

@zongwave
Copy link
Collaborator Author

update the pr according to comments, please help review, thanks.

Copy link
Contributor

@windyuan windyuan left a comment

Choose a reason for hiding this comment

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

used stride instead of width.

VideoBufferInfo info = buffer->get_video_info ();

uint8_t* image_buffer = buffer->map();
int offset = info.width * crop_rect.pos_y + crop_rect.pos_x;
Copy link
Contributor

Choose a reason for hiding this comment

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

pointer access need use stride instead of width.

crop_image.resize (crop_rect.width * crop_rect.height);
for (int i = 0; i < crop_rect.height; i++) {
for (int j = 0; j < crop_rect.width; j++) {
crop_image[i * crop_rect.width + j] = image_buffer[offset + i * info.width + j];
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above. use stride.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed.

@zongwave
Copy link
Collaborator Author

modified, please help review. Thanks.

@windyuan
Copy link
Contributor

looks good to me.

@windyuan windyuan merged commit b0926c3 into intel:master Oct 25, 2017
@windyuan
Copy link
Contributor

fixed #474 and also work for AOSP.

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