フィルターのクリア

How to do manual thresholding using the set of images?

6 ビュー (過去 30 日間)
Manoj Kumar
Manoj Kumar 2014 年 6 月 13 日
編集済み: Manoj Kumar 2014 年 6 月 16 日
Hi,
I have a code for the Manual thresholding and I am unable to run the code correctly. I am using two images to do the thresholding. The imorig is the below original image
and the im is the below segmented image. I want to do thresholding with the help of two images.
this is how i run the code:
>> im=imread('5013lt685dapi_segmented.tif');
>> imorig=imread('5013lt685dapi.tif');
>> name='abc';
>> manual_thresh(im,name,imorig);
AND THE ERROR I AM FACING IS
Error using set
Bad property value found.
Object Name: image
Property Name: 'AlphaData'.
Error in manual_thresh>update_plot (line 239)
set(h_ax1, 'AlphaData', bw);
Error in manual_thresh (line 180)
update_plot
Thanks...

採用された回答

Geoff Hayes
Geoff Hayes 2014 年 6 月 13 日
If you put a breakpoint at line 239
set(h_ax1, 'AlphaData', bw);
you will observe that bw will have the same dimensions as your input image. So if the input image is mxnx3, then bw will be mxnx3 as well. According to http://www.mathworks.com/help/matlab/visualize/mapping-data-to-transparency-alpha-data.html#f3-6784
In order to use nonscalar alpha data, you need to specify the alpha data as an array equal in size to CData of images and surfaces or…
Since CData is your original image, your bw has the correct size in width and height (mxn). What is not all that clear from the notes but probably should be based on the context is that your AlphaData should be mxnx1. Your line of code then becomes
set(h_ax1, 'AlphaData', bw(:,:,1));
Try this and see what happens.
  2 件のコメント
Image Analyst
Image Analyst 2014 年 6 月 13 日
Geoff Hayes
Geoff Hayes 2014 年 6 月 13 日
I see some thresholding if I try with your images. Did you try to move the second slider? Is this not your code?
Take a look at Image Analyst's above comment and his app. It will work.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by