Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Recent HAL changes ported to 4.9#26395

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
savuor wants to merge15 commits intoopencv:4.xfromsavuor:rv/fastcv_hal_4.9
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
67fe2ba
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
asmorkalovJun 27, 2024
e8cc13c
Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
asmorkalovJun 27, 2024
b25db18
Relax equalizeHist test for some HAL implementations.
asmorkalovJun 27, 2024
e5f2be8
Use Carotene implementation of TEGRA_GaussianBlurBinomial 3x3 and 5x5…
asmorkalovJun 20, 2024
153a50a
Merge pull request #25792 from asmorkalov:as/HAL_fast_GaussianBlur
asmorkalovJul 12, 2024
e376ee7
Merge pull request #25936 from savuor:rv/hal_dot
savuorJul 23, 2024
ff8afe8
Report used HAL to test log and xml
asmorkalovJul 23, 2024
2f6c235
Merge pull request #25970 from savuor:rv/hal_pyrdown
savuorAug 6, 2024
a242431
Got rid of CAROTENE_NEON_ARCH and use standard __ARM_ARCH check.
asmorkalovAug 30, 2024
14e4be0
Merge pull request #26080 from asmorkalov:as/HAL_minMaxIdx_ND_offset
asmorkalovAug 30, 2024
a8f2b2b
Excluded nullptr leak to arithmetic HAL got from empty Mat.
asmorkalovSep 6, 2024
5a2e561
Merge pull request #26143 from asmorkalov:as/HAL_opticalFlowLK
asmorkalovSep 16, 2024
ba340ee
Merge pull request #26163 from asmorkalov:as/HAL_schaar_deriv
asmorkalovSep 23, 2024
5ee4f59
OpenCV Acceleration with FastCV HAL changes
sssanjee-quicOct 16, 2024
6f907fb
Fastcv HAL changes for Opencv Acceleration
sssanjee-quicOct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Merge pull request#25970 from savuor:rv/hal_pyrdown
pyrDown: offset HAL added, IPP removed#25970Resolves#25976### Changes* HAL added for offset support so that border pixels can be fetched from outside of the image ROI (see `BORDER_ISOLATED` parameter)* IPP removed since there is `pyrUp` instead of `pyrDown` and there's no easy way to fix this other than rewriting it from scratch* replaced old C call by modern `cv::pyrDown`### Pull Request Readiness ChecklistSee details athttps://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- [ ] 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
  • Loading branch information
