core: C-API cleanup: RNG algorithms in core(4.x)#26259
core: C-API cleanup: RNG algorithms in core(4.x)#26259asmorkalov merged 3 commits intoopencv:4.xfrom
Conversation
- remove cvRandArr() and cvRandShuffle() - remove CV_RAND_UNI and NORMAL
|
I thought we are trying to preserve old functions and constants in 4.x. @asmorkalov , is it so? |
|
Thank you for your comment. As referencing https://github.com/opencv/opencv/wiki/Opencv4 , we can exclude these functions completely from 4.x branch because they use
And current implementation casts from classical C data (uint64 *) to C++ instance (cv::RNG *) forcefully. I think they are not recommended implementations. CV_IMPL void
cvRandArr( CvRNG* _rng, CvArr* arr, int disttype, CvScalar param1, CvScalar param2 )
{
cv::Mat mat = cv::cvarrToMat(arr);
// !!! this will only work for current 64-bit MWC RNG !!!
cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG(); |
|
@Kumataro Thanks for the contribution. The plan for today is following:
I propose the following steps:
|
|
OK, thank you for your reply !! Currently I have no idea to fix this line. cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG(); |
|
Maybe let's just ignore them: #if defined(__GNUC__) && __GNUC__ == 14
#define CV_IGNORE_CAST_WARNING
#endif
<...>
#ifdef CV_IGNORE_CAST_WARNING
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-user-defined"
#endif
<...>
#ifdef CV_IGNORE_CAST_WARNING
#pragma GCC diagnostic pop
#endif |
There was a problem hiding this comment.
agree with @asmorkalov, the part of the patch with API changes should be done in 5.x branch instead
|
@mshabunin Thank you for your advice, I updated with your suggest and it works well !! |
|
@asmorkalov Thank you very much for merging !! At 5.x branch |
core: C-API cleanup: RNG algorithms in core(4.x) opencv#26259 - replace CV_RAND_UNI and NORMAL to cv::RNG::UNIFORM and cv::RNG::NORMAL. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
core: C-API cleanup: RNG algorithms in core(4.x) opencv#26259 - replace CV_RAND_UNI and NORMAL to cv::RNG::UNIFORM and cv::RNG::NORMAL. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.