How to average values of certain pixels of multiple targets in a 2D data while keeping sign as weights to have one value and sign?

2 次查看(过去 30 天)
Dear MATALB Experts,
I have estimated the velocity of several ships in a scene, and it appears that each ship has a variable velocity. However, I believe that each ship should have one velocity value and one sign (either -ve or +ve). To achieve this, I need to average the pixel values of each ship target and keep the signs as weights. Specifically, if there are more negative weights than positive weights, the final sign should be negative.
Could you please provide guidance on how to average the pixel values and obtain one sign for each ship in the given scene? I have attached a .mat file for your reference.
Thank you for your help.
Best regards,
Amjad
  4 个评论
Amjad Iqbal
Amjad Iqbal 2023-5-15
Thank you for your comment. .mat file is 2D data and its an image as well as shown above.
I need to average each target values to obtain one value for one target and display in image form with one color. In given image color is varying in each target which should be one color and it can be done by avegraging and assigning same value for all the pixels of one target.
Image Analyst
Image Analyst 2023-5-15
If you have any more questions, then attach your original data and code to read it in with the paperclip icon after you read this:
Also give code to create the image you attached from the original data.
In the meantime, see the sign function.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by