I need to install OpenCV 2.4.13 on my Jetson Nano - specific version is implicated by Library that I’ll be using (OSIRIS IRIS 4.1), I would like to install this obsolete version in custom folder, so It will be possible to use newer version for anything else. I’ve installed already OpenCV in version 3.4.3 using mdegans nano script . However it is not working on 2.4.13 version - I am getting similar output to attached below .log files. I’ve tried installing this manually, here’s how i did it:
it clone --depth 1 --branch 2.4.13.6 https://github.com/opencv/opencv.git
cd opencv
mkdir OpenCV-2.4.13.6
cd OpenCV-2.4.13.6
mkdir build
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${HOME}/opencv/OpenCV-2.4.13.6 ..
TL:DR - How to install opencv 2.4.13.6 on jetson nano in custom folder
# avoid a sudo make install (and root owned files in ~) if $PREFIX is writable
if [[ -w ${PREFIX} ]] ; then
make install 2>&1 | tee -a install.log
else
sudo make install 2>&1 | tee -a install.log
fi
Seems the issue is with NPP library. Since CUDA 8.0, NPP was splitted onto 12 separate libraries.
Not sure (and unable to check), but you may try to edit cmake/FindCUDA.cmake and change for libnpp to:
It seems to be more difficult than I thought…OpenCv-2.4 may rely on features from old Linux kernel versions no longer available.
You would better find a ported version of OSIRIS that could be built with opencv4.
I’ve tried to implement this repository, with included test images, but I have encountered significant error that I cannot pass, it is in pirProcessing.cpp → segment() function where it does not seem to be working, part of the code with debug info:
`
//Start Processing
// Locate the pupil
detectPupil(pSrc, rPupil, minPupilDiameter, maxPupilDiameter);
// Fill the holes in an area surrounding pupil
cv::Mat clone_src = pSrc.clone();
// select a ROI
cv::Rect mRoi = cv::Rect(rPupil.getCenter().x - 3.0 / 4.0 * maxIrisDiameter / 2.0,
rPupil.getCenter().y - 3.0 / 4.0*maxIrisDiameter / 2.0,
3.0 / 4.0*maxIrisDiameter,
3.0 / 4.0*maxIrisDiameter);
std::cout << "mRoi: " << mRoi.size() << std::endl;
std::cout << "clone_src: " << clone_src.size() << std::endl;
try
{
cv::Mat clone_src2 = clone_src(mRoi).clone(); // this is source of error
fillWhiteHoles(clone_src2, clone_src2);
clone_src2.copyTo(clone_src(mRoi));
}
catch (const std::exception& e)
{
std::cout << e.what();
}`
My output is as follows:
================
Start processing ...
================
mRoi: 210, [210 x 210]
clone_src: [640 x 480]
OpenCV(4.1.1) /home/nvidia/host/build_opencv/nv_opencv/modules/core/src/matrix.cpp:466: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat'
std::exception
1 0
Cannot normalize image because contours are not correctly computed/loaded
====================
End processing.
====================
To clarify - I’ve been using included images - “1.jpg” and “2.jpg”, with default Gabor filter and image points, is there any chance you might know the answer?
Maybe you’re not using the opencv build that you think. You may further investigate this. Use opencv function cv::getBuildInformation() for details about the running version.
Be sure you’re building iris against correct opencv build and run with the same.