日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > 循环神经网络 >内容正文

循环神经网络

matlab显示像素分布,MATLAb-----7--------如何动态显示鼠标的坐标值和图像像素值

發布時間:2025/3/12 循环神经网络 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab显示像素分布,MATLAb-----7--------如何动态显示鼠标的坐标值和图像像素值 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

MATLAB如何動態顯示鼠標的坐標值和圖像像素值

http://apps.hi.baidu.com/share/user/41caedc2bda36d61746c6162330a

(1)fix(x) : 截尾取整.

>> fix( [3.12 -3.12])

ans =

3?-3

(2)floor(x):不超過x 的最大整數.(高斯取整)

>> floor( [3.12 -3.12])

ans =

3?-4

(3)ceil(x) : 大于x 的最小整數

>> ceil( [3.12 -3.12])

ans =

4?-3

(4)四舍五入取整

>> round(3.12 -3.12)

ans =

0

>> round([3.12 -3.12])

ans =

3?-3

對于動態顯示鼠標的坐標值和像素值,在其他語言如vc,vb中都比較方便,有直接的著方面的函數,那么在matlab圖像處理里面又如何實現呢? 具體的實現方法很多,但歸結起來就是獲取坐標軸的current point 屬性值,我這里給出的一個函數是從mathworks 獲取柄稍作修改后的結果,相信對做圖像處理的朋友有一定的作用。另一個就是自帶的pixval函數。誰有不同的實現方法,請多多共享啊! function dynpoint(arg,h) % Show the coordinates of a plot dynamically % % To start use: % dynpoint(h) % where h is a handle to a figure, axes or e.g. line. % % To delete use: % dynpoint('delete',h) % where h is a handle to a figure, axes or e.g. line. % (you may also use: dynpoint delete) % % There can only be one dynamic plotter in a figure at a time. % % Example: % subplot(211), hline = plot(sin(1:10)) % subplot(212), plot(sin(1:100)) % dynpoint(hline) % 2002,6.29 if ~exist('arg','var') arg = gcf; end if ~isstr(arg) handle = arg; arg = 'init'; end switch arg case 'init' if ~ishandle(handle) error('h is not a handle') end [h,ax] = h2hax(handle); % delete old dynamic text object ht = findobj(h,'tag',[mfilename '_text']); if any(ht) delete(ht) end % text window at the bottom left corner % text in centred uicontrol(h,... 'style','text',... 'pos',[2 2 200 15],... 'tag',[mfilename '_text'],... 'userdata',ax(1)) % do the dynamic thing... set(h,'windowbuttonmotionfcn',[mfilename ' move']) case 'move' ht = findobj(gcbf,'tag',[mfilename '_text']); ax = overobj('axes'); if ~any(ax) ax = get(ht,'userdata'); end p = get(ax,'currentpoint'); set(ht,'string',sprintf('(%g, %g)', p(1), p(3))); case 'delete' if ~exist('h','var') h = gcf; end [h,ax] = h2hax(h); set(h,'windowbuttonmotionfcn','') ht = findobj(h,'tag',[mfilename '_text']); delete(ht) end % ---------- function [h,ax]=h2hax(handle) typ = get(handle,'type'); if strcmp(typ,'figure') h = handle; ax = findobj(h,'type','axes'); elseif strcmp(typ, 'axes') h = get(handle,'parent'); ax = handle; elseif strcmp( get(get(handle,'parent'), 'type'), 'axes' ) ax = get(handle,'parent'); h = get(ax,'parent'); end

總結

以上是生活随笔為你收集整理的matlab显示像素分布,MATLAb-----7--------如何动态显示鼠标的坐标值和图像像素值的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。