how to segment a tray image with regular pocket pattern ?

조회 수: 11 (최근 30일)
Di
Di 2013년 8월 14일
Hello everyone,
I am working on a project which need to find how many pockets (rectangular or square shapes) in a tray image and location of those pockets.
The image is acquired by a webcam with quite uniform illumination. The pockets have same size for the same type of tray but for different tray their size are varied. Please see below link for the image:
Can anyone advise a robust way to segment those pockets out? As the color of the tray may also vary, what is the best approach to handle do such problem?
Thank you very much!
Best regards,
Di

채택된 답변

Image Analyst
Image Analyst 2013년 8월 15일
Your illumination may be uniform but your image is not. If your illumination is uniform then you have bad vignetting (shading) due to your lens. Take a blank shot and then fit a 2D polynomial to it, then divide your images by the modeled, perfect background to "flat field" your image.
To find the pockets, simply sum your image vertically and horizontally. Then threshold to find the rows and columns that have dark stuff and bright stuff in them. Knowing the rows and columns locations you can easily find the locations of the rectangles defining the pockets, and of course the count also. Give that a try.
  댓글 수: 6
Di
Di 2013년 8월 23일
Image Analyst, thank you for your helps! I really appreciate it.
The above link is the result of 2nd tray image. There are a few reduntant small regions. To remove them, I am thinking to
1. smooth('rloess') the x and y profile data, find all composed bw areas using a threshold of 0.9* max(profile_value); 2. based on the size of areas, use k-means clustering to segment a set of max areas as the pocket regions.
Do you think will this approach be robust?
Image Analyst
Image Analyst 2013년 8월 23일
It looks like you have serious problems getting a good image. Why can't you get a consistently good image? Anyway, it looks like the tray is in a jig (holder), so why can't you just use fixed, known positions?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by