Skip to content

Commit ae5868b

Browse files
committed
Fix segfaults
1 parent a3bde50 commit ae5868b

3 files changed

Lines changed: 1 addition & 10 deletions

File tree

src/extract/extract_image.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ namespace
1717
{
1818
cv::Mat load_image(const std::string &path)
1919
{
20-
if (cv::getNumThreads() != 1)
21-
{
22-
cv::setNumThreads(1);
23-
}
24-
2520
return cv::imread(path); //, cv::IMREAD_IGNORE_ORIENTATION | cv::IMREAD_COLOR);
2621
}
2722
} // namespace

src/ortho/image_cache.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ cv::Mat FullResolutionImageCache::getImage(size_t node_id, const std::string &pa
3434
cache_misses_++;
3535
lock.unlock();
3636

37-
if (cv::getNumThreads() != 1)
38-
{
39-
cv::setNumThreads(1);
40-
}
41-
4237
cv::Mat image = cv::imread(path);
4338

4439
lock.lock();

src/pipeline/pipeline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct Pipeline::Impl : public usm::StateMachine<PipelineState, PipelineTransiti
116116
link_stage(new LinkStage()), relax_stage(new RelaxStage()), step_callback([](const StepCompletionInfo &) {}),
117117
batch_size(batch_size_), parallelism(parallelism_ == 0 ? omp_get_num_procs() : parallelism_)
118118
{
119+
cv::setNumThreads(1);
119120
}
120121

121122
PipelineState chooseNextState(PipelineState currentState, Transition transition) override;

0 commit comments

Comments
 (0)