@savuor
savuor authored andRostislav Vasilikhin committedNov 1, 2024
commit2f6c2359ac10a2becdb9dedb16b532051b834711
27 changes: 27 additions & 0 deletionsmodules/imgproc/src/hal_replacement.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -932,6 +932,33 @@ inline int hal_ni_pyrdown(const uchar* src_data, size_t src_step, int src_width,
#define cv_hal_pyrdown hal_ni_pyrdown
//! @endcond

/**
@brief Perform Gaussian Blur and downsampling for input tile with optional margins for submatrix
@param src_data Source image data
@param src_step Source image step
@param src_width Source image width
@param src_height Source image height
@param dst_data Destination image data
@param dst_step Destination image step
@param dst_width Destination image width
@param dst_height Destination image height
@param depth Depths of source and destination image
@param cn Number of channels
@param margin_left Left margins for source image
@param margin_top Top margins for source image
@param margin_right Right margins for source image
@param margin_bottom Bottom margins for source image
@param border_type Border type
*/
inline int hal_ni_pyrdown_offset(const uchar* src_data, size_t src_step, int src_width, int src_height,
uchar* dst_data, size_t dst_step, int dst_width, int dst_height,
int depth, int cn, int margin_left, int margin_top, int margin_right, int margin_bottom, int border_type)
{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }

//! @cond IGNORED
#define cv_hal_pyrdown_offset hal_ni_pyrdown_offset
//! @endcond

/**
@brief Canny edge detector
@param src_data Source image data
Expand Down
85 changes: 13 additions & 72 deletionsmodules/imgproc/src/pyramids.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1266,69 +1266,6 @@ static bool ocl_pyrUp( InputArray _src, OutputArray _dst, const Size& _dsz, int

}

#if defined(HAVE_IPP)
namespace cv
{
static bool ipp_pyrdown( InputArray _src, OutputArray _dst, const Size& _dsz, int borderType )
{
CV_INSTRUMENT_REGION_IPP();

#if IPP_VERSION_X100 >= 810 && !IPP_DISABLE_PYRAMIDS_DOWN
Size dsz = _dsz.empty() ? Size((_src.cols() + 1)/2, (_src.rows() + 1)/2) : _dsz;
bool isolated = (borderType & BORDER_ISOLATED) != 0;
int borderTypeNI = borderType & ~BORDER_ISOLATED;

Mat src = _src.getMat();
_dst.create( dsz, src.type() );
Mat dst = _dst.getMat();
int depth = src.depth();


{
bool isolated = (borderType & BORDER_ISOLATED) != 0;
int borderTypeNI = borderType & ~BORDER_ISOLATED;
if (borderTypeNI == BORDER_DEFAULT && (!src.isSubmatrix() || isolated) && dsz == Size(src.cols*2, src.rows*2))
{
typedef IppStatus (CV_STDCALL * ippiPyrUp)(const void* pSrc, int srcStep, void* pDst, int dstStep, IppiSize srcRoi, Ipp8u* buffer);
int type = src.type();
CV_SUPPRESS_DEPRECATED_START
ippiPyrUp pyrUpFunc = type == CV_8UC1 ? (ippiPyrUp) ippiPyrUp_Gauss5x5_8u_C1R :
type == CV_8UC3 ? (ippiPyrUp) ippiPyrUp_Gauss5x5_8u_C3R :
type == CV_32FC1 ? (ippiPyrUp) ippiPyrUp_Gauss5x5_32f_C1R :
type == CV_32FC3 ? (ippiPyrUp) ippiPyrUp_Gauss5x5_32f_C3R : 0;
CV_SUPPRESS_DEPRECATED_END

if (pyrUpFunc)
{
int bufferSize;
IppiSize srcRoi = { src.cols, src.rows };
IppDataType dataType = depth == CV_8U ? ipp8u : ipp32f;
CV_SUPPRESS_DEPRECATED_START
IppStatus ok = ippiPyrUpGetBufSize_Gauss5x5(srcRoi.width, dataType, src.channels(), &bufferSize);
CV_SUPPRESS_DEPRECATED_END
if (ok >= 0)
{
Ipp8u* buffer = ippsMalloc_8u_L(bufferSize);
ok = pyrUpFunc(src.data, (int) src.step, dst.data, (int) dst.step, srcRoi, buffer);
ippsFree(buffer);

if (ok >= 0)
{
CV_IMPL_ADD(CV_IMPL_IPP);
return true;
}
}
}
}
}
#else
CV_UNUSED(_src); CV_UNUSED(_dst); CV_UNUSED(_dsz); CV_UNUSED(borderType);
#endif
return false;
}
}
#endif

#ifdef HAVE_OPENVX
namespace cv
{
Expand DownExpand Up@@ -1426,15 +1363,19 @@ void cv::pyrDown( InputArray _src, OutputArray _dst, const Size& _dsz, int borde
Mat dst = _dst.getMat();
int depth = src.depth();

CALL_HAL(pyrDown, cv_hal_pyrdown, src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, depth, src.channels(), borderType);

#ifdef HAVE_IPP
bool isolated = (borderType & BORDER_ISOLATED) != 0;
int borderTypeNI = borderType & ~BORDER_ISOLATED;
#endif
CV_IPP_RUN(borderTypeNI == BORDER_DEFAULT && (!_src.isSubmatrix() || isolated) && dsz == Size((_src.cols() + 1)/2, (_src.rows() + 1)/2),
ipp_pyrdown( _src, _dst, _dsz, borderType));

if(src.isSubmatrix() && !(borderType & BORDER_ISOLATED))
{
Point ofs;
Size wsz(src.cols, src.rows);
src.locateROI( wsz, ofs );
CALL_HAL(pyrDown, cv_hal_pyrdown_offset, src.data, src.step, src.cols, src.rows,
dst.data, dst.step, dst.cols, dst.rows, depth, src.channels(),
ofs.x, ofs.y, wsz.width - src.cols - ofs.x, wsz.height - src.rows - ofs.y, borderType & (~BORDER_ISOLATED));
}
else
{
CALL_HAL(pyrDown, cv_hal_pyrdown, src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, depth, src.channels(), borderType);
}

PyrFunc func = 0;
if( depth == CV_8U )
Expand Down
2 changes: 1 addition & 1 deletionmodules/imgproc/test/test_filter.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1193,7 +1193,7 @@ CV_PyramidDownTest::CV_PyramidDownTest() : CV_PyramidBaseTest( true )

void CV_PyramidDownTest::run_func()
{
cvPyrDown( test_array[INPUT][0],test_array[OUTPUT][0], CV_GAUSSIAN_5x5);
cv::pyrDown(test_mat[INPUT][0],test_mat[OUTPUT][0]);
}


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp