How to determine that input is an image in MATLAB? -


Therefore the title is fully described in the entire question.

  ifchar (image_sorce) img = imread (image_sorce); And if Imatrix (image_source) img = image_sorce; End; End;   

But Imatics returns 0 when the input variable image_source is created with IMed.

& gt; & Gt; Help iamatrix

Immatics is true if input is a matrix. Returns the return (M) return [MN] with the non-integer integer values, m and n, and logical 0 (wrong) otherwise

  ismatrix (m) logical 1 returns true (m)    

If you check its behavior, you receive:

ismatrix (rand (10, Ismatrix (rand (10,10,10))

ans =

    

then Ismatrix will only work for 2-D variables Try combining the numeric with a probe on the size of the dimensions, for example, for the 3-D variable where the third dimension should be 3 Should, some (ndim (x) == 3 and size (x, 3) == 3) .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -