Splitting part of image to smaller images

조회 수: 5 (최근 30일)
Holmbrero
Holmbrero 2020년 10월 9일
댓글: Mathieu NOE 2020년 10월 9일
Hi!
I want to split a part of an image into smaller regions and perform a function on each of the new regions individually. See attached image.
What is the prefered choise here. Should i crop the image to the region of interest first and then split it up or is there a more efficient way of doing this?
I want to store the data in a mxn matrix afterwards.
Any suggestions?
Regards,
Anders Holmberg
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2020년 10월 9일
Hi
this is an example for multiple tif files where I selected a smaller area of the image - you can work on that
% select appropriate options below ...
% files = dir('*.tif'); % all tif files in current directory
files = dir('handheld*.tif'); % as example : only tiff files with "handheld" in the filename
% main loop
for ck = 1:length(files)
Filename = files(ck).name;
H{ck} = imread(Filename); % save for future use
% plot (just to check)
figure(2*ck), imagesc(H{ck});
% crop figure
[m,n] = size(H{ck});
cur_fig = H{ck};
x_pixels_range = 1:110;
y_pixels_range = 1:110;
figure(2*ck+1), imagesc(cur_fig(x_pixels_range,y_pixels_range,:));
% insert your own code here
end

댓글을 달려면 로그인하십시오.

답변 (1개)

Sudhakar Shinde
Sudhakar Shinde 2020년 10월 9일
Image segmentation technique can be used to partition an image into multiple parts or regions, often based on the characteristics of the pixels in the image.
  댓글 수: 1
Holmbrero
Holmbrero 2020년 10월 9일
Thank you for your answer. I will use image segmentation, but on each of the small images. The part that i am interested in is how to split the originial image into smaller ones in an efficient way.
Regards,
Anders Holmberg

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by