필터 지우기
필터 지우기

How to Extract a certain Shape from Image

조회 수: 2 (최근 30일)
Max
Max 2013년 2월 18일
댓글: Darshan Drviruz 2017년 10월 21일
I would like to distinguish between "background" pixels and the "orange plastic bag" pixels in order to manipulate those pixels (count, hist, etc).
I can't use indx = I(I ~= 1) because there are some white pixel inside the orange plastic bag.
Moreover, this bag is aligned but it might be rotate in other images.
Thanks.
  댓글 수: 1
Rakshit Kothari
Rakshit Kothari 2013년 2월 18일
So what you basically need is some form of object recognition, am i correct? If you just need to extract the bag of chips, image segmentation using Otsu's method is probably what you need.
If you need recognition i suggest you read up on SIFT or SURF.

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

답변 (2개)

Walter Roberson
Walter Roberson 2013년 2월 18일
convert to gray, threshold to select non-white, imfill() 'holes'. The result should be a mask you can use to select from the larger image.
  댓글 수: 2
Max
Max 2013년 2월 18일
it is a problematic since I can't use indx = I(I ~= 1) because there are some white pixel inside the orange plastic bag.
Walter Roberson
Walter Roberson 2013년 2월 18일
That's why you imfill() 'holes', to recover the "inside" part.

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


Rakshit Kothari
Rakshit Kothari 2013년 2월 18일
So what you basically need is some form of object recognition, am i correct? If you just need to extract the bag of chips, image segmentation using Otsu's method is probably what you need.
If you need recognition i suggest you read up on SIFT or SURF.
If its a quick thing that you are looking for, just invert the image, threshold and then use REGIONPROPS with filled holes option.
If you need the shape of the object:
Ratio = Area of Object/Area under bounding box
If Ratio is a reasonably high value, you object is a square or a rectangle. If its lower, its probably a triangle or circle.
  댓글 수: 1
Darshan Drviruz
Darshan Drviruz 2017년 10월 21일
Would you please explain this by using code? i couldn't understand well

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

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by