필터 지우기
필터 지우기

saving matlab figure without white borders and loss/gain in number of pixels

조회 수: 4 (최근 30일)
DIVAKAR RAJU P V
DIVAKAR RAJU P V 2021년 7월 7일
답변: KSSV 2021년 7월 7일
Hi!
I loaded an image--> cropped-->converted to binary image
now i want to save the image without and loss of information.
Here I am presenting the code where size of bwin is 416x416 but if read after saving(saved through export button in matlab figure window) it was 634x634.
how to get 416 x 416?
% %%%%%%%%%%Code%%%%%%%%%%%%%
im=imread('2d-vf-50.png');
imsize=size(im);
iminfo=imshow(im);
iminfo = impixelinfo;
crpim = imcrop(im,[484 67 416 415]);
imsize=size(crpim)
imshow(crpim)
iminfocrop = impixelinfo;
bwin=im2bw(crpim,0.51);
imshow(bwin)
imsize=size(bwin)
  댓글 수: 1
DIVAKAR RAJU P V
DIVAKAR RAJU P V 2021년 7월 7일
sorry getting the size of 654 by 656.
if i maximize and save , I am getting other dimensions like 1234 by1237

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

답변 (1개)

KSSV
KSSV 2021년 7월 7일
Use imwrite to write tha image. Read about imwrite.

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by