Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hanliutong
Copy link
Contributor

In the process of evolving Universal intrinsic from "wide" to "scalable", we have widly appended || CV_SIMD_SCALABLE to the macro CV_SIMD. But it seems that we missed two macros in median blur, and this patch fixes this part.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@hanliutong
Copy link
Contributor Author

Performance test on Banana Pi:

Geometric mean (ms)

                    Name of Test                     origin   opt      opt    
                                                                        vs    
                                                                      origin  
                                                                    (x-factor)
medianBlur::Size_MatType_kSize::(127x61, 8UC1, 3)     0.171  0.171     1.00   
medianBlur::Size_MatType_kSize::(127x61, 8UC1, 5)     1.055  0.952     1.11   
medianBlur::Size_MatType_kSize::(127x61, 16UC1, 3)    0.108  0.113     0.96   
medianBlur::Size_MatType_kSize::(127x61, 16UC1, 5)    0.557  0.566     0.98   
medianBlur::Size_MatType_kSize::(127x61, 16SC1, 3)    0.112  0.115     0.97   
medianBlur::Size_MatType_kSize::(127x61, 16SC1, 5)    0.578  0.567     1.02   
medianBlur::Size_MatType_kSize::(127x61, 32FC1, 3)    0.111  0.118     0.94   
medianBlur::Size_MatType_kSize::(127x61, 32FC1, 5)    0.546  0.553     0.99   
medianBlur::Size_MatType_kSize::(127x61, 8UC4, 3)     0.195  0.198     0.99   
medianBlur::Size_MatType_kSize::(127x61, 8UC4, 5)     4.099  1.042     3.93   
medianBlur::Size_MatType_kSize::(320x240, 8UC1, 3)    0.767  0.767     1.00   
medianBlur::Size_MatType_kSize::(320x240, 8UC1, 5)   10.516  4.214     2.50   
medianBlur::Size_MatType_kSize::(320x240, 16UC1, 3)   0.581  0.628     0.93   
medianBlur::Size_MatType_kSize::(320x240, 16UC1, 5)   3.072  3.097     0.99   
medianBlur::Size_MatType_kSize::(320x240, 16SC1, 3)   0.607  0.634     0.96   
medianBlur::Size_MatType_kSize::(320x240, 16SC1, 5)   3.192  3.103     1.03   
medianBlur::Size_MatType_kSize::(320x240, 32FC1, 3)   0.893  0.923     0.97   
medianBlur::Size_MatType_kSize::(320x240, 32FC1, 5)   4.381  4.476     0.98   
medianBlur::Size_MatType_kSize::(320x240, 8UC4, 3)    1.270  1.495     0.85   
medianBlur::Size_MatType_kSize::(320x240, 8UC4, 5)   42.223  6.470     6.53   
medianBlur::Size_MatType_kSize::(640x480, 8UC1, 3)    1.990  1.963     1.01   
medianBlur::Size_MatType_kSize::(640x480, 8UC1, 5)   44.621  9.997     4.46   
medianBlur::Size_MatType_kSize::(640x480, 16UC1, 3)   2.185  2.249     0.97   
medianBlur::Size_MatType_kSize::(640x480, 16UC1, 5)   9.862  10.043    0.98   
medianBlur::Size_MatType_kSize::(640x480, 16SC1, 3)   2.298  2.076     1.11   
medianBlur::Size_MatType_kSize::(640x480, 16SC1, 5)   9.997  10.039    1.00   
medianBlur::Size_MatType_kSize::(640x480, 32FC1, 3)   3.328  3.304     1.01   
medianBlur::Size_MatType_kSize::(640x480, 32FC1, 5)  14.332  14.161    1.01   
medianBlur::Size_MatType_kSize::(640x480, 8UC4, 3)    4.108  4.105     1.00   
medianBlur::Size_MatType_kSize::(640x480, 8UC4, 5)   175.817 17.578   10.00   
medianBlur::Size_MatType_kSize::(1280x720, 8UC1, 3)   4.043  3.933     1.03   
medianBlur::Size_MatType_kSize::(1280x720, 8UC1, 5)  140.930 19.522    7.22   
medianBlur::Size_MatType_kSize::(1280x720, 16UC1, 3)  5.216  5.205     1.00   
medianBlur::Size_MatType_kSize::(1280x720, 16UC1, 5) 22.054  22.955    0.96   
medianBlur::Size_MatType_kSize::(1280x720, 16SC1, 3)  5.272  5.435     0.97   
medianBlur::Size_MatType_kSize::(1280x720, 16SC1, 5) 22.209  23.077    0.96   
medianBlur::Size_MatType_kSize::(1280x720, 32FC1, 3)  8.559  8.181     1.05   
medianBlur::Size_MatType_kSize::(1280x720, 32FC1, 5) 38.173  38.422    0.99   
medianBlur::Size_MatType_kSize::(1280x720, 8UC4, 3)  11.312  11.252    1.01   
medianBlur::Size_MatType_kSize::(1280x720, 8UC4, 5)  565.596 40.840   13.85 

@asmorkalov asmorkalov merged commit 3803eee into opencv:4.x Aug 27, 2024
@hanliutong hanliutong deleted the fix-medianBlur branch August 27, 2024 14:04
@asmorkalov asmorkalov mentioned this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants