필터 지우기
필터 지우기

image cropping location problem

조회 수: 2 (최근 30일)
MOHAMED GILANI
MOHAMED GILANI 2021년 11월 21일
답변: yanqi liu 2021년 11월 22일
why i got diffrent location of crop when i change the image im using btw im using the same value of coordinate but the location is diffrent
  댓글 수: 7
DGM
DGM 2021년 11월 21일
Provide a simplified and concrete example demonstrating the problem.
Matt J
Matt J 2021년 11월 21일
Maybe the images are not all the same size. Therefore, the cropping coordinates don't cover the same spatial region in all cases.

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

채택된 답변

yanqi liu
yanqi liu 2021년 11월 22일
sir,may be use the rate,such as
clc; clear all; close all;
im = imread('cameraman.tif');
sz = [size(im, 1) size(im, 2)];
rect = round([sz(2)/2 sz(1)/2 sz(2)*0.2 sz(1)*0.3]);
im2 = imcrop(im, rect);
figure;
subplot(1, 2, 1); imshow(im);
hold on; rectangle('position', rect, 'EdgeColor', 'g', 'LineWidth', 2)
subplot(1, 2, 2); imshow(im2);
im = imread('football.jpg');
sz = [size(im, 1) size(im, 2)];
rect = round([sz(2)/2 sz(1)/2 sz(2)*0.2 sz(1)*0.3]);
im2 = imcrop(im, rect);
figure;
subplot(1, 2, 1); imshow(im);
hold on; rectangle('position', rect, 'EdgeColor', 'g', 'LineWidth', 2)
subplot(1, 2, 2); imshow(im2);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MRI에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by