24小时热门版块排行榜    

查看: 2056  |  回复: 8
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

小鬼木木

新虫 (小有名气)

[求助] 如何在MATLAB读取的图片中添加坐标系 已有1人参与

如何在MATLAB读取的一副图片中,以图片中心为坐标原点画坐标系?求大神帮助,谢谢!
期望效果图如上传的图片所示

如何在MATLAB读取的图片中添加坐标系
示例.png
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

小鬼木木

新虫 (小有名气)

引用回帖:
5楼: Originally posted by FMStation at 2016-09-24 15:10:12
在调用regionprops之前必须将二值图像转变为标注矩阵。两个函数可以做到:
L = bwlabel(BW); L = double(BW);

regionprops。顾名思义:它的用途是get the properties of region,即用来度量图像区域属性的函数。 ...

>>clear all;close all;
>> I=imread('v4.jpg');
>> i=im2bw(I);
>> L=bwlabel(i);
>> ZB1=regionprops(L,'Centroid');%acquire the center of mass
>> center_x=ZB1.Centroid(1);%acquire X position of the center mass
error:
Field reference for multiple structure elements that is
followed by more reference blocks is an error.

不知道问题出在了哪里?还望指点,谢谢!
7楼2016-09-24 19:41:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 9 个回答

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
小鬼木木: 金币+10, ★★★很有帮助 2016-09-24 13:55:05
https://www.mathworks.com/matlabcentral/newsreader/view_thread/288905
CODE:
L = bwlabel(Iedge);
ZB1 = regionprops(L, 'Centroid'); %acquire the center of mass
center_x = ZB1.Centroid(1); %acquire X position of the center mass
center_y = ZB1.Centroid(2); %acquire Y position of the center mass

line(center_x, center_y, 'Marker', '*', 'MarkerEdgeColor', 'r')

» 本帖已获得的红花(最新10朵)

2楼2016-09-23 18:01:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

小鬼木木

新虫 (小有名气)

引用回帖:
2楼: Originally posted by FMStation at 2016-09-23 18:01:57
https://www.mathworks.com/matlabcentral/newsreader/view_thread/288905


L = bwlabel(Iedge);
ZB1 = regionprops(L, 'Centroid'); %acquire the center of mass
center_x = ZB1.Centroid(1); %acquire X  ...

非常感谢,但是,我算是一个MATLAB小白,根据这个代码,没做出来呀,总是提示各种错误,你能不能帮我测试下,看看到底怎么回事,谢谢。
3楼2016-09-24 13:54:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

小鬼木木

新虫 (小有名气)

送红花一朵
引用回帖:
2楼: Originally posted by FMStation at 2016-09-23 18:01:57
https://www.mathworks.com/matlabcentral/newsreader/view_thread/288905


L = bwlabel(Iedge);
ZB1 = regionprops(L, 'Centroid'); %acquire the center of mass
center_x = ZB1.Centroid(1); %acquire X  ...

常感谢,但是,我算是一个MATLAB小白,根据这个代码,没做出来呀,总是提示各种错误,你能不能帮我测试下,看看到底怎么回事,谢谢。
4楼2016-09-24 14:15:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 278求调剂 +8 烟火先于春 2026-03-17 8/400 2026-03-21 16:00 by ColorlessPI
[考研] 297求调剂 +11 戏精丹丹丹 2026-03-17 11/550 2026-03-21 15:43 by ColorlessPI
[考研] 求调剂 +3 白QF 2026-03-21 3/150 2026-03-21 13:12 by zhukairuo
[考研] 083200学硕321分一志愿暨南大学求调剂 +3 innocenceF 2026-03-17 3/150 2026-03-21 02:35 by JourneyLucky
[考研] 332求调剂 +4 ydfyh 2026-03-17 4/200 2026-03-21 02:20 by JourneyLucky
[考研] 324分 085600材料化工求调剂 +4 llllkkkhh 2026-03-18 4/200 2026-03-21 01:24 by JourneyLucky
[考研] 271材料工程求调剂 +8 .6lL 2026-03-18 8/400 2026-03-21 00:58 by JourneyLucky
[考研] 一志愿西南交大,求调剂 +5 材化逐梦人 2026-03-18 5/250 2026-03-21 00:26 by JourneyLucky
[考研] 294求调剂材料与化工专硕 +15 陌の森林 2026-03-18 15/750 2026-03-20 23:28 by JourneyLucky
[考研] 287求调剂 +7 晨昏线与星海 2026-03-19 8/400 2026-03-20 22:19 by JourneyLucky
[考研] 295材料求调剂,一志愿武汉理工085601专硕 +5 Charlieyq 2026-03-19 5/250 2026-03-20 20:35 by JourneyLucky
[考研] 260求调剂 +3 朱芷琳 2026-03-20 3/150 2026-03-20 20:35 by 学员8dgXkO
[考研] 289求调剂 +6 怀瑾握瑜l 2026-03-20 6/300 2026-03-20 20:30 by 学员8dgXkO
[考研] 319求调剂 +3 小力气珂珂 2026-03-20 3/150 2026-03-20 19:47 by JourneyLucky
[考博] 招收博士1-2人 +3 QGZDSYS 2026-03-18 3/150 2026-03-20 11:58 by 呱呱呱呱叫
[考研] 288求调剂,一志愿华南理工大学071005 +5 ioodiiij 2026-03-17 5/250 2026-03-19 18:22 by zcl123
[考研] 266求调剂 +5 阳阳哇塞 2026-03-14 10/500 2026-03-19 15:08 by 阳阳哇塞
[考研] 0703化学调剂 +5 pupcoco 2026-03-17 8/400 2026-03-19 13:58 by houyaoxu
[考研] 0703化学调剂 +3 妮妮ninicgb 2026-03-17 3/150 2026-03-18 10:29 by macy2011
[考研] 一志愿南京大学,080500材料科学与工程,调剂 +4 Jy? 2026-03-16 4/200 2026-03-17 11:02 by gaoqiong
信息提示
请填处理意见