Ask Your Question

Revision history [back]

click to hide/show revision 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!
}

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!
}

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!
}