如何在不规则形状的物体中刻印最大的椭圆形

发布于 2025-01-30 10:02:48 字数 616 浏览 2 评论 0原文

我试图从二进制图像中找到不规则形状的物体内部最大或最佳的椭圆形,以获得更加一致的质量和方向角中心。

我正在尝试分析一个包含许多此类对象的视频,并在框架中移动时跟踪该对象。我已经删除了原始视频中的其他对象,一次只专注于一个对象,并尽可能地将其集中。当前region_props为我提供了质心坐标和方向角度。但是,由于整个像素的较小变化,这些坐标会发生变化,从而提供了一个非常不稳定的视频。 这是视频中的图像:

”在此处输入图像描述

中心的主斑点不会在视频过程中发生变化,但是卷曲的东西出现略微弯曲和变化,给我带来了问题。我的目标是找到物体内部最大的椭圆形,并从中获得质量中心以及方向角度。我将分析许多视频,以及许多各种大小的对象,但是如果我能了解一下如何以一个图像来构建我可以做到的一些。我已经看到有关将椭圆插入边界框中的一些东西,但是由于这些对象都是非常不规则的,一个边界盒将无法使用。

我怎么能解决这样的问题?

I am trying to find the largest or best fitting ellipse inside an irregularly shaped object from a binarized image, in order to get a more consistent center of mass and orientation angle.

I am trying to analyze a video that contains many of these objects and track the object as it moves around in the frame. I have cut out the other objects in the original video to just focus on one object at a time, and have it as centered as I can. Currently region_props gives me centroid coordinates and an orientation angle. But because of small pixel variations throughout, those coordinates change, giving a very unsteady video.
Here is the image from the video:

enter image description here

The main blob in the center doesn't change over the course of the video, but the curly things coming out slightly bend and change, giving me problems. My goal is to find the largest ellipse inside the object and get the center of mass from that as well as the orientation angle. I will be analyzing a lot of videos, and also a lot of object of various sizes, but if I can get some idea of how to do it for one image I can build up. I have seen some things regarding inscribing ellipses inside bounding boxes but because these objects are all very irregular a bounding box won't work.

How could I approach a problem like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花落人断肠 2025-02-06 10:02:48

用磁盘结构元件略大于附属物的开口,但比中央体小。这将去除附属物,仅留下中央身体。您的region_props结果应足够一致。

例如,使用 diplib (披露:我是作者),您会以这种方式这样做:

import diplib as dip
img = dip.ImageRead('uhp1D.jpg')
core = dip.Opening(img, 19)
core.Show()

结构元件越大,输出越紧凑。

Apply an opening with a disk structuring element that is slightly larger than the appendages, but smaller than the central body. This will remove the appendages, and leave only the central body. Your region_props results should then be consistent enough.

For example, using DIPlib (disclosure: I'm an author) you would do it this way:

import diplib as dip
img = dip.ImageRead('uhp1D.jpg')
core = dip.Opening(img, 19)
core.Show()

result of operation above

The larger the structuring element, the more compact the output is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文