-
Notifications
You must be signed in to change notification settings - Fork 230
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
Conversation
There was a problem hiding this 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.
modules/ocl/cl_image_360_stitch.cpp
Outdated
@@ -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); | |||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
modules/ocl/feature_match.h
Outdated
#include <ocl/cl_memory.h> | ||
|
||
#include <opencv2/opencv.hpp> | ||
#include <opencv2/core/ocl.hpp> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
modules/ocl/feature_match.h
Outdated
}; | ||
|
||
class FeatureMatch | ||
: public CVBaseClass |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
modules/ocl/feature_match.h
Outdated
@@ -0,0 +1,100 @@ | |||
/* | |||
* cv_feature_match.h - optical flow feature match |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature_match.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified.
update the pr according to comments, please help review, thanks. |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
modified, please help review. Thanks. |
looks good to me. |
fixed #474 and also work for AOSP. |
No description provided.