Finding square centers from a picture

FacundoGFlores

After an Image Processing, from fft's, filters, and thresholding, I obtained the following image:

enter image description here

So, I'm wondering how to extract those centers. Does exist any function from OpenCV? (such as HoughCircles for detecting circles?) or Do I need to use clustering methods?

Maybe it is useful for you to know the code I used:

import cv2
import numpy as np
import scipy.ndimage as ndimage 
from scipy.ndimage import maximum_filter

img = cv2.imread("pic.tif",0)

s = np.fft.fftshift(np.fft.fft2(img))

intensity = 20 * np.log(np.abs(s))
maxs = maximum_filter(intensity, 125)
maxs[maxs < intensity] = intensity.max()

ret, thresh = cv2.threshold(maxs.astype('uint8'),0,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU)
imshow(thresh)

PS: So I have another question, it could be useful for some of you. The maximum_filter function gave me the "3 squares"(then I'll get a better visualization of them by using thresholding), so is there a way to use the maximum_filter function and to obtain "3 circles"? Then we can use HoughCircles to obtain the 3 centers circles.

Haris

You may need to use Image Moments.

As the pre-processing steps, threshold the source to create mask of squares, and then pass to findcontours.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Finding square centers from a picture

From Dev

Finding the diagonals of square matrix made from lists

From Dev

Finding centers' index using kmeans in R

From Dev

Finding centers' index using kmeans in R

From Dev

Finding the American flag in a picture?

From Dev

Finding a square in a group of coordinates

From Dev

Finding square of a number

From Dev

Working on vectors and finding their square

From Dev

Finding the centers of overlapping circles in a low resolution grayscale image

From Dev

Finding perimeter of a recursively modified square

From Dev

Finding the numbers of square that can be formed

From Dev

Finding perimeter of a recursively modified square

From Dev

Finding the square of a number without multiplication

From Dev

Finding if n! + 1 is a perfect square

From Dev

Finding the biggest square in a rectangle with a condition

From Dev

python opencv-finding circle (Sun) , coordinates of center the circle from picture

From Dev

Java Chess: Should finding nearby square be a method of Square or Board class?

From Dev

Fraction class for finding square root 2 convegerence

From Java

OpenCV Finding square center c++

From Dev

Finding square root without using sqrt function?

From Dev

Finding and printing the average of a square of values in a multidimensional array

From Dev

Scipy Root Finding non square matrix

From Dev

Finding the largest square in an n * n grid

From Dev

Finding the square root of a number by using binary search

From Dev

Finding AIC and R-square in regression loop

From Dev

Finding square root without using sqrt function?

From Dev

Finding the largest square in an n * n grid

From Dev

php finding amount of square numbers in interval

From Dev

AS3: Scaling Up Multiple Elements from Their Own Centers Each

Related Related

  1. 1

    Finding square centers from a picture

  2. 2

    Finding the diagonals of square matrix made from lists

  3. 3

    Finding centers' index using kmeans in R

  4. 4

    Finding centers' index using kmeans in R

  5. 5

    Finding the American flag in a picture?

  6. 6

    Finding a square in a group of coordinates

  7. 7

    Finding square of a number

  8. 8

    Working on vectors and finding their square

  9. 9

    Finding the centers of overlapping circles in a low resolution grayscale image

  10. 10

    Finding perimeter of a recursively modified square

  11. 11

    Finding the numbers of square that can be formed

  12. 12

    Finding perimeter of a recursively modified square

  13. 13

    Finding the square of a number without multiplication

  14. 14

    Finding if n! + 1 is a perfect square

  15. 15

    Finding the biggest square in a rectangle with a condition

  16. 16

    python opencv-finding circle (Sun) , coordinates of center the circle from picture

  17. 17

    Java Chess: Should finding nearby square be a method of Square or Board class?

  18. 18

    Fraction class for finding square root 2 convegerence

  19. 19

    OpenCV Finding square center c++

  20. 20

    Finding square root without using sqrt function?

  21. 21

    Finding and printing the average of a square of values in a multidimensional array

  22. 22

    Scipy Root Finding non square matrix

  23. 23

    Finding the largest square in an n * n grid

  24. 24

    Finding the square root of a number by using binary search

  25. 25

    Finding AIC and R-square in regression loop

  26. 26

    Finding square root without using sqrt function?

  27. 27

    Finding the largest square in an n * n grid

  28. 28

    php finding amount of square numbers in interval

  29. 29

    AS3: Scaling Up Multiple Elements from Their Own Centers Each

HotTag

Archive