0

Now I'm researching on Image processing about interpolation. So I invented my new interpolation algorithms about image.

And I have to check SSIM value about my images that are interpolated by my interpolation algorithms.

Now I'm using ICY tool (On windows, GUI environment) but this tool is too hard to check large amount of images because of GUI interface.

So I want to check image SSIM value using matlab ssim function.

but I'm not a expert in matlab language, so I'm in trouble in dealing with import various name to ssim function.

This is what I want to do:

  1. I want to checks ssim value with a large amount of images.
  2. So I'm going to use sprintf function to make a valuable image name.
  3. The third I want to import this input image name to ssim function.

This is the code I used.

for n= 1 : 10
str = sprintf('./x2/cutted/x2_fn%d_4p_3p_cutted.bmp',n);
str_ori = sprintf('ori_%d.bmp',n);

img_cutted=imread(str);
img_ori=(str_ori);

[ssimval,ssimmap]=ssim(str,str_ori);
end

When I use this code, the error is invoked.

Error: The str must be the types of uint8, uint16, int16, single, double. but you used char value.

After I got this message, write "uint8 str;" but still the message is invoked.

halfer
  • 19,824
  • 17
  • 99
  • 186
박윤호
  • 19
  • 2
  • you mean `ssim(img,img_ori)`? Where do you get the error? – Ander Biguri Jul 26 '17 at 07:46
  • yes!, ssim(omg,img_ori) <- here is the error point – 박윤호 Jul 26 '17 at 08:48
  • I think the ssim function that is provided by tool box doesn't support char value... normally the ssim function is used like this "ssim('filename','filename');" – 박윤호 Jul 26 '17 at 08:52
  • https://kr.mathworks.com/help/images/ref/ssim.html this is the help of ssim function... someone plz help me..! – 박윤호 Jul 26 '17 at 08:53
  • of course the "error" is translated message, because I use matlab Korean ver. but that is the what error message said. – 박윤호 Jul 26 '17 at 08:55
  • You use them wrong I guess. `ssim` gets 2 images as input, not 2 strings. replace your code by `[ssimval,ssimmap]=ssim(img,img_ori);` – Ander Biguri Jul 26 '17 at 09:16
  • oh... I was idiot , So thank you. I think I was just nervous about I'm using matlab. I'm good at C and verilog but matlab language. anyway so thank you. – 박윤호 Jul 26 '17 at 15:44

1 Answers1

0

ssim gets 2 images as input, not 2 strings. replace your code by [ssimval,ssimmap]=ssim(img,img_ori);

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120