NDBI图像处理出错_matlab GUI 图像处理出错,求解决

软件版本2015b,在进行图像灰度处理时,出错。

错误使用 imageDisplayValidateParams

需要的 第 1 个输入, I, 应为以下类型之一:

numeric, logical

但其类型是 matlab.ui.Figure。

出错 images.internal.imageDisplayValidateParams (line 11)

validateattributes(common_args.CData, {'numeric','logical'},...

出错 images.internal.imageDisplayParseInputs (line 78)

common_args = images.internal.imageDisplayValidateParams(common_args);

出错 imshow (line 240)

images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});

出错 rgb2gray>pushbutton2_Callback (line 105)

imshow(imgoutput);

出错 gui_mainfcn (line 95)

feval(varargin{:});

出错 rgb2gray (line 42)

gui_mainfcn(gui_State, varargin{:});

出错

matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rgb2gray('pushbutton2_Callback',hObject,eventdata,guidata(hObject))

计算 UIControl Callback 时出错

2019-7-23 14:04 上传

点击文件名下载附件

3.98 KB, 下载次数: 1

2019-7-23 14:04 上传

点击文件名下载附件

29.34 KB, 下载次数: 1

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是可能的 Matlab 代码实现: ``` % 读取 NDBI 的 CSV 文件 ndbi_data = csvread('ndbi.csv'); % 获取年份数据和 NDBI 数据 years = ndbi_data(:, 1); ndbi_values = ndbi_data(:, 2:end); % 使用似然比检验方法分割时间序列 [num_years, num_locations] = size(ndbi_values); threshold = 0.05; % 设置显著性水平为 0.05 colors = {'r', 'g', 'b', 'm', 'k'}; % 不同的颜色 scatter_data = cell(1, length(colors)); num_clusters = 0; for loc_idx = 1:num_locations ndbi_loc = ndbi_values(:, loc_idx); [change_points, ~] = findchangepts(ndbi_loc, 'MaxNumChanges', num_years-2); if isempty(change_points) continue; end p_values = zeros(1, length(change_points)); for cp_idx = 1:length(change_points) cp = change_points(cp_idx); [h, p_values(cp_idx)] = vartest2(ndbi_loc(1:cp), ndbi_loc(cp+1:end), 'Alpha', threshold); end significant_changes = find(p_values < threshold); if ~isempty(significant_changes) num_clusters = num_clusters + 1; scatter_data{num_clusters} = [years, ndbi_loc]; for sc_idx = 1:length(significant_changes) change_idx = significant_changes(sc_idx); change_year = years(change_points(change_idx)); plot(change_year, ndbi_loc(change_points(change_idx)), 'ko', 'MarkerSize', 10, 'LineWidth', 2); end cluster_color = colors{mod(num_clusters-1, length(colors))+1}; plot(years, ndbi_loc, '.', 'Color', cluster_color, 'MarkerSize', 20); end end % 输出分割后散点图 figure; hold on; for cluster_idx = 1:num_clusters cluster_data = scatter_data{cluster_idx}; cluster_color = colors{mod(cluster_idx-1, length(colors))+1}; scatter(cluster_data(:, 1), cluster_data(:, 2), 50, cluster_color, 'filled'); end xlabel('Year'); ylabel('NDBI value'); ``` 请注意,此代码仅提供了一种可能的实现方法。具体实现可能因数据格式、分析目标等因素而异。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值