imcrop function problem for 16bit image 2019b

2 次查看(过去 30 天)
Dear all,
The following imcrop code gives an error in 2019b
I = imread('XX.tif');
[Icrop, rect] = imcrop(I, [ ]);
It seems that 2019b does't support [ ] with imcrop. If you are working with 16 bit images then you will be in trouble because you need to see the image before croping it, and for that you need to put the [ ].
Any idea how to overcome this problem?
Thank you in advance.
Meshoo
  6 个评论
Meshooo
Meshooo 2019-10-11
编辑:Meshooo 2019-10-11
Hi Walter,
I couldn't understand exactly what do you mean. I am just runing my old codes in 2019 and got an error.
People working with uint16 images usually use [ ] to show the image on their screens, for example: imshow(I_unit16, [ ]).
Similarly, we need to use [ ] when croping uint16 image in order to dispaly the image before cropping it. That was possible in older versions of MATLAB but not in 2019b.
Regards,
Meshoo
Walter Roberson
Walter Roberson 2019-10-12
Please name a particular release that documents using [] as a parameter to imcrop() . I looked through the archived documentation for several releases and could not find any evidence that it was ever a supported option.
Similarly, we need to use [ ] when croping uint16 image in order to dispaly the image before cropping it.
So display the image with imshow() with the documented [] option, and call imcrop() on the handle returned by imshow:
h = imshow(I, []);
[Icrop, rect] = imcrop(h);

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2019-10-12
h = imshow(I, []);
[Icrop, rect] = imcrop(h);
  9 个评论
Image Analyst
Image Analyst 2019-10-18
Then you'll be making a lot of bug reports. There is a constant flow of functions either changing inputs, being deprecated, or being removed completely as versions progress through the years. I don't see how that, either filing bug reports or writing a custom wrapper and calling that from your code, is any better than just hitting the delete key 3 times.
Meshooo
Meshooo 2019-10-18
For me it's already solved and thanks for the many help I got from all of you. For many other users it is still an issue.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by