python - OpenCV / Image Processing techniques to find the centers of bright spots in an image -


i'm doing project based on methodology described in paper: camera calibration single night sky image

as beginner in computer vision, not quite understand how can implement method used in paper find centre of bright spots (luminaries) within image, particular on paragraph in section 4.1:

the surrounding patch of size 15 × 15 pixels (figure 1(a)), upsampled given factor (figure 1(c)) , corresponding gradient map calculated (figure 1(d)). starting brightest region, gray value threshold decreased, until energy function maximized. energy function defined sum of border gradients , normalized border length (figure 1(e)). leads segmented star image shown in figure 1(f). segmentation ensures weighted centre of gravity algorithm [11] gives robust estimation.

upsampled image after gradient function applied after energy-function applied segmented image

from understanding, think can laplacian / sobel gradient function on upsampled image, after i'm not sure how can perform energy function part , produce segmented image. also want understand how implement weighted centre of gravity algorithm find centre of bright spot using opencv or other python library.

much appreciated if of can provide lights on this.

thanks , regards.

the main thing take away energy function used in context any function used maximization problem. here, energy function sum of gradients/derivatives/differences (i.e. "detected borders likelihood" in case).

since seem have non-algorithmic background, suggest read on breadth-first search (remember image specific type of graph, every edge pixel, connected adjacent ones), recursion, , floodfill.

  1. up/downscale image
  2. run horizontal , vertical sobel filters. combine resultant images grad_img = max_per_pixel(sobel_horiz,sobel_vert).
  3. for each 15x15 pixel patch, find brightest spot. seed of star.
  4. start 1x1 region consists of seed. keep adding adjacent pixels region (recommend breadth-first traversal). calculate energy sum of pixel values in grad_img pixel coordinates borders of region. if energy higher energy of previous iteration, new pixel added region. if not, pixel rejected.
  5. finding center of gravity of closed contour or collection of pixels not hard task. either math definition (the sum of x , y coordinates of in-region pixels, divided area), or using image moments (cv::moments example).

my solution bit different solution. run floodfill algorithm fills pixels of brightness [threshold;255], calculating energy func, decreasing threshold, rinse , repeat, stopping when maximize energy function. note algorithm inefficient making 255 floodfills every pre-detected star compared 1 floodfill in proposal, , performance issue in practice.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -