新足迹

 找回密码
 注册

精华好帖回顾

· 一个真正有效的内调方子:祛痘,美容,调理内分泌,保养子宫 + 纠正护肤观念 (2009-8-10) yanyan111 · 谁能比过我可爱? (2006-12-28) Melody
· 第十次的日本行:横断九州之旅 - 全文完 - 长崎, 看水豚泡澡,东京站的早餐 (2022-12-7) 胡须康 · 长周末老陶的晚餐 - 快速简单但富有营养的海派美食(第一晚,第二晚,第三晚) (2008-10-4) 老陶
Advertisement
Advertisement
查看: 1570|回复: 3

这是不是一个完整的可运行的 matlab 程序? [复制链接]

头像被屏蔽

禁止发言

发表于 2024-3-9 18:59 |显示全部楼层
此文章由 Iisbiggest 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 Iisbiggest 所有!转贴必须注明作者、出处和本声明,并保持内容完整
only 10 lines.
% Want to swap pixel at (x1,y1) in image with the pixel at (x2,y2)
I = imread('face.jpg');
x1 = 25;
y1 = 25;
x2 = 25;
y2 = 370;

% Get pixel data from image
pixel1 = I(y1, x1, :);
pixel2 = I(y2, x2, :);

% Swap pixels
I(y1, x1, :) = pixel2;
I(y2, x2, :) = pixel1;
imshow(I);
Advertisement
Advertisement

发表于 2024-3-9 19:12 来自手机 |显示全部楼层
此文章由 yzh1999 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 yzh1999 所有!转贴必须注明作者、出处和本声明,并保持内容完整
Yes, the code provided is a complete and executable MATLAB program. It reads an image, swaps the pixels at coordinates (x1, y1) and (x2, y2), and then displays the modified image. However, there's a small issue in the code: the indexing for pixel access should start from 1 instead of 0. So, if you're using 0-based indexing, you might need to adjust the pixel coordinates accordingly.

-Chatgpt
头像被屏蔽

禁止发言

发表于 2024-3-11 20:18 |显示全部楼层
此文章由 Iisbiggest 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 Iisbiggest 所有!转贴必须注明作者、出处和本声明,并保持内容完整
Chatgpt is so smart.

发表于 2024-5-22 13:03 来自手机 |显示全部楼层
此文章由 fybs 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 fybs 所有!转贴必须注明作者、出处和本声明,并保持内容完整
不是,只是code。简单的换了图片上面的两个点。不能独立运行。

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部