Skip to content

Commit

Permalink
fix: convert to single channel image before feeding into Canny (Kuren…
Browse files Browse the repository at this point in the history
…to#1)

Co-authored-by: Chen Wei <[email protected]>
  • Loading branch information
anti-destiny and Chen Wei authored Nov 12, 2020
1 parent 5952590 commit 66c0418
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gst-plugins/kmssamplefilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ kms_sample_filter_transform_frame_ip (GstVideoFilter *filter,

if (filter_type == KMS_SAMPLE_FILTER_TYPE_EDGES) {
GST_DEBUG ( "Calculating edges");
Canny ( (*sample_filter->priv->cv_image), output_image,
edge_threshold, 255);
Mat gray_image;
cvtColor ( (*sample_filter->priv->cv_image), gray_image, COLOR_BGR2GRAY);
Canny (gray_image, output_image, edge_threshold, 255);
} else if (filter_type == KMS_SAMPLE_FILTER_TYPE_GREY) {
GST_DEBUG ( "Calculating black&white image");
cvtColor ( (*sample_filter->priv->cv_image), output_image, COLOR_BGR2GRAY );
Expand Down

0 comments on commit 66c0418

Please sign in to comment.