How to detect the black object in gray background and rotate it?

2 ビュー (過去 30 日間)
iman yazdansepas
iman yazdansepas 2019 年 11 月 9 日
回答済み: Walter Roberson 2019 年 11 月 9 日
Hello,
I have a black object in a gray background(Image1) and I like to rotate it. but when I use the below command for rotate it, it's rotate the whole frame (Image2),
img_R = imrotate(I,10);
I'm wondering is there any way to rotate just the object inside the image and not around it?
Any help would be appriciated.
Thank you
Iman

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 11 月 9 日
Not exactly . What you can do is detect the gray background and figure it it's RGB. Then rotate like you do. Now find the black parts and fill them with the same RGB.

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by