1 | initial version |
given, you built the opencv libs with opencv_contrib, something like this should get you started:
#include <opencv2/bioinspired.hpp>
int main() {
cv::Ptr<cv::bioinspired::Retina> retina;
retina = cv::bioinspired::createRetina(cv::Size(60,60)); // expected image size
bioinspired::RetinaParameters ret_params;
ret_params.OPLandIplParvo.horizontalCellsGain = 0.7f;
ret_params.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity = 0.39f;
ret_params.OPLandIplParvo.ganglionCellsSensitivity = 0.39f;
retina->setup(ret_params);
Mat img = .... // input
retina->run(img);
Mat parvo; // output
retina->getParvo(parvo);
retina->clearBuffers(); // if you re-use the retina instance, this is nessecary!
}
2 | No.2 Revision |
given, you built the opencv libs with opencv_contrib, something like this should get you started:
#include <opencv2/bioinspired.hpp>
int main() {
cv::Ptr<cv::bioinspired::Retina> retina;
retina = cv::bioinspired::createRetina(cv::Size(60,60)); cv::bioinspired::Retina::create(cv::Size(60,60)); // expected image size
bioinspired::RetinaParameters ret_params;
ret_params.OPLandIplParvo.horizontalCellsGain = 0.7f;
ret_params.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity = 0.39f;
ret_params.OPLandIplParvo.ganglionCellsSensitivity = 0.39f;
retina->setup(ret_params);
Mat img = .... // input
retina->run(img);
Mat parvo; // output
retina->getParvo(parvo);
retina->clearBuffers(); // if you re-use the retina instance, this is nessecary!
}
3 | No.3 Revision |
given, you built the opencv libs with opencv_contrib, something like this should get you started:
#include <opencv2/bioinspired.hpp>
int main() {
cv::Ptr<cv::bioinspired::Retina> retina;
retina = cv::bioinspired::Retina::create(cv::Size(60,60)); // expected image size
bioinspired::RetinaParameters ret_params;
ret_params.OPLandIplParvo.horizontalCellsGain = 0.7f;
ret_params.OPLandIplParvo.photoreceptorsLocalAdaptationSensitivity = 0.39f;
ret_params.OPLandIplParvo.ganglionCellsSensitivity = 0.39f;
retina->setup(ret_params);
Mat img = .... // input
retina->run(img);
Mat parvo; // output
retina->getParvo(parvo);
retina->clearBuffers(); // if you re-use the retina instance, this is nessecary!
}