Color detection using camera - image-processing

I have three images attached. The vertical Red strips in each image has different redness for different images. There are two strips in each image.
Looks very close, but there is difference and I like to detect redness difference in imaging.
Currently I extract these two red vertical strips in imaging and convert to HSV and look at H channel and S channel.
But the resolution of Redness is not acceptable.
What approach image processing or hardware use better camera model or any approach I use, would it be possible to get better data of redness detection for those vertical strips at images?
Image 1
Image 2
Image 3
Those images are captured by PointGray camera with 2M pixel resolution.
CM3-U3-13S2M-CS

Related

Image size standardisation with scale grid

so I have some images that have some sort of color and scale grid placed inside. The grid sizes used when taking photos are all fixed but their sizes may be different in each image.
The final goal is to feed them into machine learning models.
An example image is shown below:
I wonder how I can automatically resize the images so each grid appears to be of the same size shown?
My thoughts:
Detect the crosses shown in the grid, or the black and white boxes, then find their apparent lengths in the image.
Compute the ratio (actual length)/(apparent length) for each image
Rescale the image with this ratio by multiplying all dimensions with this ratio.
However, there is problem of camera distortion. We cannot simply use one ratio to apply to all parts of the image when there is distortion.
I am also not sure how to detect the crosses, or the black and white boxes within the image and obtain their coordinates. It seems that opencv has a findchessboard function but there isn't one specifically for this type of grids. Maybe I should simply detect corners or boxes? Though how can I make sure the boxes are the ones I want and fetch their metadata for computing lengths?
And how can I do camera calibration here?
Appreciate any guidance!

Thermal and RGB multi view image registration

I have an IR and RGB camera set up such that they are 2cm apart from each other (horizontally).
My goal is to fuse both the images (RGB and IR) to obtain a more informative image. Because of the offset between the RGB and the IR data, both the images do not match. Is there a way to align the images so that they are on the same coordinate system.
I would suggest to perform an edge detection (or something similar to reduce the amount of information in both images), and then to make a wrap of one image onto the other.
If you are using OpenCV, I suggest using findTransformECC() method (doc) to find the transformation matrix needed to get the best overlay between your images.
Than you can warp the second image using this transformation matrix with warpAffine() method (doc).

OpenCV: manipulating different images of the same type to all look the same

I have a large set of images which are cellphone photos taken of driver’s licenses (but this could apply to any type of document). They come in all shapes and sizes, meaning, different angles of the camera, different distances from the camera to the driver’s license, different lighting, etc.
Is there any way in OpenCV to identify in each image a known landmark, then crop, resize, rotate each image so that for the final result, I have a set of images that are completely uniform (e.g. driver’s license fills the whole image, they all look the same, aligned the same, etc)?
Thanks!
One approach (using the functionality available in OpenCV) that I can suggest is to:
Train a Haar Cascade Classifier to recognize the landmark (works quite well for logos)
Take a few rotations of the image and look for the logo in each of them. You should find one or more matches, depending on the number of rotations that you use
Perform edge detection and project the edge pixels to the vertical axis. The projection with largest gaps will represent the spacing between text, and lead you to select one image that is closest to the correct orientation
Now you can crop, zoom or un-zoom this image using the logo position using the known properties of a driving license (logo is so many inches from the top left etc.).
Instead of a Haar cascade classifier, you can also match SIFT features of a logo with that of the photo.
I did not post any code or examples because the question is very broad. But you can easily find OpenCV documentation and examples for each of these steps.
Is there any way in OpenCV to
identify in each image a known landmark: there are several ways to do it, see here: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_table_of_contents_feature2d/py_table_of_contents_feature2d.html
crop: yes, subset it and don't forget to copyTo Select a subset of a Mat and copy them to create a new mat in C++/Opencv
resize, rotate each image so that for the final result, I have a set
of images that are completely uniform: you should use transformations like shown here: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html
this tutorial should be useful for you: https://www.learnopencv.com/homography-examples-using-opencv-python-c/

How to denoise and extract ROI of binarised animal footprint images

I am currently working on an animal identification using footprint recognition project. My main task is to process an animal footprint taken from natural substrate and identify the animal the footprint belongs to. The first step is to preprocess the image and extract the ROI. This is where I am having difficulty as the processed images contain a lot of noise.
I have carried out a series of preprocessing steps all of which did reduce the noise but not sufficiently. The image below shows the outcome I have achieved thus far.
In order of left to right, the first image in the top row is an example of an animal footprint that I need to classify. The second image is one example of an image that will be used to train the system and classify the animal species (in this case a bear species). The third and fourth image in the first row show the grayscale and logarithmic transformation of the test image respectively.
The first image in the bottom row is a median blur of the image, the second shows adaptive thresholding. The third image shows the result of an eight-neighbour connectivity test where any pixel missing a neighbour is removed. The fourth image shows the image when erosion is applied after dilation. The last image shows the detected contours.
I have tried working with the contours to remove contours less than a certain area but it still didn't produce a better representation of the image. Displaying the largest contour just displays the entire image.
Using connected components detects a large number because of the high level of noise. I have tried working with blob detection and again did not achieve the desired results.
Im looking for the best and most efficient way to denoise the images and extract ROI.
Sample image:
One simple and effective way is to open the binary image then close it. Opening would help you with the white dots in the center of the image and closing would fill the undesired black spots in the white areas and finally you would have a neat footprint.
I applied binary threshold and followed it with morphological closing operation.
This is what I obtained:
This is the result of binary thresholding.
This is the result of morphological closing.
You have to do further processing to extract the foot perfectly.
I would suggest applying contour now. It should work fine.

How to convert 3d image to 2d image

How can I convert 3D image to 2D image in order to view it without using a 3D glasses?
Update:
- I have no solution at the moment, but, you know, you can imagine that if you have a 3d image you will wear the glass to your camera and take another image (So, I think that it a physical method to convert from 3d to 2d.
First pass it through Red and Blue filters and get the two separate images(these images will differ in their positions slightly).
Then you need to transform one image through some pixel(which you should determine - you can detect the edges in both the images and find the difference in pixels between their first edge)
This method will help you to get a 2D image.
3d image is actually a pair of images: 1 for left eye, and 1 for right. There are many ways to transfer those from computer to your eyes including magenta/cyan (your case), polarization ( http://en.wikipedia.org/wiki/Polarized_3D_glasses ), animation ( http://en.wikipedia.org/wiki/File:Home_plate_anim.gif ) etc. The point is that 3d is two different images. There is no real way to merge them to one. If you have source images (e.g. separate images for right and lelft) you can just take one of them and that will be your 2d image.
By using relatively straightforward image processing, you can run that source image through a red or blue filter (just like the glasses), to attempt to recover something like the original left or right eye image. You will still end up with two slightly different images, and you may have trouble recovering the original image colours.
Split the image into Red and Green channels. Then use any stereo vision technique to match the red channel and green channel images.

Resources