why my picture is 0s ?

1 vue (au cours des 30 derniers jours)
Bekhtaoui Abdelhakim
Bekhtaoui Abdelhakim le 21 Avr 2019
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)?

Réponses (1)

Geoff Hayes
Geoff Hayes le 22 Avr 2019
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.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by