scikit image contour completion - python

I am working with the following image.
My aim is to get the curvature of the outermost circle in the central part of the image.
AFTER CANNY EDGE FILITER
My focus is the concentric circles in the center of the image.
I need to be able to get the radius of curvature of the outermost circle.
I have tried find_contours, but it produces thousands of colored disconnected contours.
Regards,
Richard Madson

Related

Take the image inside a contour and place the irregular contour at a specific location on another image

I have a rotated object (clips for wires for a motherboard)
which I have then used Thresholding and findContours to get the contour of the region of interest (in green). It is an irregular shape which may not always be a rectangle. I know the coordinates I was to place the center of this image on within the section of the motherboard
but do not know how to do this without using bg[y:y+obj_h, x:x+obj_w] = obj, which would assume rectangular shape and would introduce a large noise perimeter surrounding the rotated image. I have tried using transparency around the object, which does not work with cv2. The target goal is this
Any help would be appreciated.

How to draw lines perpendiculr to the circular arcs in OpenCV

In our camera systems, images are collected for operators to examine the surfaces on our parts.
In this example, we need to examine the interior surface of a cone where the images are taken for every rotation of certain degrees.
We want to find the center of this big ring or fan area to further determine the region of interest.
Then we'd like to first draw two lines perpendicular to the circular arcs to find the center of the cone.
How could we draw such lines.
Raw sample image:

Python opencv aeroplane condensation trail detection

My task is to detect aeroplane condensation trails on the blue sky and deleting everything else from the picture, but I have to leave a 10-pixel wide area around the trails.
I have managed to draw the contours of the condensation trails based on colour using a mask and cv2.drawContours but I'm stuck with creating that 10-pixel sky blue area around it-basically I have to scale up the contour line.
Is it possible to scale up contours drawn by the cv2.drawContours command?
Since you already have a list of points on the contour, you can easily draw a 10-pixel thick line on it by using the line function between consecutive points (look at the thickness parameter). To fill the rest of the area inside the contour, look at the fillPoly function.

Python - How to detect hard edges of multiple thumbnails and save the coordinates?

We have a scanned white page - A4 size that contains multiple thumbnails.
The thumbnails are similar but not exactly the same.
The thumbnails can be in random order and not in a very clear rows and columns. They are not totally random but they are in rows, however these are not a very accurate rows.
A4 page background color is white.
All thumbnails have black border of 5px and border-radius of 10 px
Everyone of the thumbnails contains a green circle (Could be in the center or somewhere close to that).
1. How can we detect the Hard Edges of every thumbnail and store the coordinates so we can crop the thumbnails for later processing and analyzing colors?
2. How can we detect the circle in the center. We want to analyze and get all pixels RGB values contained into this circle and then calculate average RGB value.
Update
This is the image:
Thank you
Main idea: As there are enough blank between the regions, so just crop each region by contours. Then for each region, use houghCircle to detect the circle in it.
Your image is this:
After find external contours and calculate the bounding boxes:
For each contour, crop and find hough circle in it.
Notice: I'll not provide my code for this question.
But post some links maybe useful for you. Learn and do by yourself:
Copy shape to blank canvas (OpenCV, Python)
cv2.drawContours() - unfill circles inside characters (Python, OpenCV)
How to detect colored patches in an image using OpenCV?
Edge detection on colored background using OpenCV
How can I get the minimum enclosing circle with OPENCV?
How can I prepare circle path text image for OCR program?
Update:
To detect the circle, you should select the right parameters, depends on your source image.
Try! Try! TRY!
Here is the circle detection I tried:
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT,
dp=1, minDist=20, circles=None,
param1=200 , param2=50,
minRadius=120, maxRadius=150
)

Detecting center of image from parabolic mirror?

I have a panoramic one shot lens from here: http://www.0-360.com/ and I wrote a script using the python image library to "unwrap" the image into a panorama. I want to automate this process though, as currently I have to specify the center of the image. Also, getting the radius of the circle would be good too. The input image looks like this:
And the "unwrapped" image looks like this:
So far I have been trying the Hough Circle detection. The issues I have is selecting the correct values to use. Also, sometimes, dark objects near the center circle seem to throw it off.
Other Ideas I had:
Hough Line detection of the unwrapped image. Basically, choose center pixel as center, then unwrap and see if the lines on the top and bottom are straight or "curvy". If not straight, then keep trying with different centers.
Moments/blob detection. Maybe I can find the center blob and find the center of that. The problem is sometimes I get a bright ring in the center of the dark disk as seen in the image above. Also, the issue with dark objects near the center.
Paint the top bevel of the mirror a distinct color like green to make circle detection easier? If I use green and only use the green channel, would the detection be easier?
Whats the best method I should try and use to get the center of this image and possibly the radius of the outer and inner rings.
As your image have multiple circle with common centre you can move that way, like
Detect circle with Hough circle and consider circle with common centre.
Now check the ratio for co-centred circle, as your image keep that ratio constant.
I guess don't make it too fancy. The black center is at the center of the image, right? Cut a square ROI close to the image center and look for 'black' region there. Store all the 'black' pixel locations and find their center. You may consider using CMYK color space for detecting the black region.

Categories

Resources