フィルターのクリア

How to set crop boundary

1 回表示 (過去 30 日間)
RuiQi
RuiQi 2016 年 6 月 17 日
回答済み: Image Analyst 2016 年 6 月 17 日
How do i add a boundary condition in matlab ? Like my image is 100 x 100 and i want to crop 1000 x 1000.
So new = old(1:1000,1:1000).
But that will give me an error. How can I add in a boundary condition so it restricts my range ? Like
new = old(1:1000,1:1000) & boundary (openCV got & function to take intersection between 2 rectangles)

採用された回答

Image Analyst
Image Analyst 2016 年 6 月 17 日
Simply use an "if" statement to see if the column is more than the number of columns in your image
rightColumn = 1000;
[rows, columns, numColors] = size(old);
if rightColumn > columns
rightColumn = columns;
end

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by