フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Is it always necessary to convert image to double type before further execution?

3 ビュー (過去 30 日間)
Krishna
Krishna 2013 年 10 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I want to threshold an image. I can read the image and it is a byte type (UINT 8). I want to pass this image to another function as it is but it asks me to convert to double before I can pass to another function where threshold is performed via MEX MATLAB. How can I pass the image as the same data type? Thanks in advance.

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 10 月 2 日
We don't know. You will need to tell us which function you are trying to pass it to.

Image Analyst
Image Analyst 2013 年 10 月 2 日
Well apparently you can't. It said so. It said it wanted double and rejected your call when you tried to pass in uint8(). I don't know why, but that's the way it is. It seems like it could just cast it to double internally, but, for whatever reason, it doesn't. So I guess you have to live with it. Either use double() if it can take whatever range you have, or use im2double() if it wants it in the 0-1 range.
  6 件のコメント
Jan
Jan 2013 年 10 月 8 日
編集済み: Jan 2013 年 10 月 8 日
@Krishna: This is not Matlab. We do not know: getData_Image function, type and size of "image", value or "rows" and "cols", size and type of "matlab_image" and why you use 1-based indexing here. So currently there is no chance to guess, what you are doing.
Krishna
Krishna 2013 年 10 月 8 日
編集済み: Krishna 2013 年 10 月 8 日
Sorry that it was not clear. Actually 'image' variable is byte-array type defined in my header file along with that 'getData_Image' function.1-based indexing is for the matlab arrays as compared to C which is 0-based since I want to transfer pixel values to corresponding places. If all these are unclear, can you please let me know how to access each value of image (which is obviously a matrix) we read in matlab and pass to a C type multidimensional array.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by