Is the .jpg image one-dimensional and two-dimensional?

1 回表示 (過去 30 日間)
Huadong Hu
Huadong Hu 2019 年 5 月 14 日
コメント済み: Walter Roberson 2019 年 5 月 16 日
part code:
validateattributes(I,{'uint8','uint16','uint32'},{'real','2d'}, ... mfilename, 'I',1);
Problem:
The .m file needs to input a .jpg image,when i use the .jpg image downloaded from the Source website,it worked.
But when i use the .jpg image from my camera,it showed below:
Error using demosaic
The first input required, I, should be two-dimensional.
Is the .jpg image one-dimensional and two-dimensional?

回答 (2 件)

Image Analyst
Image Analyst 2019 年 5 月 14 日
JPG images are already demosaiced. I think you're using a raw image. Raw images usually are not demosaiced - they're just red, green, and blue pixels that are there, so no interpolation to fill in missing color values in the locations that didn't have a particular color pixel.
  7 件のコメント
Image Analyst
Image Analyst 2019 年 5 月 16 日
If it's part of your project, aren't you supposed to think up a way yourself?
Walter Roberson
Walter Roberson 2019 年 5 月 16 日
That is an unrelated topic and should be a question of its own.

サインインしてコメントする。


KSSV
KSSV 2019 年 5 月 14 日
If you have a RGB image it will be 3D matrix.
If you have a gray image it will be 1D matrix.
Try converting your image to gray.
I = imread(myimage) ;
I = rgb2gray(I) ;
  1 件のコメント
Huadong Hu
Huadong Hu 2019 年 5 月 14 日
編集済み: Huadong Hu 2019 年 5 月 14 日
how to use the code?add them to the demosaic.m file?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCamera Calibration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by