24小时热门版块排行榜    

查看: 2253  |  回复: 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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 6/300 2026-08-11 13:19 by JACS/Angew
[基金申请] 听说今天filecode变了 +26 布布和一二 2026-08-06 49/2450 2026-08-11 13:18 by WH3796
[基金申请] FileCode能看出啥? +7 要乐观耀哥 2026-08-10 17/850 2026-08-11 10:50 by 要乐观耀哥
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +6 Tide man 2026-08-10 6/300 2026-08-11 09:45 by tangmnt
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +10 yufeiwaner 2026-08-09 11/550 2026-08-10 18:47 by yufeiwaner
[基金申请] 关于Filecode分析方法 +3 majunge000 2026-08-10 3/150 2026-08-10 15:46 by lch2012
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +11 archvillain 2026-08-04 13/650 2026-08-10 14:41 by seekfind
[基金申请] 好奇怪的filecode +4 布布和一二 2026-08-08 5/250 2026-08-10 14:20 by 冰心玉壶晴
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 化学口download_prp&fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
信息提示
请填处理意见