一语惊醒梦中人啊

节选自曹建海的博客

人是需要一些精神的,女孩子尤其如此。我看到富二代在大学征校花结婚,已有近300人应征的消息,我为这些女孩感到羞耻。人不是什么都能卖的,这是人的高贵之处;如果什么都可以卖,包括道德、良知、亲情、肉体,这样的女孩子是没有价值的。

男人也是如此,如果一个人靠炒房、炒股过日子,这样的人本质就是一个赌徒,没有价值。

以下一个简单的matlab代码,用于从振动视频中提取结构的位移时程曲线: 1. 读取视频文件并提取每一帧的图像: ```matlab videoFile = 'your_video_file_name.mp4'; vidObj = VideoReader(videoFile); numFrames = vidObj.NumberOfFrames; for i = 1:numFrames frames(i).data = read(vidObj,i); end ``` 2. 在每一帧图像中找到结构物体的轮廓: ```matlab for i = 1:numFrames % Convert to grayscale and apply edge detection grayImage = rgb2gray(frames(i).data); edgeImage = edge(grayImage,'Canny'); % Find contours of the object [B,~] = bwboundaries(edgeImage,'noholes'); % Choose the boundary with the largest area as the object area = cellfun(@numel,B); [~,maxIdx] = max(area); objectBoundary = B{maxIdx}; % Save the object boundary coordinates frames(i).objectBoundary = objectBoundary; end ``` 3. 计算每一帧中结构物体的中心点坐标,然后计算位移时程曲线: ```matlab % Calculate the center of mass of the object in each frame for i = 1:numFrames x = frames(i).objectBoundary(:,2); y = frames(i).objectBoundary(:,1); frames(i).objectCenter = [mean(x),mean(y)]; end % Calculate the displacement time history displacement = zeros(numFrames,1); for i = 2:numFrames displacement(i) = norm(frames(i).objectCenter - frames(1).objectCenter); end % Plot the displacement time history plot(displacement); xlabel('Frame number'); ylabel('Displacement (pixels)'); ``` 请注意,这只是一个简单的代码示例,可能需要根据您的实际应用进行修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值