Bioinspired - Retinex Algorithm
While running the bioinspired retinex algorithm, I get the Magno and Parvo output, but for some images, I dont get the magno and parvo output. For me it is completely random. I would need some help on the same. Maybe I am missing out on something
std::string _path = "183816031218.jpg";
cv::Mat source = cv::imread(_path);
std::cout << "Size of input image " << source.size() << std::endl;
//cv::resize(source, source, cv::Size(), 0.5, 0.5, cv::INTER_LINEAR);
cv::imshow("Initial Image", source);
cv::waitKey(0);
cv::destroyAllWindows();
//applying retinex algorithm
// allocate a retina instance with input size equal to the one of the loaded image
cv::Ptr<cv::bioinspired::Retina> myRetina = cv::bioinspired::createRetina(source.size());
/* retina parameters management methods use sample
-> save current (here default) retina parameters to a xml file (you may use it only one time to get the file and modify it)
*/
//myRetina->write("RetinaDefaultParameters.xml");
// -> load parameters if file exists
//myRetina->setup("RetinaSpecificParameters.xml");
// reset all retina buffers (open your eyes)
myRetina->clearBuffers();
// declare retina output buffers
cv::Mat retinaOutput_parvo;
cv::Mat retinaOutput_magno;
//main processing loop
// run retina on the input image
myRetina->run(source);
// grab retina outputs
myRetina->getParvo(retinaOutput_parvo);
myRetina->getMagno(retinaOutput_magno);
// draw retina outputs
cv::imshow("retina input", source);
cv::imshow("Retina Parvo", retinaOutput_parvo);
cv::imshow("Retina Magno", retinaOutput_magno);
cv::waitKey(0);
I am literally just coying and editing the sample code from the opencv link.
I would appreciate some help here. Thankyou.
" I dont get the magno and parvo output." -- what does it mean ?
do you have an example image, where it "fails" ?
@berak, they are the outputs for this algorithm.
myRetina->getParvo(retinaOutput_parvo); myRetina->getMagno(retinaOutput_magno);
the images are does_not_workworks
please never just say "does not work" again, when asking for help !
be concise, be explicit, else noone can or will help you !
@berak, That was a description to the image name, I just wanted to mention that, with that image(does_not_work) the algorithm gives a blank output, while with the image(works) I get the correct parvo and magno outputs. I am sorry for not being descriptive, but I don't know why I am not getting the results as expected.
don't worry, all i'm trying is to get you to be more verbose about it !
Does the algorithm have a size restriction, I just resized the image and I was able to get an output. Is there a reason ?
idk., sorry (needs to read the paper, i guess). did you try changing some of the configuration parameters ?
@berak nope, I used the realistic parameters used in opencv example. I should try changing the parameters.