Camera Calibrator Matlab - matlab

I'm using the camera corrector application to correct a series of images that have barrel distortion using chessboards.
Following the steps below:
1.I attach the series of photos to be corrected with the different positions of the chessboard, without modifying the position of the camera.
I introduce the size of the different squares that make up the board. And frame that has a high distortion the image to process
enter image description here
I perform the processing of the different photos and press the calibration button
enter image description here
Detect the different points of the chessboard
enter image description here
And I hit the "show undistorted" button. To see the result of the correction.
enter image description here
Apparently the image is corrected. But using a photo correction program, I observed that this is not the case, that there are errors in its correction.
enter image description here
it is observed that the upper right corner is not fully corrected. I have carried out the same procedure with a smaller number of photos, with a different location of the chessboard, etc. I am somewhat confused. What could I do to completely correct the image?
enter image description here

Related

ImageJ : Overlay 2 Images When One is Distorted

I am asking for a step-by-step process with the appropriate plugins (I have been attempting with multipoint and landmark correspondence). Please include images in answer if possible.
I want to overlay two scientific images
The images are not oriented the same due to distortion of the second image from collection at a 45o angle and the object was also at a different orientation (flipped horizontally and slightly rotated)
In Adobe Photoshop I transformed the distorted image to overlay with the
first image by eyeballing the match as you can see below but I am having
difficulty using ImageJ to perform this overlay. I have been told that my
eyeballing method in Adobe Photoshop will not be sufficient for my methods
section of my manuscript and that I must use a scientific program such as
ImageJ.
I tried to follow instructions from the ImageJ forum for Multipoint and Landmark Correspondence but it does not overlay the two images or transform the second image to match the first. Rather, it distorts a portion of the second image and appears to crop the rest out.

Wrong rectification in MATLAB

The rectification function in Matlab seems to be responding wrong. Can anyone let me know if I am getting the right output?
Left Image
Right Image
Anaglyph of unrectified images
Anaglyph of rectified images
Here is my code:
leftImageSnapshot = getsnapshot(handles.vidL);
imshow(leftImageSnapshot);
rightImageSnapshot = getsnapshot(handles.vidR);
imshow(rightImageSnapshot);
[I1Rect,I2Rect]=rectifyStereoImages(I1,I2,stereoParams,'OutputView','valid');
imshowpair(I1Rect,I2Rect,'falsecolor','ColorChannels','red-cyan');
I was following this link for image rectification. After rectification, the images are supposed to look like the cameras are parallel. But in my case, the vertical disparity still exists in the image.
I am trying to obtain a disparity map for which the vertical disparity should be removed.
My best guess would be that your cameras were moved after you did the calibration. Once you calibrate, the position and orientation of the cameras relative to each other cannot change. If it does, your stereoParams are no longer valid.
To see what went wrong, do the calibration again using the Stereo Camera Calibrator app, and then click "Show Rectified" button at the lower left corner of the main image pane. I will show you a rectified pair of calibration images. If those look ok, then your cameras have moved and you have to take the calibration images again and recalibrate. If the rectified calibration images look bad, then something is wrong with your calibration.
By the way, there is a stereoAnaglyph function, which you can use to create a red-cyan anaglyph.

Create Mosaic on image

In image app i have to blur the selected areas of image. Something like create mosaic at selected area of image. i have to get each pixel color of selected area and then increase the size of each pixel. here is the reference link that i am using http://soulwithmobiletechnology.blogspot.in/2011/05/create-mosaic-with-your-image-part-1.html . But not able to implement this practically for selected area. Can any one have some sample for the same.
There are two solutions for this
1. Get the screen shot of the area where you want the mosaic effect and apply effect to the same portion. Then add the image(with mosaic effect) to the original image.
2.Get the pixel of the area you want to be effected and then gave effect to those pixels.*

How to get image coordinates and color data per pixel clicking on a displayed image?

I loaded several PNG files into Matlab and displayed them with no problem but was wondering if there is a way to point (or click) on a pixel and immediately get its pixel coordinates and color (RGB), in real time, either as an output on-screen or stored in some variable.
For example, I have a 64 x 64 face photo to serve as a ground truth image for an eye detection algorithm. The algorithm will return the bounding box for an eye, but, to check it, I want to manually extract coordinates by clicking or mousing around the image as it is plotted, and also color information about the pixels on which I click or mouse.
Please feel free to suggest another language, software, or environment if Matlab does not support such interactivity.
Thank you for your help!
The Data Cursor does exactly what you want:
http://www.mathworks.co.uk/help/matlab/creating_plots/data-cursor-displaying-data-values-interactively.html
It is the icon to the right of the "rotate" icon in the image toolbar.
If you have the Image Processing Toolbox, there is a built in tool called impixel, which will allow you to click on an image and get pixel values and location automatically. There is no data cursor that pops up, but what the data cursor is returning, impixel is also, and you could easily display this with a uicontrol (text).

Matlab user cropped image and then processing

I want to make a program where I have an image and I display it to the user, and the user then crops out the unimportant part, while matlab waits for him to finish. Then the rest of the program is run where the image processing is done on the part of the image that is left.
I found the 'waitfor' function but I am not sure how it is to used in this case. Also will the corresponding matrix be updated with the values of the cropped image?
I think that you need imcrop
It's a matlab tool to crop images. You draw the rectangles, and then you can move it. You double-click to finish.