How to Copy Labeled Object Area Value and Paste on Other Object
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I am not sure if it is possible or not but would like to ask if anybody has a knowledge on copying the properties of any labeled objects to another oobject. I mean Regionprops values with properties.
An example, I am using below properties on regionprops:
regionprops=regionprops('Centroid','Area','Eccentricity','Perimeter')
and my aim is to copy the area value to pasted point.
댓글 수: 2
Walter Roberson
2018년 9월 7일
So at the target location, the code should check to see if there is an existing object there and if so it should delete or add randomly to the object until the area of the resulting object was the same as the first object?
답변 (3개)
Walter Roberson
2018년 9월 7일
regionprops returns a struct. You can assign the struct or parts of it to another variable.
댓글 수: 0
Image Analyst
2018년 9월 7일
Why would you want to do that? It sounds like a very bad and deceptive idea and would lead to wrong, or at best, misleading results.
You forgot to attach your input binary image, and what you want to see as the result of this (in my opinion, unwise) operation.
What is a "pasted point"? What are you pasting and how and where?
Do you simply want to display some text (in the overlay) of the area of one object but above some different object? Again, this is wrong.
댓글 수: 0
Murat Kocaman
2018년 9월 10일
편집: Murat Kocaman
2018년 9월 10일
댓글 수: 4
Image Analyst
2018년 9월 11일
You haven't given the "use case" for this application, and that would help guide our replies.
First of all, see if you can take photos without overexposing the subject.
Then, I'm guessing that you want to compare this thing (ring or jewelry or whatever) to a perfect version, so do you have a perfect version to compare it to?
Next, if the subject is the same for every photo, then why can't you just use imfreehand() to hand draw a template - a set of regions that define where every region should be? If all your subjects will be the same shape/structure, then a template would be the simplest approach.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!