1 | initial version |
The NoIR is just a color camera with the IR cut filter removed. You can add the included filter (that dark blue film) to cut most of the visible light. Than just convert the grabbed image to grayscale to get an approximation of the IR light.
Then just apply the NDVI formula pixel by pixel:
redp = color.at<Vec3b>(y,x)[0];
irp = ir.at<uchar>(y,x);
ndvi.at<double>(y,x) = (irp - redp) / (irp + redp + 0.001); //the 0.001 is to avoid the div/0
Anyway, the problem is that these cameras are not calibrated. You are combining two images that don't have the same exposure. Worse, you don't know the IR sensitivity of the camera compared to the visible sensitivity. So this setup is good to play with, but won't give you a reliable NDVI index.
2 | No.2 Revision |
The NoIR is just a color camera with the IR cut filter removed. You can add the included filter (that dark blue film) to cut most of the visible light. Than just convert the grabbed image to grayscale to get an approximation of the IR light.
Then just apply the NDVI formula pixel by pixel:pixel (untested code):
redp = color.at<Vec3b>(y,x)[0];
irp = ir.at<uchar>(y,x);
ndvi.at<double>(y,x) = (irp - redp) / (irp + redp + 0.001); //the 0.001 is to avoid the div/0
Anyway, the problem is that these cameras are not calibrated. You are combining two images that don't have the same exposure. Worse, you don't know the IR sensitivity of the camera compared to the visible sensitivity. So this setup is good to play with, but won't give you a reliable NDVI index.
3 | No.3 Revision |
The NoIR is just a color camera with the IR cut filter removed. removed(so it will capture visible+infrared light). You can add the included filter (that dark blue film) to cut most of the visible light. Than just convert the grabbed image to grayscale to get an approximation of the IR light.
Then just apply the NDVI formula pixel by pixel (untested code):
redp = color.at<Vec3b>(y,x)[0];
irp = ir.at<uchar>(y,x);
ndvi.at<double>(y,x) = (irp - redp) / (irp + redp + 0.001); //the 0.001 is to avoid the div/0
Anyway, the problem is that these cameras are not calibrated. You are combining two images that don't have the same exposure. Worse, you don't know the IR sensitivity of the camera compared to the visible sensitivity. The visible cut filter is also a cheap film, so don't expect perfect results (a good quality visible cut filter is totally black). So this setup is good to play with, but won't give you a reliable NDVI index.