简体   繁体   English

获取图像的一部分并将其放回Matlab的主图像中

[英]get some part of image and put it back in to the main image in matlab

I have 2 mins video, I seprate each 1sec of this video and change it to 120 images. 我有2分钟的视频,我每隔1秒间隔一次,并将其更改为120张图像。 this image is too big and user can select some area of these images.I change my image matrix to to the vector and now I want to know index of the area which user selected? 此图像太大,用户可以选择这些图像的某些区域。我将图像矩阵更改为矢量,现在我想知道哪个用户选择了该区域的索引?

after some process on that part, I want to put the changed image vector back to the main image. 经过那部分的处理后,我想将更改后的图像向量放回主图像。

I used ROI function but it didn't work, can any one help me with this problem? 我使用了ROI功能,但没有用,有人可以帮助我解决此问题吗?

Assume you have frame1 whose dimensions are R*C where R and C are the number of rows and columns, respectively. 假设您的frame1的尺寸为R*C ,其中R和C分别是行数和列数。

User picked a rectangle region of interest; 用户选择了一个感兴趣的矩形区域; from r1 to r2 and from c1 to c2. 从r1到r2,从c1到c2。

roi1=frame1(r1:r2,c1:c2)

will give you the roi you want. 会给您想要的投资回报率。 This operation copies the region of interest to roi1 . 该操作将感兴趣区域复制到roi1 Then you can process this roi and copy it back to the original frame. 然后,您可以处理此roi并将其复制回原始帧。

Another way is to play with frame1(r1:r2,c1:c2) which may be difficult if you are not careful and slightly slower if you are doing so many operations. 另一种方法是使用frame1(r1:r2,c1:c2)玩,如果您不小心的话可能会很困难,而如果进行那么多操作则会稍微慢一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM