フィルターのクリア

why my picture is 0s ?

1 回表示 (過去 30 日間)
Bekhtaoui Abdelhakim
Bekhtaoui Abdelhakim 2019 年 4 月 21 日
回答済み: Geoff Hayes 2019 年 4 月 22 日
I work on my project I have a problem
this is my program at the beginning i did it without the function structure then i wanted to put the function structure
as you see my function "my_sct" takes an image like input(image2 result from another program) and must give me an image (look workspace)
the problem is
when I run the program I see 0s and the picture result (output) is black
but when i use image2=imread('image2.jpg') to read the first output picture and i call my fonction "ma_sct(image2)" in commande window i have the correct result
so how to take the image from the first program without going through imread (from workspace)?

回答 (1 件)

Geoff Hayes
Geoff Hayes 2019 年 4 月 22 日
Bekhtaoui - you say that the function "my_sct" takes an image like input(image2 result from another program). What does this other program do? Your screen shot shows that the data type of image2 is double. Does that perhaps mean that the elements of this matrix are in the interval [0 1] instead of [0 255] which is maybe what your code is assuming? I think that when you say that you use image2=imread('image2.jpg') to read the first output and that this works, it could be because the units/data type is uint8.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by