fix bugs in x86-intel.

This commit is contained in:
Daniel 2024-02-21 10:08:57 +08:00
commit 29a2d9abf5
3 changed files with 9 additions and 3 deletions

View File

@ -32,7 +32,7 @@ CameraAlgorithm::CameraAlgorithm()
// this->_allocator = NULL; // this->_allocator = NULL;
this->_t0 = std::chrono::system_clock::now(); this->_t0 = std::chrono::system_clock::now();
this->alg_params_fn = _get_home() + SV_ROOT_DIR + "params/a-params/sv_algorithm_params.json"; this->alg_params_fn = _get_home() + SV_ROOT_DIR + "confs/sv_algorithm_params.json";
// std::cout << "CameraAlgorithm->alg_params_fn: " << this->alg_params_fn << std::endl; // std::cout << "CameraAlgorithm->alg_params_fn: " << this->alg_params_fn << std::endl;
// if (_is_file_exist(params_fn)) // if (_is_file_exist(params_fn))
// this->loadAlgorithmParams(params_fn); // this->loadAlgorithmParams(params_fn);

View File

@ -9,6 +9,8 @@ root_url = "https://download.amovlab.com/model/SpireCV-models/"
model_list_url = root_url + "model-list.txt" model_list_url = root_url + "model-list.txt"
root_path = os.path.expanduser("~") + "/SpireCV/models" root_path = os.path.expanduser("~") + "/SpireCV/models"
print("MODEL PATH:", root_path) print("MODEL PATH:", root_path)
if not os.path.exists(root_path):
os.makedirs(root_path)
list_file = os.path.join(root_path, "model-list.txt") list_file = os.path.join(root_path, "model-list.txt")

View File

@ -1173,6 +1173,7 @@ void CameraBase::openImpl()
} }
void CameraBase::open(CameraType type, int id) void CameraBase::open(CameraType type, int id)
{ {
this->release();
this->_type = type; this->_type = type;
this->_camera_id = id; this->_camera_id = id;
@ -1215,7 +1216,7 @@ bool CameraBase::read(cv::Mat& image)
this->_is_updated = false; this->_is_updated = false;
break; break;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(20)); std::this_thread::sleep_for(std::chrono::milliseconds(2));
n_try ++; n_try ++;
} }
} }
@ -1227,7 +1228,10 @@ bool CameraBase::read(cv::Mat& image)
} }
void CameraBase::release() void CameraBase::release()
{ {
_cap.release(); this->_is_running = false;
this->_is_updated = false;
if (this->_cap.isOpened())
this->_cap.release();
} }