Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
78a0b978
Commit
78a0b978
authored
Oct 15, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed build errors on Mac; moved test for #2332 from imgproc to highgui
parent
460644b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
26 deletions
+30
-26
parallel.cpp
modules/core/src/parallel.cpp
+2
-1
test_grfmt.cpp
modules/highgui/test/test_grfmt.cpp
+28
-0
test_color.cpp
modules/imgproc/test/test_color.cpp
+0
-25
No files found.
modules/core/src/parallel.cpp
View file @
78a0b978
...
...
@@ -85,6 +85,7 @@
#include <omp.h>
#elif defined HAVE_GCD
#include <dispatch/dispatch.h>
#include <sys/sysctl.h>
#include <pthread.h>
#elif defined HAVE_CONCURRENCY
#include <ppl.h>
...
...
@@ -371,7 +372,7 @@ int cv::getThreadNum(void)
#elif defined HAVE_OPENMP
return
omp_get_thread_num
();
#elif defined HAVE_GCD
return
statc_cast
<
int
>
(
pthread_self
()
);
// no zero-based indexing
return
(
int
)(
size_t
)(
void
*
)
pthread_self
(
);
// no zero-based indexing
#elif defined HAVE_CONCURRENCY
return
std
::
max
(
0
,
(
int
)
Concurrency
::
Context
::
VirtualProcessorId
());
// zero for master thread, unique number for others but not necessary 1,2,3,...
#else
...
...
modules/highgui/test/test_grfmt.cpp
View file @
78a0b978
...
...
@@ -255,3 +255,31 @@ public:
TEST
(
Highgui_Image
,
encode_png
)
{
CV_GrfmtPNGEncodeTest
test
;
test
.
safe_run
();
}
#endif
#ifdef HAVE_JPEG
TEST
(
Highgui_ImreadVSCvtColor
,
regression
)
{
cvtest
::
TS
&
ts
=
*
cvtest
::
TS
::
ptr
();
const
int
MAX_MEAN_DIFF
=
3
;
const
int
MAX_ABS_DIFF
=
10
;
string
imgName
=
string
(
ts
.
get_data_path
())
+
"/../cv/shared/lena.jpg"
;
Mat
original_image
=
imread
(
imgName
);
Mat
gray_by_codec
=
imread
(
imgName
,
0
);
Mat
gray_by_cvt
;
cvtColor
(
original_image
,
gray_by_cvt
,
CV_BGR2GRAY
);
Mat
diff
;
absdiff
(
gray_by_codec
,
gray_by_cvt
,
diff
);
double
actual_avg_diff
=
(
double
)
mean
(
diff
)[
0
];
double
actual_maxval
,
actual_minval
;
minMaxLoc
(
diff
,
&
actual_minval
,
&
actual_maxval
);
EXPECT_LT
(
actual_avg_diff
,
MAX_MEAN_DIFF
);
EXPECT_LT
(
actual_maxval
,
MAX_ABS_DIFF
);
}
#endif
modules/imgproc/test/test_color.cpp
View file @
78a0b978
...
...
@@ -1683,31 +1683,6 @@ TEST(Imgproc_ColorLuv, accuracy) { CV_ColorLuvTest test; test.safe_run(); }
TEST
(
Imgproc_ColorRGB
,
accuracy
)
{
CV_ColorRGBTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_ColorBayer
,
accuracy
)
{
CV_ColorBayerTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_ImreadVSCvtColor
,
regression
)
{
cvtest
::
TS
&
ts
=
*
cvtest
::
TS
::
ptr
();
const
int
MAX_MEAN_DIFF
=
3
;
const
int
MAX_ABS_DIFF
=
10
;
string
imgName
=
string
(
ts
.
get_data_path
())
+
"/shared/lena.jpg"
;
Mat
original_image
=
imread
(
imgName
);
Mat
gray_by_codec
=
imread
(
imgName
,
0
);
Mat
gray_by_cvt
;
cvtColor
(
original_image
,
gray_by_cvt
,
CV_BGR2GRAY
);
Mat
diff
;
absdiff
(
gray_by_codec
,
gray_by_cvt
,
diff
);
double
actual_avg_diff
=
(
double
)
sum
(
diff
)[
0
]
/
countNonZero
(
diff
);
double
actual_maxval
,
actual_minval
;
minMaxLoc
(
diff
,
&
actual_minval
,
&
actual_maxval
);
EXPECT_LT
(
actual_avg_diff
,
MAX_MEAN_DIFF
);
EXPECT_LT
(
actual_maxval
,
MAX_ABS_DIFF
);
}
TEST
(
Imgproc_ColorBayer
,
regression
)
{
cvtest
::
TS
&
ts
=
*
cvtest
::
TS
::
ptr
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment