Error using subsindex Function 'subsindex' is not defined for values of class 'struct'.

简介: 1 clc; clear all; close all; 2 image_path = '/media/wangxiao/Elements/image_segment_backup/'; 3 savePath = '/media/wangxiao/Seagate/wangxiao/...
 1 clc; clear all;  close all;
 2 image_path = '/media/wangxiao/Elements/image_segment_backup/';
 3 savePath = '/media/wangxiao/Seagate/wangxiao/additional_data/';
 4 
 5 threshold  = 5000;
 6 
 7 first_files = dir(image_path);
 8 
 9 for i = 3:length(first_files)
10     sec_file_name = first_files(i).name;
11     sec_path = [image_path, sec_file_name, '/'];
12     sec_files = dir(sec_path);
13     disp(['process the: ', sec_file_name, '---', num2str(i-2), '/', num2str(length(first_files)-2),' waiting . . . ']);
14     
15     for j = 3:length(sec_files)
16         third_file_name = sec_files(j).name;
17         third_path = [sec_path, third_file_name, '/'];
18         third_files = dir(third_path);
19         disp(['     process the: ', third_file_name, '---', num2str(j-2), '/', num2str(length(sec_files)-2),'  . . . ']);
20         
21         for k = 3:length(third_files)
22             fourth_files_name = third_files(k).name;
23             fourth_path = [third_path, fourth_files_name, '/'];
24             fourth_files = dir(fourth_path);
25             disp(['         process the: ', fourth_files_name, '---', num2str(k-2), '/', num2str(length(third_files)-2),'  . . . ']);
26             
27             for ii = 3:length(fourth_files)
28                 fifth_file_name = fourth_files(ii).name;
29                 fifth_path = [fourth_path, fifth_file_name, '/'];
30                 fifth_files = dir(fifth_path);
31                 disp(['               process the: ', fifth_file_name, '---', num2str(ii-2), '/', num2str(length(fourth_files)-2),'  . . . ']);
32                 
33                 for jj = 3:length(fifth_files)
34                     six_file_name = fifth_files(jj).name;
35                     six_path = [fifth_path, six_file_name, '/'];
36                     six_files = dir([six_path, '*.jpg']);
37 %                     disp(['                   process the: ', six_file_name, '---', num2str(jj-2), '/', num2str(length(fifth_files)-2), '  . . . ']);
38                     
39                     for kk = 1:length(six_files)
40                         seven_file_name = six_files(kk).name;
41                         image = imread([six_path, seven_file_name]);
42                         
43                         imshow(image);
44                         
45                         [width, length, channel] = size(image);
46                         %   disp(sec_file_name);
47                         %   disp(third_file_name);
48                         %   disp(fourth_files_name);
49                         %   disp(fifth_file_name);
50                         %   disp(six_file_name);
51                         %   disp(seven_file_name);
52                         resolution = width * length ;
53                         
54                         if (resolution > threshold)
55                             imwrite(image, [savePath, seven_file_name]);
56                         end
57                         
58                         
59                     end
60                     
61                     
62                     
63                     
64                     
65                 end
66                 
67                 
68             end
69             
70             
71         end
72         
73     end
74     
75 end
View Code

 

Error using subsindex
Function 'subsindex' is not defined for values of class 'struct'.

Error in pre_deal_additional_data (line 39)
                    for kk = 1:length(six_files)

----------------------------------------------------------------------

----------------------------------------------------------------------

fuck the error and  the answer is :

 

 

 1 clc; clear all;  close all;
 2 image_path = '/media/wangxiao/Elements/image_segment_backup/';
 3 savePath = '/media/wangxiao/Seagate/wangxiao/additional_data/';
 4 
 5 threshold_self  = 5000;
 6 
 7 first_files = dir(image_path);
 8 
 9 for i = 3:size(first_files, 1)
10     sec_file_name = first_files(i).name;
11     sec_path = [image_path, sec_file_name, '/'];
12     sec_files = dir(sec_path);
13     disp(['process the: ', sec_file_name, '---', num2str(i-2), '/', num2str(length(first_files)-2),' waiting . . . ']);
14     
15     for j = 3: size(sec_files, 1)
16         third_file_name = sec_files(j).name;
17         third_path = [sec_path, third_file_name, '/'];
18         third_files = dir(third_path);
19 %         disp(['     process the: ', third_file_name, '---', num2str(j-2), '/', num2str(length(sec_files)-2),'  . . . ']);
20         
21         for k = 3: size(third_files, 1)
22             fourth_files_name = third_files(k).name;
23             fourth_path = [third_path, fourth_files_name, '/'];
24             fourth_files = dir(fourth_path);
25 %             disp(['         process the: ', fourth_files_name, '---', num2str(k-2), '/', num2str(length(third_files)-2),'  . . . ']);
26             
27             for ii = 3: size(fourth_files, 1)
28                 fifth_file_name = fourth_files(ii).name;
29                 fifth_path = [fourth_path, fifth_file_name, '/'];
30                 fifth_files = dir(fifth_path);
31 %                 disp(['               process the: ', fifth_file_name, '---', num2str(ii-2), '/', num2str(length(fourth_files)-2),'  . . . ']);
32                 
33                 for jj = 3:  size(fifth_files, 1)
34                     six_file_name = fifth_files(jj).name;
35                     six_path = [fifth_path, six_file_name, '/'];
36                     six_files = dir([six_path, '*.jpg']);
37 %                     disp(['                   process the: ', six_file_name, '---', num2str(jj-2), '/', num2str(length(fifth_files)-2), '  . . . ']);
38                     
39                     for kk = 1: size(six_files, 1)
40                         seven_file_name = six_files(kk).name;
41                         image = imread([six_path, seven_file_name]);
42                         
43 %                         imshow(image);
44                         
45                         [width, length, channel] = size(image);
46                         
47                         resolution_self = width * length ;
48                         
49                         if (resolution_self > threshold_self)
50                             imwrite(image, [savePath, seven_file_name]);
51                         end
52                         
53                         
54                     end
55                     
56                     
57                     
58                     
59                     
60                 end
61                 
62                 
63             end
64             
65             
66         end
67         
68     end
69     
70 end
View Code

 

相关文章
|
Java 关系型数据库 数据库连接
java中调用postgis的函数找不到,报错[42883] ERROR: function st_area(public.geometry) does not exis,Navicat里面正常
今天在postgresql数据库中对一个图层表使用st_area()函数,获取图层中geometry字段的面积。
|
5月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
298 13
|
Java Windows
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
232 11
|
存储 JSON 开发框架
给开源大模型带来Function Calling、 Respond With Class
OpenAI 在他的多个版本的模型里提供了一个非常有用的功能叫 Function Calling,就是你传递一些方法的信息给到大模型,大模型根据用户的提问选择合适的方法,然后输出给你,你再来执行。
Fatal error: Call to undefined function openssl_pkey_get_private()
Fatal error: Call to undefined function openssl_pkey_get_private()
227 0
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
343 0
|
SQL 分布式计算 大数据
MaxCompute操作报错合集之遇到报错"ODPS-0130071:[1,8] Semantic analysis exception - class Ssf for user defined function ansy_xx cannot be loaded from any resources",该怎么办
MaxCompute是阿里云提供的大规模离线数据处理服务,用于大数据分析、挖掘和报表生成等场景。在使用MaxCompute进行数据处理时,可能会遇到各种操作报错。以下是一些常见的MaxCompute操作报错及其可能的原因与解决措施的合集。
1232 5
|
前端开发
Error in created hook: “TypeError: _test.default is not a function
Error in created hook: “TypeError: _test.default is not a function
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
252 0
【Azure 应用服务】Azure Function 启用 Managed Identity后, Powershell Funciton出现 ERROR: ManagedIdentityCredential authentication failed
【Azure 应用服务】Azure Function 启用 Managed Identity后, Powershell Funciton出现 ERROR: ManagedIdentityCredential authentication failed
272 0

热门文章

最新文章