You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Error using rgb2gray parse input
1 view (last 30 days)
Show older comments
Hello,
I want to change an image into binary image, and I have the following code:
for i = 1: OBJ.NumberOfFrames
NUM = sprintf('%03d',i);
IMG_ORIGINAL = read(OBJ,i);
IMG_GRAY = rgb2gray(IMG_ORIGINAL);
IMG_BINARY = edge(IMG_GRAY,'canny',90/255);
IMG_EDGE1 = IMG_ORIGINAL;
IMG_EDGE2 = IMG_ORIGINAL;
imwrite(IMG_ORIGINAL, strcat(SAVEFOLDER1,'\ORIGINAL_',NUM,'.bmp'));
imwrite(IMG_GRAY, strcat(SAVEFOLDER2,'\GRAY_',NUM,'.bmp'));
imwrite(IMG_BINARY, strcat(SAVEFOLDER3,'\BINARY_',NUM,'.bmp'));
[y1,x1] = find(IMG_BINARY == 1);
for j = 1:length(x1)
IMG_EDGE1(y1(j),x1(j),1) = 255; % R
IMG_EDGE1(y1(j),x1(j),2) = 0; % G
IMG_EDGE1(y1(j),x1(j),3) = 0; % B
end
Then the following error appeared:
Error using rgb2gray>parse_inputs (line 80)
MAP must be a m x 3 array.
Error in rgb2gray (line 35) X = parse_inputs(X);
Can anybody help me with this, please? Thank you in advance
Answers (1)
Image Analyst
on 9 Jul 2014
What does this say
[rows, columns, numberOfColorChannels] = size(IMG_ORIGINAL);
Then try this:
if numberOfColorChannels > 1
% Only try to convert if it's a color image.
IMG_GRAY = rgb2gray(IMG_ORIGINAL);
else
% Already gray
IMG_GRAY = IMG_ORIGINAL;
end
19 Comments
Image Analyst
on 9 Jul 2014
You did not put the first line in , did you? Or if you did, check the spelling. Remove the semicolon from the end of the line and see what it spits out to the command window for the values of those variables.
Ulfah
on 19 Jul 2014
Dear Image Analyst, Thank you very much for the suggestions. Sorry that I could not get back to this earlier.
You were right. When I put the first line, nothing happened. Then I tried to erase the semicolon, and this appeared: >> [rows, columns, numberOfColorChannels] = size(IMG_ORIGINAL)
rows =
200
columns =
576
numberOfColorChannels =
1
then I erased the next semicolon signs, as below: >> if numberOfColorChannels > 1 % Only try to convert if it's a color image. IMG_GRAY = rgb2gray(IMG_ORIGINAL) else % Already gray IMG_GRAY = IMG_ORIGINAL end
IMG_GRAY =
Columns 1 through 28
20 16 12 20 16 20 16 12 16 12 16 20 16 20 16 16 16 12 12 24 12 16 16 12 12 20 16 12
20 20 12 16 12 8 20 12 20 16 12 16 24 12 20 12 16 12 16 16 16 16 12 20 12 20 8 12
12 12 12 16 12 16 12 20 16 16 8 16 12 8 16 16 16 12 16 16 12 16 12 12 20 20 12 12
16 16 12 16 20 16 16 16 24 16 20 16 12 12 12 16 16 20 12 16 16 16 16 12 16 16 12 12
16 20 12 12 16 16 16 20 16 16 16 16 12 12 16 20 16 16 16 16 20 16 12 12 16 12 12 4
16 12 16 16 20 16 254 16 16 16 20 254 24 20 16 12 12 12 16 8 12 12 16 12 12 8 8 20
16 20 16 20 20 16 254 254 16 12 20 254 16 16 16 20 16 12 16 16 16 12 16 20 12 16 16 16
16 12 12 16 12 24 254 254 12 16 20 254 12 12 20 16 12 12 16 12 16 12 8 12 12 20 20 16
16 12 16 20 16 16 254 16 254 16 12 254 16 16 12 254 254 254 12 16 254 254 254 12 254 254 16 16
16 20 20 16 16 16 254 20 254 16 16 254 12 16 20 12 16 12 254 12 254 16 12 254 12 12 254 12
20 8 16 12 20 16 254 12 16 254 20 254 20 20 16 254 254 254 254 16 254 16 12 254 12 20 254 12
20 12 20 16 16 12 254 16 16 16 254 254 16 16 254 8 16 12 254 16 254 16 16 254 20 20 254 12
16 12 16 12 12 16 254 12 16 16 254 254 16 12 254 16 16 12 254 12 254 12 12 254 12 12 254 12
20 24 16 16 20 16 254 16 16 16 8 254 20 16 16 254 254 254 254 16 254 16 16 254 20 16 254 8
20 16 12 20 20 16 20 12 20 16 12 16 12 16 16 12 16 16 12 16 16 20 16 12 16 16 12 12
12 16 16 12 20 16 8 20 16 16 16 16 16 12 8 12 12 20 12 12 16 16 16 16 20 12 16 12
16 12 16 16 16 16 16 12 20 12 16 20 16 12 12 12 16 12 16 12 12 8 12 12 16 20 16 16
20 16 20 12 12 16 16 12 16 16 16 20 16 8 20 16 20 16 12 12 12 12 16 24 12 8 16 12
16 20 20 16 20 16 16 16 16 20 12 16 20 16 16 16 16 20 12 16 16 16 4 16 12 20 12 20
12 20 16 20 12 16 12 24 16 12 20 20 16 12 12 16 16 20 16 12 12 16 16 12 16 20 4 12
16 12 12 16 20 16 16 12 16 12 16 16 20 20 16 20 16 24 12 16 16 20 16 12 12 16 16 12
24 8 16 16 16 16 16 20 16 16 16 16 12 16 12 16 16 12 16 16 16 16 16 12 12 16 12 16
16 20 20 16 16 16 12 12 16 16 16 16 12 12 16 16 16 16 16 16 20 12 16 16 16 16 12 12
20 16 16 12 12 8 12 20 16 16 20 16 16 16 20 16 20 16 16 12 20 8 16 12 12 12 16 12
16 20 16 20 20 16 16 20 12 12 12 24 8 12 12 16 16 16 20 16 20 16 16 12 16 16 12 16
16 12 16 12 20 16 12 16 16 16 16 16 12 12 20 16 16 16 12 12 20 12 16 16 16 20 16 12
16 16 16 12 20 24 16 16 16 16 16 12 12 16 12 16 12 12 12 16 16 16 16 12 16 16 16 12
16 20 12 20 16 16 16 24 16 16 16 16 16 12 16 16 16 12 16 12 16 16 20 12 12 16 16 12
20 12 12 20 12 16 16 16 16 16 8 16 12 12 12 16 12 16 12 24 16 16 16 8 16 12 12 20
20 20 16 16 16 16 16 12 20 16 16 16 20 12 12 12 16 12 12 12 12 20 16 12 12 16 16 8
20 20 12 12 16 16 16 12 16 16 16 16 12 16 16 12 8 12 12 16 16 16 12 12 16 20 12 8
20 16 16 20 12 20 16 20 16 8 12 16 20 16 8 16 20 12 12 16 16 16 16 16 12 12 16 16
20 12 12 12 12 16 12 12 16 16 12 16 12 12 12 16 12 12 12 12 12 16 8 20 16 12 12 16
16 12 12 12 20 16 12 20 16 12 12 16 16 16 20 16 12 16 12 16 12 16 16 12 16 12 12 16
20 16 24 16 16 16 16 12 20 16 20 12 12 12 20 16 16 20 12 16 12 20 16 12 12 12 16 12
16 20 12 12 20 16 16 16 12 16 12 16 12 16 12 16 16 12 12 16 8 16 8 8 12 20 16 12
12 16 12 12 8 16 16 16 20 12 20 16 12 16 16 20 20 16 16 4 12 12 12 12 12 12 16 12
20 12 16 12 16 16 16 20 16 16 12 16 12 12 8 16 20 12 12 16 20 12 16 16 16 20 12 16
16 16 24 12 8 16 16 12 16 16 12 16 12 16 16 12 16 12 16 16 8 16 16 20 12 20 16 16
20 20 12 20 16 12 16 8 16 16 12 12 16 20 12 20 20 16 16 16 16 20 16 16 12 16 12 12
16 12 16 12 16 16 16 12 16 12 20 16 24 20 12 16 16 12 16 12 20 16 16 12 12 20 12 16
16 8 16 20 16 12 16 12 16 16 20 16 20 20 16 16 16 12 4 16 16 16 12 16 20 16 16 12
16 16 20 12 20 16 20 12 12 20 16 12 16 12 20 12 12 16 12 20 12 12 16 12 12 8 16 16
12 12 16 20 16 16 16 12 16 20 12 16 16 12 16 16 12 12 12 12 16 20 8 16 12 20 16 12
12 16 12 20 12 8 16 12 12 12 8 16 12 12 16 16 12 20 12 16 20 16 12 12 12 16 16 12
20 12 12 16 20 16 16 12 20 16 20 16 20 16 12 16 16 16 12 20 16 12 12 20 12 12 12 20
16 16 20 16 16 16 16 16 16 16 12 12 12 12 16 12 12 8 12 12 16 20 12 20 20 8 12 16
12 12 20 16 20 12 16 8 16 16 8 16 24 12 20 16 24 12 12 12 16 16 16 12 12 16 16 16
16 20 16 16 12 20 16 16 16 16 20 16 16 12 16 12 12 12 12 16 16 16 16 16 12 8 8 12
12 8 20 12 20 16 8 20 16 12 16 16 16 20 16 16 12 16 16 16 16 16 16 12 12 16 12 16
20 12 12 16 12 16 16 12 16 8 16 12 16 20 12 16 20 16 12 20 12 12 16 12 16 16 12 12
16 20 12 8 16 16 16 16 12 16 20 12 12 16 8 12 16 16 12 16 16 16 16 16 20 24 16 12
16 12 20 16 12 16 16 20 12 16 12 16 20 12 12 24 8 16 12 12 16 16 12 20 12 16 16 12
16 16 12 12 16 16 16 20 16 16 12 24 20 12 16 16 16 12 12 16 16 12 12 12 12 16 8 12
20 20 16 16 12 16 12 16 16 16 16 16 16 24 16 16 16 20 20 12 20 20 12 12 16 12 12 12
20 12 12 20 12 16 8 12 16 16 20 16 16 12 12 16 16 8 16 12 16 16 16 12 16 20 12 16
8 16 20 16 20 12 16 20 8 12 20 16 12 20 16 16 16 12 20 16 16 16 8 12 12 8 16 12
20 20 20 12 16 12 16 12 20 16 16 16 24 20 12 16 16 24 12 16 20 12 16 16 16 12 12 12
12 12 16 12 20 8 20 12 16 16 12 12 16 16 8 12 16 12 16 8 16 16 12 12 16 12 16 12
12 20 16 12 16 16 16 24 12 16 16 20 20 12 16 16 8 20 20 12 8 12 16 12 12 12 16 12
20 16 20 16 12 20 16 16 12 16 16 20 12 12 20 16 20 20 16 16 20 12 12 12 12 12 16 16
16 16 20 16 16 16 16 24 16 12 16 16 16 12 16 16 16 16 12 16 16 16 16 12 12 12 16 8
20 12 16 12 20 20 16 12 16 16 12 16 16 16 8 16 20 16 12 12 16 8 16 16 16 16 16 12
8 12 12 20 16 12 16 20 16 12 12 16 16 12 8 16 16 16 12 16 12 16 8 16 16 20 12 12
20 20 16 16 16 16 16 12 16 12 20 16 12 12 16 16 12 12 16 12 20 16 20 16 12 12 16 16
12 20 16 16 16 16 20 16 20 12 16 16 16 16 16 16 16 16 12 12 8 8 12 16 20 16 12 12
16 12 16 16 20 12 16 20 16 8 20 16 24 16 16 16 16 16 12 16 12 16 16 16 16 12 12 16
12 16 20 12 20 8 16 16 16 12 20 16 12 16 12 20 16 12 24 12 12 16 24 16 12 16 16 12
16 16 16 20 16 12 12 12 16 16 20 16 16 20 12 20 16 12 20 16 20 16 20 16 12 16 16 12
16 20 20 12 20 16 16 20 16 16 16 12 20 12 8 16 16 12 16 16 16 16 16 12 12 20 16 16
16 20 12 12 20 12 16 12 12 16 12 16 24 12 12 16 8 12 20 12 16 16 16 20 12 16 16 12
12 8 12 16 20 16 16 12 16 16 8 16 12 12 20 16 20 8 12 12 20 20 20 12 12 20 16 12
20 12 20 24 16 16 16 12 16 16 16 16 16 16 16 12 16 16 12 16 16 16 16 12 16 16 16 12
20 20 12 12 20 16 16 12 16 16 12 16 16 12 12 16 4 12 12 16 12 20 16 20 12 16 16 12
24 20 16 12 12 16 16 20 16 16 16 16 20 12 20 12 8 16 12 4 12 16 16 12 16 12 12 12
16 20 12 12 12 16 16 12 20 16 16 16 16 12 12 16 16 12 16 20 16 12 16 12 12 20 12 12
20 16 20 12 20 12 20 20 16 12 12 16 12 16 16 16 12 16 16 16 8 20 16 12 20 16 16 20
16 16 16 12 16 16 12 12 16 16 8 16 12 16 16 8 16 16 12 20 16 20 12 8 16 12 16 16
16 16 12 12 12 16 16 12 16 16 20 16 16 16 12 16 12 20 12 16 16 16 16 12 12 20 16 12
16 20 24 12 12 16 16 12 12 12 12 16 12 12 20 12 16 12 12 16 16 16 16 16 12 12 16 12
12 12 12 16 8 16 16 16 12 20 12 16 20 8 20 20 16 20 16 16 12 16 16 12 12 20 16 12
20 16 12 12 20 16 16 16 16 16 16 16 12 12 12 16 16 12 16 16 8 16 16 12 16 16 16 20
20 12 16 16 16 16 16 16 16 16 12 16 12 16 20 16 20 12 12 16 16 16 12 12 12 12 16 12
20 20 12 12 16 12 12 16 16 16 20 16 12 16 12 16 12 16 16 12 12 12 16 16 12 12 20 20
16 16 16 20 20 16 16 12 12 16 20 20 12 12 16 12 16 20 16 16 12 16 16 20 16 12 12 24
16 12 12 20 16 16 16 12 16 16 20 16 16 20 16 20 16 20 20 16 12 16 16 12 16 12 24 16
20 16 8 16 20 16 16 20 20 16 16 16 16 12 20 16 20 12 16 16 20 16 16 16 24 12 16 20
16 12 12 16 20 16 16 12 16 16 12 12 16 12 16 16 16 16 16 12 20 12 16 12 12 20 8 16
20 12 16 12 16 16 16 20 16 16 20 16 12 12 16 16 24 16 16 16 20 16 16 12 12 20 16 12
16 16 12 12 16 16 16 12 16 16 16 16 16 20 16 16 16 12 12 16 20 16 16 12 16 16 16 12
20 16 20 12 12 16 12 16 8 16 20 16 16 20 12 16 16 16 12 12 16 16 16 20 16 20 8 12
20 12 12 12 20 20 16 12 16 16 16 16 16 16 12 16 12 12 20 16 12 16 16 12 16 16 16 12
16 20 16 12 16 12 16 12 16 12 16 16 16 12 8 20 16 16 12 12 12 20 16 12 24 16 16 20
20 16 12 12 16 16 20 16 16 16 12 20 12 16 12 16 16 12 12 16 12 20 16 12 12 12 20 8
20 8 16 16 20 12 16 12 20 16 8 16 12 20 16 20 16 12 16 16 20 16 16 12 16 12 16 12
16 20 16 16 12 16 20 16 20 16 20 20 20 16 20 16 16 16 16 20 16 20 16 20 16 12 12 16
24 20 16 12 12 16 16 16 16 16 20 12 16 16 12 16 20 16 16 12 16 16 20 16 16 12 16 12
20 20 12 16 20 12 16 12 16 12 16 16 12 12 16 16 20 12 16 16 20 16 20 16 16 20 20 16
20 20 16 12 20 12 16 12 16 16 20 16 12 16 20 16 16 16 20 20 12 12 16 16 12 20 20 12
16 20 12 20 20 16 16 16 16 16 16 16 16 16 16 16 16 12 12 16 16 16 12 24 20 12 8 20
16 12 16 12 20 16 20 12 8 16 12 16 16 12 20 20 12 16 20 16 20 16 16 12 12 12 16 24
20 12 12 16 20 12 8 20 20 16 20 24 16 12 16 20 12 12 12 16 20 16 16 20 16 24 20 16
12 16 12 12 16 16 20 24 20 16 16 16 16 12 12 8 16 20 20 16 16 16 12 20 16 20 16 20
16 16 20 12 16 16 16 16 20 20 16 16 16 20 16 16 16 16 12 20 16 8 16 16 20 20 16 20
16 12 20 12 12 16 16 16 16 24 20 16 20 16 16 12 12 16 16 20 16 12 16 16 12 12 20 20
16 20 20 16 20 16 16 16 20 12 16 16 16 20 20 16 16 12 20 20 12 16 16 20 12 16 20 20
20 20 16 20 12 8 16 20 16 20 12 16 16 20 16 16 16 12 20 20 16 12 16 12 16 24 20 20
16 20 16 12 16 16 16 20 12 20 12 16 20 12 16 12 16 16 16 16 12 16 16 16 20 16 16 12
12 8 16 12 20 16 20 12 16 16 20 16 16 24 16 16 16 16 16 16 8 20 16 16 16 24 16 12
20 16 12 12 16 16 20 16 16 16 16 16 12 16 16 20 16 20 12 20 16 16 16 16 24 24 20 20
20 16 12 12 20 16 16 20 16 20 16 16 16 20 16 20 20 12 16 16 20 12 16 20 20 16 20 16
8 20 16 20 16 16 20 16 16 20 12 16 16 16 20 16 16 16 12 16 12 12 16 12 16 20 16 16
12 12 20 20 20 12 16 16 20 12 12 16 16 20 20 16 16 12 20 20 20 16 16 12 12 20 16 12
20 20 12 16 20 16 20 20 16 16 12 28 20 16 16 20 12 20 16 28 12 16 16 16 16 20 16 16
16 12 12 24 20 16 12 20 16 16 16 20 16 16 16 16 16 12 20 16 20 16 16 12 20 16 16 20
12 20 16 16 20 16 16 20 12 20 20 16 20 12 16 12 16 20 20 20 16 16 16 20 20 28 16 20
16 20 16 24 20 16 16 16 16 16 12 20 20 16 12 16 20 12 20 20 16 16 16 12 24 20 20 20
20 16 12 20 20 24 16 12 20 16 20 16 20 20 20 16 16 12 24 20 12 24 24 24 20 20 16 16
20 16 24 20 16 16 20 16 16 16 12 16 24 16 20 20 16 20 16 16 20 16 20 16 20 20 20 20
16 16 12 16 20 24 16 20 20 20 16 24 16 16 20 16 20 12 12 16 24 16 16 20 12 24 20 24
16 16 12 12 20 16 16 12 28 16 16 20 16 24 12 16 24 20 20 16 20 16 24 20 20 20 16 16
20 20 20 20 20 24 16 12 16 16 12 16 16 16 16 20 24 16 24 16 20 16 16 16 16 20 20 24
16 20 20 20 20 24 24 24 16 20 20 16 16 12 16 20 16 20 16 24 20 16 24 20 24 24 16 24
16 20 28 16 16 16 16 20 16 16 20 20 20 16 20 20 16 16 20 20 20 24 16 12 12 20 24 24
16 20 16 16 16 16 20 16 16 16 20 20 16 20 20 16 16 20 20 20 24 16 20 16 12 16 24 16
20 24 16 16 20 16 16 20 16 20 16 16 20 20 20 16 16 12 16 20 16 20 24 12 16 20 20 24
20 20 24 20 20 16 16 16 16 16 16 16 16 20 16 20 24 24 12 16 12 16 20 20 12 20 20 16
16 20 20 16 20 16 16 24 16 24 16 16 24 20 20 20 20 16 20 20 20 20 16 20 24 20 20 20
20 12 20 20 20 16 20 24 20 16 20 16 24 24 20 16 16 20 20 20 20 24 16 12 20 20 16 20
24 20 20 16 20 20 24 12 16 12 20 16 24 20 24 20 16 16 20 16 20 20 16 20 20 28 16 20
24 20 16 20 24 20 20 12 20 20 20 16 24 16 20 20 20 16 24 16 20 20 28 20 20 20 20 24
24 16 12 12 20 20 16 20 16 16 12 16 16 16 20 20 16 20 24 16 16 16 20 24 24 20 20 12
16 20 20 24 20 24 12 24 24 16 16 20 16 16 24 16 24 20 24 16 24 20 16 24 16 24 20 24
20 20 16 24 28 28 16 20 20 20 20 20 16 20 20 20 24 20 20 24 20 20 20 24 20 24 20 20
20 20 24 12 24 24 16 16 20 20 16 16 20 24 20 16 24 20 20 24 20 20 28 12 24 20 24 24
24 16 12 16 20 20 16 24 24 24 16 20 24 20 16 20 20 20 20 28 20 20 24 20 20 20 16 20
20 20 20 12 20 20 16 24 20 16 16 16 16 16 16 20 16 12 20 16 16 16 20 24 16 28 16 16
20 16 16 12 8 24 16 24 24 20 20 16 24 24 20 16 16 20 24 24 20 16 16 24 16 20 20 20
16 20 16 24 20 16 24 24 24 12 16 16 20 16 16 16 20 24 20 24 20 20 28 24 24 24 20 24
20 20 16 12 20 16 24 24 16 16 28 16 16 24 20 28 20 20 24 24 16 20 20 24 24 20 28 24
20 20 16 12 20 20 20 16 16 16 12 20 20 20 24 20 24 24 20 28 20 16 20 24 20 20 28 24
20 16 24 24 16 16 16 24 16 16 20 16 24 24 24 24 24 24 24 20 20 16 20 24 16 20 16 16
16 20 20 16 16 12 24 16 28 16 20 24 24 20 24 24 16 16 16 20 20 28 20 24 24 28 16 24
24 20 20 24 20 20 20 20 20 20 24 20 24 24 20 20 24 16 20 24 32 20 20 24 20 20 28 20
20 20 20 24 20 24 16 20 20 28 20 20 24 24 20 28 24 24 24 20 24 24 28 24 24 20 24 24
20 20 20 20 24 16 20 24 20 24 24 24 24 16 20 20 16 24 20 24 20 24 20 24 24 28 24 28
16 20 24 16 24 20 24 24 28 24 20 24 24 32 20 28 20 16 24 24 24 24 28 24 16 28 32 32
20 20 24 24 20 16 24 24 16 20 20 20 24 20 28 20 28 24 20 24 20 28 20 24 32 32 36 48
28 20 24 24 16 24 24 16 20 16 20 20 24 20 24 16 20 24 24 28 20 28 20 24 36 40 52 60
20 20 16 24 16 16 24 20 16 20 20 20 24 20 28 24 24 28 20 28 24 28 32 36 48 68 64 60
20 20 16 20 24 20 16 16 16 20 28 24 24 20 24 28 28 20 24 28 28 32 44 48 60 64 60 60
20 20 16 20 20 16 16 24 16 24 24 28 24 24 20 28 24 20 24 32 32 40 56 64 64 56 56 48
20 24 20 28 20 16 20 24 28 20 24 24 24 24 20 24 28 28 36 40 48 56 64 64 60 52 40 40
20 20 24 24 24 24 24 24 24 20 20 24 20 24 20 24 28 36 44 60 68 56 64 56 52 44 40 44
28 20 16 24 20 20 28 20 24 16 24 28 24 28 32 28 40 48 60 56 56 52 52 52 44 48 40 44
24 20 24 20 28 20 28 24 16 24 24 24 24 24 32 52 56 60 72 64 56 48 44 48 44 44 40 36
20 16 20 20 20 24 20 24 20 24 32 24 28 36 48 64 64 56 64 52 52 44 48 44 40 40 44 36
20 20 20 24 24 20 28 24 28 28 28 28 36 52 56 60 60 60 48 44 44 40 40 36 36 32 40 36
24 20 24 24 24 28 20 20 32 36 32 40 52 64 64 60 52 48 44 40 44 44 40 36 36 40 40 36
20 20 20 24 20 28 32 32 32 40 40 64 60 56 48 40 52 44 36 48 40 40 44 40 36 36 28 40
20 28 24 20 20 28 28 28 40 48 60 60 60 44 44 40 48 44 36 44 36 40 32 36 32 32 40 36
28 24 24 24 24 28 32 48 52 60 52 52 48 48 44 48 40 36 36 28 40 40 36 28 36 32 36 36
24 24 28 28 36 52 48 52 56 52 52 48 48 40 40 40 36 36 36 32 32 36 36 32 36 40 40 36
28 28 24 36 56 64 56 60 60 48 44 44 44 48 32 40 36 36 40 32 32 36 28 36 36 32 36 24
28 28 40 44 68 60 52 52 52 44 44 48 36 40 40 36 32 36 36 36 36 40 32 32 24 32 28 36
32 28 44 60 56 48 48 44 40 40 36 40 36 36 36 40 36 36 36 28 36 36 32 32 36 32 36 32
32 44 68 60 56 52 44 36 36 40 40 36 32 36 36 40 40 36 36 40 32 28 40 36 36 32 40 36
48 52 52 48 44 44 32 44 40 36 44 40 36 40 32 36 36 36 36 36 36 40 28 28 36 36 36 36
56 56 52 44 44 40 40 40 28 40 32 40 32 32 32 36 40 36 32 36 40 32 32 32 36 40 40 44
52 40 36 36 32 36 40 36 40 36 40 40 36 36 36 40 32 36 36 36 36 36 28 32 32 32 44 32
44 44 36 36 36 40 32 36 40 32 32 32 36 36 32 36 36 36 36 32 40 32 32 28 48 36 32 32
44 32 44 32 40 36 32 40 32 36 32 40 24 36 32 40 36 28 36 36 32 32 40 32 36 36 40 119
36 32 32 36 32 44 36 36 32 32 36 32 36 36 32 32 32 36 32 36 32 36 28 28 32 32 55 185
32 32 28 36 36 36 40 36 36 36 28 28 28 32 40 28 36 36 32 36 32 32 40 32 32 36 185 55
40 32 36 36 32 32 32 36 32 28 32 24 32 36 32 28 36 28 36 32 32 32 28 36 28 102 119 28
32 28 32 32 36 36 28 36 28 36 32 32 24 28 32 36 28 28 28 32 32 28 32 32 36 194 24 24
32 36 36 32 32 32 32 36 28 28 32 32 36 28 32 40 32 36 28 28 36 24 32 24 166 75 20 24
28 36 36 32 32 36 32 32 36 32 36 32 32 32 32 36 28 36 36 28 32 28 28 90 150 24 28 20
28 32 32 36 32 28 36 36 40 32 32 36 36 36 28 28 28 32 32 32 28 28 28 204 24 20 20 24
36 36 28 28 32 28 36 32 28 36 36 24 36 36 32 36 28 24 24 32 28 24 150 90 24 20 24 24
32 32 32 28 32 28 36 36 40 28 32 40 36 32 32 28 28 24 32 24 24 55 166 20 24 24 16 75
36 32 32 36 36 32 40 102 194 194 194 194 194 185 194 194 194 194 194 194 194 194 16 24 16 20 24 16
32 32 36 36 36 32 32 32 166 55 36 28 32 24 32 28 20 28 24 20 20 20 28 20 24 20 28 20
32 32 32 32 32 28 32 36 28 204 28 36 24 24 24 32 20 16 20 24 24 24 16 12 20 16 16 24
32 32 36 32 32 32 32 24 28 28 166 28 24 28 32 24 28 20 20 24 24 24 20 20 24 20 16 16
32 32 32 32 32 32 28 36 28 28 102 119 24 28 20 16 20 20 24 20 24 24 24 28 24 24 16 20
32 32 36 32 32 36 32 40 28 28 24 150 75 28 20 20 20 24 24 20 28 20 20 20 20 20 16 24
32 28 36 36 32 32 28 28 28 28 20 28 194 24 28 20 24 24 20 24 20 24 20 16 20 20 16 24
32 36 36 36 32 36 28 24 28 28 28 28 16 185 20 20 20 20 24 20 24 16 20 12 20 12 24 16
32 32 32 36 28 28 28 28 24 24 24 20 24 102 137 24 24 20 24 20 20 20 20 24 20 24 20 24
32 28 24 32 32 20 28 24 24 24 20 20 28 20 137 90 24 24 20 20 16 24 24 20 20 20 16 16
36 36 32 28 24 28 24 24 24 20 24 16 24 20 20 185 28 20 16 20 20 16 20 20 16 20 24 16
28 32 28 24 24 24 20 24 16 28 20 20 28 20 24 28 204 20 24 16 24 24 20 24 20 16 24 20
32 24 28 24 24 24 28 24 24 24 20 24 24 20 20 24 75 166 24 20 20 20 20 20 20 20 24 24
20 32 28 24 20 24 16 150 204 204 204 204 204 204 204 204 204 204 102 16 16 16 16 16 12 20 12 24
20 24 24 16 20 24 28 20 24 24 20 28 24 24 20 20 28 24 20 20 24 20 20 16 20 20 16 24
32 20 20 20 28 16 16 20 16 24 28 28 24 16 20 20 28 20 24 20 20 16 20 24 24 20 16 24
20 24 28 24 20 24 24 20 24 20 20 12 24 24 20 24 20 24 24 20 24 28 24 28 20 24 20 24
20 28 16 24 20 28 20 24 16 20 24 16 20 16 24 20 28 20 24 28 20 16 24 24 24 20 24 20
28 24 20 24 20 28 24 20 20 28 16 16 24 24 28 20 28 24 20 24 20 16 24 24 20 20 16 16
Columns 29 through 56
8 8 16 20 16 12 12 8 12 12 16 12 12 16 16 12 8 16 16 12 12 16 12 8 12 12 12 16
16 16 16 16 16 16 16 16 12 12 12 12 12 16 16 12 12 12 12 12 16 8 20 12 12 20 12 12
16 12 20 16 12 16 12 12 12 12 8 12 16 12 16 12 12 16 16 12 16 12 16 16 16 12 16 16
16 20 8 16 8 16 20 12 16 12 12 12 16 16 12 8 16 16 20 16 8 20 12 16 16 12 16 12
16 12 20 16 12 16 8 16 12 12 16 16 16 8 16 12 20 8 16 12 12 16 16 20 20 16 8 16
16 12 20 16 16 20 8 16 8 16 4 12 254 254 254 254 254 16 12 16 16 12 12 8 12 20 12 16
16 20 16 12 16 16 12 16 12 12 16 12 16 12 254 16 12 16 16 12 12 8 16 12 12 12 12 16
12 16 20 16 12 12 16 12 20 16 16 12 12 16 254 12 16 12 12 20 12 16 8 8 12 16 12 12
12 254 254 254 12 20 254 20 12 8 16 16 16 16 254 16 16 16 20 16 254 254 254 16 12 16 254 254
254 12 16 20 254 16 16 20 16 12 16 12 16 16 254 12 16 12 8 254 16 16 16 254 16 254 12 12
254 254 254 254 254 16 16 16 12 12 8 12 16 8 254 16 16 16 12 254 254 254 254 254 12 8 254 12
254 16 16 20 16 12 16 12 12 12 16 12 12 8 254 16 8 16 20 254 16 20 16 16 12 12 20 254
254 20 12 12 254 12 12 16 12 12 12 16 16 16 254 20 12 16 16 254 12 8 16 254 12 254 16 12
16 254 254 254 16 16 254 12 12 12 16 16 16 4 254 16 12 12 12 16 254 254 254 12 12 20 254 254
16 12 16 12 16 16 20 16 16 16 20 12 12 16 16 8 12 16 16 20 12 16 12 12 12 16 12 16
16 12 16 12 20 12 16 12 16 20 12 12 24 16 16 20 16 16 16 24 16 12 16 12 16 16 20 12
20 16 16 16 8 20 16 12 12 12 12 12 16 16 16 8 16 16 16 12 12 12 12 16 16 16 16 16
12 16 16 16 16 8 12 16 12 12 12 12 12 16 12 12 16 12 12 20 16 16 12 16 12 12 16 12
16 16 16 16 8 12 12 16 8 16 16 20 16 8 16 12 20 16 8 12 12 8 12 12 16 8 12 12
16 12 12 8 12 12 8 24 12 12 16 12 16 16 16 8 12 16 16 20 12 12 16 16 16 12 12 20
16 12 20 16 20 12 20 16 12 12 16 12 16 16 20 8 12 12 12 20 12 20 12 8 16 12 12 12
20 12 16 16 12 12 16 12 16 12 12 12 12 16 16 16 8 12 16 16 16 12 16 12 12 12 16 12
12 12 20 16 12 20 20 12 12 16 16 12 16 16 20 12 20 16 20 16 8 12 16 12 16 12 12 12
16 16 20 12 8 12 16 20 16 12 12 12 12 16 16 16 16 16 4 12 8 16 8 16 12 8 16 16
16 16 16 16 16 16 16 12 12 12 8 12 4 16 12 8 20 16 16 16 16 16 16 16 16 12 16 12
16 12 16 16 16 16 12 16 12 12 12 12 4 16 12 16 8 16 20 12 16 20 12 12 12 16 4 20
16 16 8 16 16 12 12 12 12 12 16 12 16 12 16 8 8 12 20 16 16 8 16 12 12 16 12 12
16 12 16 12 16 20 16 12 12 12 16 12 16 16 20 12 16 16 12 12 12 12 16 8 12 12 16 12
20 8 16 8 12 12 20 12 20 12 12 12 8 16 12 12 8 16 8 16 16 20 16 12 16 16 12 8
16 12 12 16 16 16 16 12 12 12 16 16 16 12 16 16 12 8 16 12 16 8 16 16 16 20 12 16
16 12 20 16 12 12 8 16 12 12 16 12 12 16 16 20 12 16 12 20 16 12 8 16 12 20 12 12
8 12 16 16 16 24 12 16 16 12 12 12 8 12 12 8 12 12 16 12 16 8 16 12 12 12 12 12
16 12 12 20 16 12 12 12 16 12 16 20 12 16 16 16 16 16 8 16 16 8 20 16 16 12 16 12
16 12 16 12 12 16 8 12 20 12 16 12 20 16 16 16 12 12 16 12 12 8 4 16 16 16 16 12
12 16 20 20 16 12 16 12 12 16 16 12 12 16 16 16 16 16 12 12 16 12 16 12 12 16 20 16
16 12 16 20 16 12 12 12 16 8 16 24 12 16 16 16 16 16 16 16 12 12 16 12 12 12 12 16
16 16 8 16 16 16 12 12 16 12 16 12 16 12 16 8 8 8 16 12 20 8 12 16 12 12 20 12
16 12 12 16 16 20 8 12 12 12 16 16 12 16 16 12 12 16 12 20 16 8 12 16 12 8 16 12
16 16 12 16 16 12 20 12 12 12 16 20 8 16 8 12 16 8 16 16 12 16 16 12 8 16 12 12
16 12 16 12 16 12 8 16 16 16 12 20 8 12 12 20 12 12 16 12 20 12 8 12 12 12 12 16
16 12 20 16 16 12 12 20 20 12 16 20 16 8 16 16 12 16 16 12 16 12 16 16 16 12 12 16
16 16 20 20 16 12 12 16 20 12 16 12 24 16 16 20 12 16 20 16 16 12 12 16 16 12 12 12
16 12 20 16 12 12 12 12 16 12 16 12 16 16 16 20 12 16 8 24 16 12 16 16 16 12 12 12
12 12 20 16 16 12 20 12 16 16 16 16 16 16 16 12 20 16 12 12 16 20 16 16 12 12 16 12
12 12 12 16 16 16 12 12 16 16 12 16 12 12 12 8 8 16 8 12 16 12 16 16 12 12 12 12
16 12 16 8 16 12 12 12 12 12 8 12 8 12 12 16 16 16 12 16 12 16 12 16 12 20 12 12
12 12 12 16 16 12 8 16 12 16 16 12 16 16 12 16 16 16 12 12 16 20 12 12 12 12 16 16
16 12 16 16 12 12 20 16 16 12 16 12 16 16 8 12 16 12 16 16 16 12 12 16 12 12 12 12
12 12 16 16 8 12 12 16 16 12 16 8 16 16 16 16 8 16 12 20 12 12 16 12 16 12 12 12
16 12 16 16 8 16 12 20 12 16 8 16 12 16 12 16 16 16 16 16 16 16 12 12 16 12 12 12
12 12 16 12 12 12 8 8 16 12 12 12 12 16 12 8 12 16 8 12 16 8 16 16 12 16 12 12
16 12 16 16 12 12 16 16 12 12 12 20 16 12 16 20 20 16 16 16 16 16 16 12 16 12 12 16
12 16 16 12 8 12 8 20 12 20 16 12 12 12 16 16 12 16 8 12 12 16 8 16 16 12 16 12
16 16 16 20 20 12 12 16 12 12 16 20 12 12 16 12 16 12 20 16 16 16 8 16 12 12 16 12
12 16 16 16 16 12 16 16 20 16 12 20 16 16 16 12 20 16 8 20 12 12 16 16 24 12 16 16
16 20 16 16 16 12 12 16 12 12 12 20 16 16 12 16 16 12 16 12 16 12 16 20 16 16 0 12
16 8 16 16 16 12 8 16 12 12 12 12 16 16 16 12 12 16 12 16 16 8 12 12 16 12 16 12
12 16 12 16 12 16 8 12 8 12 12 12 8 20 8 20 16 12 16 12 16 12 16 12 12 16 12 20
12 16 8 20 16 12 12 12 12 12 16 16 16 16 16 20 8 16 8 12 16 12 12 8 12 12 12 12
20 12 16 12 12 16 12 20 16 16 8 12 16 12 12 16 8 12 8 12 12 16 16 12 16 20 12 16
16 12 20 12 16 12 20 12 16 12 16 20 16 16 12 12 16 8 12 12 12 12 16 12 16 8 12 12
8 16 20 16 16 16 12 12 16 12 16 12 16 12 16 20 8 16 20 16 16 16 16 16 20 12 16 12
16 12 20 16 16 16 8 12 12 20 12 12 16 16 16 12 8 16 16 16 12 12 12 16 12 16 16 20
16 12 12 16 16 12 8 16 20 16 16 12 16 16 12 12 12 16 8 16 16 12 12 16 20 16 12 16
16 8 16 16 12 16 12 16 16 16 16 16 16 16 16 20 16 12 12 16 12 12 16 16 20 12 12 16
16 8 20 12 16 16 16 12 12 16 16 12 16 12 20 20 8 12 12 12 12 12 16 16 16 12 12 16
16 16 20 12 16 12 16 12 12 16 16 12 16 16 12 12 12 16 16 16 16 16 16 16 12 24 12 16
12 20 12 16 16 12 12 12 12 12 28 16 16 16 16 12 16 16 8 20 16 20 16 12 12 16 16 20
16 12 16 16 16 12 16 12 20 16 12 12 16 12 16 16 12 16 12 12 12 16 12 16 12 12 16 16
16 12 16 20 16 16 20 8 20 8 16 12 12 16 20 12 12 16 16 24 16 12 16 16 12 8 12 16
16 12 16 16 16 12 12 12 16 12 16 16 16 8 12 16 20 20 20 16 8 20 16 16 16 24 20 16
16 16 16 16 16 16 16 12 12 16 16 16 20 16 20 16 12 16 16 20 16 20 16 16 20 16 12 12
16 12 20 20 20 20 20 12 16 16 16 16 16 20 16 12 16 16 16 16 12 16 20 16 20 16 20 24
12 12 12 16 16 16 8 16 16 12 16 12 20 8 16 16 8 12 12 12 20 12 16 16 24 24 16 24
16 16 12 12 16 16 16 16 16 12 16 12 16 16 16 12 12 12 8 20 16 20 24 16 20 20 20 12
16 16 16 16 12 12 16 12 12 12 16 12 16 12 8 16 20 20 8 20 12 20 16 16 16 12 12 12
12 12 20 12 16 16 16 12 16 20 12 16 20 16 16 12 16 20 16 12 16 8 16 16 12 12 12 12
12 16 12 12 16 12 12 12 16 12 20 20 16 16 16 16 20 16 8 24 16 12 16 12 16 16 16 12
16 24 28 16 12 20 16 12 12 16 16 20 12 16 12 16 16 16 20 12 16 20 20 16 12 12 16 12
16 12 20 16 16 12 20 20 16 12 20 12 16 20 16 12 16 20 20 16 16 20 16 16 20 16 12 16
16 12 12 16 16 16 12 20 16 20 8 16 20 12 16 12 16 16 16 16 16 12 16 8 16 12 12 16
16 12 16 16 16 16 8 16 16 16 16 16 8 16 16 16 16 16 12 16 16 20 16 16 20 20 12 12
16 8 8 16 16 16 20 16 16 16 12 16 16 20 20 20 12 16 16 24 16 12 16 16 16 20 16 20
16 12 20 16 16 16 16 16 16 12 12 16 8 12 16 16 20 16 12 24 16 20 16 20 16 16 20 12
16 12 12 16 16 12 20 12 16 20 16 20 20 16 16 12 12 20 20 12 16 12 16 16 24 20 24 20
12 16 16 16 16 16 16 12 16 12 16 16 16 16 16 16 16 16 16 20 16 16 16 16 12 16 16 16
16 12 16 20 12 12 20 20 16 20 16 12 16 16 16 20 16 12 12 16 16 12 12 8 20 16 16 12
16 12 12 16 20 16 8 16 20 12 16 16 16 16 16 16 16 20 16 16 16 20 16 16 20 16 12 20
16 16 20 8 16 12 16 12 20 12 16 12 16 16 12 16 12 16 16 16 20 12 16 16 24 20 20 12
16 12 20 16 12 12 20 20 12 16 16 12 16 12 16 16 16 16 16 16 16 16 16 16 12 16 16 16
16 16 12 16 16 16 12 16 12 8 16 24 20 16 16 16 20 12 12 16 16 16 16 16 16 20 12 20
12 12 12 12 16 12 12 16 16 16 16 16 16 16 16 16 16 16 16 20 20 20 16 16 12 16 12 16
12 16 20 16 16 16 16 12 16 20 12 16 16 16 12 20 16 12 20 16 16 12 12 16 12 16 12 20
16 16 16 16 20 20 20 20 12 24 16 12 16 16 16 16 16 20 16 20 16 16 20 16 20 24 16 20
20 16 16 16 16 16 16 12 16 24 16 12 12 12 16 20 16 12 16 20 20 16 16 20 20 20 16 20
16 12 20 12 16 16 20 12 12 12 16 20 16 16 20 16 20 12 16 20 20 16 12 16 20 24 20 20
12 20 16 16 16 20 16 16 16 20 16 16 16 20 16 16 16 16 16 16 20 12 24 16 16 24 12 16
16 24 12 16 16 12 12 20 12 20 16 16 16 16 20 12 20 16 20 24 20 12 16 16 24 20 20 12
16 20 20 16 24 24 16 20 12 16 16 20 16 16 16 20 20 16 16 24 20 16 12 16 16 24 20 16
20 20 16 12 20 16 12 24 12 12 16 12 16 20 20 16 20 8 20 16 24 20 16 16 20 16 16 20
16 12 16 16 16 16 12 12 16 24 20 24 20 20 16 16 16 16 20 16 16 20 12 16 16 16 12 24
16 12 12 16 16 16 20 16 20 16 24 16 20 16 16 20 20 16 20 20 16 20 16 16 16 16 20 12
16 12 20 20 16 20 16 12 20 20 12 16 8 16 16 16 20 20 20 20 16 16 12 16 16 16 16 12
20 20 16 16 24 12 16 16 20 12 20 12 20 16 20 20 12 16 20 12 16 20 20 20 16 20 16 16
16 24 20 16 16 16 8 24 16 16 16 20 16 16 12 16 16 16 20 12 24 20 16 20 20 16 24 16
16 16 16 20 16 16 16 20 16 12 16 12 28 20 16 20 16 20 16 20 16 24 20 16 16 20 24 16
16 20 20 16 16 24 20 24 16 16 20 20 24 16 16 16 20 16 20 24 16 16 16 24 16 16 16 16
16 16 16 16 16 20 16 20 16 20 16 20 28 12 16 16 20 20 24 16 20 16 16 24 16 24 24 24
16 20 20 20 20 16 20 16 16 12 24 12 16 16 16 20 16 16 24 16 20 20 16 20 20 16 24 24
16 16 16 20 16 20 20 16 16 24 16 12 16 16 20 16 20 24 24 16 16 20 16 16 16 24 24 20
24 24 16 16 16 16 16 12 24 20 24 16 16 16 16 20 16 20 20 20 16 16 16 20 24 16 20 20
16 24 20 16 24 16 16 24 12 12 16 12 20 16 20 16 20 16 20 16 16 20 24 16 24 24 16 20
16 16 28 20 16 24 12 16 20 24 20 16 16 16 16 20 24 20 20 20 20 20 20 16 24 16 24 20
24 16 16 16 20 20 12 24 16 20 16 16 16 24 20 20 8 16 16 20 24 20 20 20 20 20 28 20
24 16 20 16 20 16 20 16 20 12 20 16 16 24 12 20 16 24 16 16 28 16 16 20 24 16 20 20
16 20 20 20 12 24 20 20 24 16 20 24 24 16 16 20 20 20 20 12 20 20 16 28 20 20 24 12
16 20 24 16 24 20 20 16 12 24 20 16 16 16 20 16 16 20 16 20 28 20 16 20 20 20 20 16
12 16 20 20 16 16 20 20 16 16 12 20 24 16 20 20 20 16 20 24 16 20 16 24 16 20 16 20
20 24 20 16 20 20 24 20 12 20 16 12 24 16 24 20 20 20 20 20 16 20 16 20 24 16 16 24
20 16 20 16 24 20 20 24 20 20 24 24 28 28 20 20 16 16 20 16 28 20 16 20 20 16 16 20
16 20 12 16 20 24 20 20 20 16 16 24 24 16 16 16 20 20 20 16 20 20 16 24 20 20 16 16
24 20 24 16 16 12 20 24 20 12 16 20 20 16 16 20 24 20 20 16 20 20 20 28 20 24 24 24
20 20 20 20 20 24 20 24 12 20 16 24 28 20 24 20 20 16 20 16 24 20 16 16 16 24 24 16
20 24 20 20 16 20 12 24 20 20 12 20 16 20 16 20 20 16 20 24 20 20 24 24 16 24 28 24
20 20 20 20 20 24 20 12 20 20 16 24 16 24 16 20 20 16 24 20 24 12 24 24 16 20 24 24
16 16 24 28 20 16 16 20 24 20 16 20 20 24 20 20 24 16 20 20 16 20 16 16 20 24 20 28
20 24 20 24 24 20 20 24 24 24 20 24 20 28 24 20 24 16 20 16 16 20 28 24 20 20 24 20
16 20 24 16 16 20 20 20 16 24 20 24 20 16 20 20 16 16 20 20 28 16 16 24 20 24 20 24
24 24 24 24 28 16 20 20 20 24 20 20 16 24 20 24 20 28 24 20 16 20 20 24 24 28 24 32
24 16 16 16 28 24 20 24 24 24 20 20 16 24 20 28 16 20 12 24 28 20 28 24 24 24 36 36
20 28 20 24 24 12 20 16 24 24 20 20 20 20 12 20 20 16 24 20 20 24 24 28 28 40 48 60
16 24 12 24 24 24 20 24 20 24 20 20 16 20 24 20 20 20 20 28 20 24 28 28 44 64 64 72
20 24 20 16 20 24 24 24 20 16 28 16 28 24 20 20 24 28 24 28 28 32 40 56 72 76 72 72
20 24 20 24 24 24 16 24 24 12 16 16 24 24 28 24 24 28 32 32 36 48 56 64 72 72 64 64
20 16 24 20 20 20 20 20 20 24 20 20 16 24 28 20 24 32 44 48 60 64 68 68 76 56 52 44
16 24 24 20 24 20 16 20 20 20 28 20 24 20 20 24 32 40 64 72 68 68 64 56 60 52 48 44
20 20 16 20 24 16 20 24 24 20 28 24 24 24 28 40 52 60 72 72 64 64 56 60 52 44 40 40
16 20 20 20 20 20 28 16 24 24 20 24 28 32 44 56 56 68 68 72 60 56 48 52 48 44 44 36
20 24 28 24 16 24 24 24 24 28 28 28 40 48 52 68 60 64 60 48 48 48 48 44 40 48 40 32
20 24 24 28 28 24 28 24 28 32 40 44 56 56 76 68 56 52 52 44 36 44 44 40 40 36 44 36
24 20 20 24 24 20 28 28 36 36 44 60 68 64 64 52 52 44 52 48 44 44 40 36 40 36 36 36
16 24 24 28 24 20 24 56 60 60 68 60 64 64 56 56 52 40 44 40 44 44 40 40 40 44 40 36
24 24 28 24 28 36 44 72 72 72 68 68 52 52 52 52 44 40 40 48 44 40 44 36 36 40 32 36
28 24 28 32 36 48 60 72 68 60 56 48 44 44 48 52 56 36 44 40 40 32 40 40 40 40 44 40
28 24 40 44 48 56 68 64 64 48 52 48 40 40 36 44 40 40 44 36 40 32 40 40 40 40 40 36
28 48 48 52 64 72 68 56 48 48 48 40 40 36 40 40 40 40 36 36 40 40 36 40 36 40 40 40
40 56 72 64 64 56 52 48 48 44 40 48 40 40 32 36 40 40 44 44 40 36 36 32 36 40 36 36
60 60 60 64 52 52 48 36 44 44 40 40 40 40 40 36 40 40 32 36 36 40 40 36 40 36 44 36
64 56 56 52 44 40 40 36 36 40 40 36 40 32 36 32 36 36 40 36 40 36 40 36 36 32 40 36
52 60 48 48 44 40 40 36 36 36 32 36 40 44 40 36 32 36 40 36 36 36 40 40 36 40 36 36
52 48 44 40 40 36 36 36 40 36 40 40 36 40 40 40 36 40 32 36 40 32 36 40 36 36 36 36
48 40 44 40 44 36 44 36 36 40 40 36 28 40 36 44 36 40 36 36 40 36 40 28 44 36 36 40
44 36 40 36 44 44 36 36 40 36 44 28 40 32 40 32 36 40 36 36 40 36 40 40 44 36 32 40
40 36 40 36 36 36 32 40 36 32 32 36 36 40 40 32 40 36 32 36 36 36 36 28 36 36 36 36
36 44 36 40 32 36 36 40 36 40 40 36 40 28 32 44 40 40 36 44 40 40 40 32 36 32 36 32
32 40 36 40 36 36 36 36 36 28 36 44 40 36 32 36 36 40 32 36 44 36 40 28 28 28 24 24
36 32 40 32 40 36 44 36 36 40 32 36 40 32 40 36 40 36 40 36 32 32 36 28 36 24 32 28
40 40 40 36 36 36 48 40 32 40 40 36 36 32 36 32 40 36 36 36 32 32 28 28 24 28 28 24
36 36 40 28 40 32 32 36 36 40 40 36 36 40 36 40 32 36 32 36 28 32 24 20 24 20 24 20
36 36 32 40 36 36 36 36 36 36 40 36 40 40 40 36 36 40 32 32 32 28 24 28 24 24 20 24
40 32 40 32 36 36 36 36 36 32 40 36 32 36 36 32 28 40 28 24 20 24 28 28 24 24 24 20
36 32 32 36 36 36 36 36 36 36 36 36 36 28 40 40 36 24 24 24 24 28 20 24 20 20 16 20
36 32 32 36 32 36 32 36 36 36 32 36 28 32 28 32 28 28 28 24 20 20 16 16 20 16 20 24
40 36 32 40 119 119 32 36 36 36 32 28 32 28 28 28 20 16 28 24 28 12 24 24 20 16 20 24
36 36 40 40 194 185 36 36 36 28 28 32 28 24 28 20 32 20 28 24 28 20 16 20 12 20 24 20
32 36 32 166 55 55 166 32 28 24 28 24 24 20 20 24 16 28 20 16 28 20 24 16 24 20 24 28
36 36 90 137 36 28 137 102 28 24 28 32 24 24 28 20 20 20 20 16 20 20 20 16 20 24 16 24
40 36 204 32 28 36 32 204 24 28 20 24 24 28 24 20 20 24 28 24 20 20 16 24 28 20 24 24
32 166 90 28 32 28 24 75 150 24 28 24 20 16 20 20 20 16 24 24 24 20 24 20 24 20 20 16
90 219 36 28 28 28 32 24 150 75 28 24 28 20 24 16 24 16 20 20 20 20 20 24 20 16 20 16
219 119 24 28 24 24 24 20 20 204 24 20 24 28 20 20 20 24 16 20 20 20 20 16 28 16 20 12
166 102 36 28 24 24 24 20 16 90 137 12 24 28 16 20 24 16 12 24 24 16 20 24 20 20 16 16
150 75 24 20 24 20 16 24 20 24 166 55 16 24 16 20 20 16 28 24 24 20 20 24 16 12 16 20
137 102 28 24 24 20 20 24 24 20 37 185 28 24 20 20 16 20 16 20 16 16 24 20 24 24 20 24
90 137 16 24 20 20 20 20 24 20 28 119 119 20 16 20 20 16 20 24 16 20 24 16 20 20 20 24
24 204 29 24 24 20 20 24 12 24 20 24 194 37 24 20 20 24 20 16 20 20 20 16 16 16 20 16
24 150 75 16 16 28 24 20 20 24 20 16 55 166 20 16 20 20 16 16 16 20 16 16 24 28 20 20
24 20 204 75 20 16 20 20 16 16 20 16 24 137 90 28 16 24 16 24 20 20 28 16 24 24 24 20
20 24 194 166 119 16 16 20 16 16 16 24 16 24 204 20 20 16 20 20 20 20 16 12 24 24 20 20
24 166 75 20 102 185 37 20 20 16 20 20 24 20 75 150 16 24 20 24 28 20 20 16 28 24 24 16
166 150 20 16 20 55 194 102 20 20 16 20 16 20 16 166 75 16 20 20 20 20 20 16 16 24 20 24
119 204 185 20 20 24 16 137 166 24 20 24 20 24 16 16 204 185 194 194 194 194 194 194 194 185 194 194
24 137 166 219 90 20 20 24 75 204 75 16 16 20 16 20 20 16 20 16 16 16 20 16 20 24 24 20
20 194 16 219 150 185 55 16 20 20 150 137 20 16 20 20 20 20 20 16 24 20 16 16 24 16 16 20
90 137 20 219 16 55 166 150 37 20 16 90 194 55 20 20 20 20 20 24 20 20 24 20 16 24 24 166
102 119 16 219 20 24 20 75 194 137 24 16 33 185 119 20 20 16 16 20 24 20 16 20 20 16 119 119
119 119 24 219 20 16 20 24 24 102 204 102 24 20 119 102 24 16 20 24 24 20 16 12 16 75 166 20
102 137 16 219 16 24 20 24 16 16 20 119 150 16 20 90 24 20 20 20 16 20 20 20 24 204 16 20
55 185 32 219 24 24 16 24 24 75 166 194 90 28 24 20 20 20 20 20 20 20 24 16 185 55 24 24
20 194 20 219 20 20 55 137 204 137 75 24 20 16 16 20 16 20 16 24 24 20 24 137 90 16 28 24
24 119 137 219 102 185 185 102 29 16 24 20 16 24 20 20 20 24 20 20 24 16 90 150 28 24 24 16
24 55 219 219 137 55 24 24 20 24 16 24 20 16 20 20 20 20 20 24 16 37 194 20 24 24 20 24
16 166 166 219 24 12 20 20 20 24 20 20 16 16 28 20 20 20 28 24 20 194 16 16 16 12 12 16
24 24 185 119 20 28 20 24 20 24 24 28 20 20 24 24 20 20 28 28 150 75 24 24 28 16 20 16
16 20 204 16 16 16 20 20 20 12 16 20 20 20 24 16 20 20 20 102 204 204 204 204 204 204 204 204
24 16 20 28 24 20 24 24 24 20 20 16 16 24 20 20 20 24 28 24 24 24 20 20 20 16 24 24
16 20 16 16 20 20 20 20 24 16 20 16 28 28 24 20 20 28 24 24 20 20 16 20 24 20 12 20
16 16 20 20 16 20 12 24 24 16 24 20 20 16 20 20 16 24 16 20 20 20 20 16 20 20 20 24
20 16 20 20 16 20 20 24 20 24 20 20 20 20 16 24 20 24 24 24 20 20 20 24 16 24 20 24
16 24 16 20 16 20 20 28 16 24 20 24 16 24 20 24 24 20 20 16 20 24 24 24 24 24 24 20
Columns 57 through 84
<pre> 16 16 12 12 12 16 8 12 12 8 12 12 12 16 16 8 16 12 12 12 8 16 8 8 8 8 12 12
12 16 16 12 16 12 12 12 12 16 8 12 20 16 12 12 12 12 12 12 16 12 12 12 16 8 12 8
16 8 8 16 16 12 16 16 12 16 8 20 16 16 16 8 16 12 12 12 12 12 12 12 16 12 12 16
12 16 12 16 16 16 16 12 12 20 12 12 16 16 16 16 16 12 12 12 16 12 8 16 12 20 16 16
12 12 12 16 12 12 8 16 12 8 8 12 8 20 8 8 12 16 16 16 12 12 12 16 12 12 16 16
12 12 12 16 16 16 12 20 8 16 8 254 16 20 16 12 254 12 12 12 12 12 20 12 16 12 16 12
12 16 254 16 12 16 12 16 12 12 12 254 254 16 12 8 254 12 16 12 16 12 16 20 16 8 12 16
12 16 254 12 4 16 8 16 12 8 16 254 254 20 16 16 254 12 8 16 16 12 20 16 16 8 16 12
12 12 254 254 12 12 12 16 12 8 12 254 8 254 12 8 254 12 8 12 254 254 254 16 16 254 254 12
254 20 254 16 12 8 12 12 12 16 16 254 16 254 16 20 254 12 16 254 12 12 12 254 12 254 16 16
12 12 254 20 16 12 16 16 12 16 16 254 16 12 254 20 254 12 12 254 12 16 16 254 16 254 16 8
12 8 254 16 16 8 12 12 12 20 16 254 8 12 16 254 254 16 16 254 12 12 20 254 16 254 8 16
254 20 254 12 16 12 16 16 12 20 16 254 8 12 8 254 254 12 12 254 12 16 12 254 16 254 12 16
24 20 16 254 16 12 254 8 12 12 8 254 16 16 12 8 254 12 20 12 254 254 254 20 16 254 16 16
12 16 20 16 12 254 8 12 12 12 8 8 12 12 16 12 16 12 16 12 12 12 16 12 12 12 8 16
12 12 8 16 12 12 16 16 12 12 8 12 16 16 12 16 16 12 16 16 12 12 8 16 8 16 16 8
12 16 16 20 16 16 16 16 12 16 20 20 8 12 16 12 12 12 12 8 12 12 20 8 16 20 16 16
12 12 12 16 8 12 12 12 16 16 8 20 8 12 16 8 8 16 12 12 16 12 16 16 16 16 16 12
12 16 12 16 16 8 16 12 12 12 16 8 8 8 16 8 12 12 16 8 12 16 16 12 16 16 16 8
8 12 16 16 16 16 12 8 16 12 20 12 12 16 16 16 12 12 8 12 12 12 12 16 16 16 8 12
12 12 12 12 16 12 12 12 12 12 20 16 16 12 8 12 20 12 16 20 12 12 12 12 8 8 12 16
12 12 20 16 8 8 12 16 12 12 16 16 8 12 16 8 16 12 16 12 16 12 16 12 16 16 20 8
16 20 16 12 16 16 12 12 12 16 16 16 16 12 16 12 16 12 12 12 12 12 20 12 16 16 12 12
20 8 16 8 12 12 8 16 16 16 12 12 12 12 16 16 16 24 16 12 16 12 12 16 16 8 16 12
12 12 16 16 12 8 16 16 12 12 12 16 16 12 4 8 16 20 16 12 16 12 12 12 16 20 16 20
12 16 16 16 16 16 4 16 16 16 8 12 8 16 8 12 16 12 16 16 12 12 12 20 20 12 20 16
12 12 16 8 16 12 4 16 12 12 8 8 8 16 16 12 16 20 16 12 16 12 20 12 16 20 16 16
12 12 8 16 16 12 16 12 12 8 20 16 16 8 12 8 16 16 16 16 12 12 16 16 16 20 16 12
16 16 16 4 16 12 8 12 12 12 12 12 12 16 8 12 8 12 16 12 12 16 20 12 16 20 16 12
12 12 8 12 16 12 12 16 12 12 16 12 8 20 16 20 20 12 12 16 12 12 20 16 12 16 16 8
12 16 8 20 12 16 12 12 12 8 12 16 8 12 16 12 16 12 8 12 12 12 8 20 8 12 16 8
16 20 12 16 12 20 12 16 12 12 12 12 12 16 12 8 12 12 16 12 20 24 20 16 20 16 16 16
12 16 12 20 12 12 8 16 12 16 16 16 20 20 12 16 16 12 8 12 16 16 8 12 16 12 12 16
12 12 8 12 16 16 16 12 12 16 8 16 16 12 16 16 20 12 16 20 16 16 20 16 16 16 12 16
20 20 12 12 16 12 16 16 12 12 16 20 8 20 16 20 16 16 8 12 16 12 20 12 12 16 4 16
12 20 12 16 16 8 16 20 16 20 12 12 16 16 16 8 16 12 16 16 12 8 8 12 16 16 12 12
12 16 12 12 8 12 12 12 16 20 16 12 16 12 12 12 16 20 16 12 12 12 8 12 12 16 12 8
12 16 20 16 20 16 12 20 16 12 20 12 12 12 16 16 16 12 20 12 12 16 12 16 16 20 16 16
12 16 20 12 16 12 12 16 8 12 16 16 16 12 16 16 8 12 16 12 12 16 20 16 12 20 8 16
16 16 12 16 16 12 12 16 12 12 8 12 12 12 16 12 16 12 16 12 16 12 16 12 16 16 8 12
12 20 16 16 16 16 12 16 12 16 16 12 8 16 12 20 16 20 20 12 12 12 8 16 16 12 16 16
12 20 16 16 16 12 16 12 16 16 12 16 16 12 16 20 8 16 20 12 16 4 16 16 20 20 20 16
12 16 12 12 16 12 16 16 12 8 16 8 12 20 8 20 8 16 16 12 12 12 16 16 16 12 16 16
12 12 16 16 16 12 12 12 12 12 16 12 16 20 16 12 8 16 20 12 12 12 20 12 12 20 24 12
12 16 12 12 16 12 12 16 12 16 12 16 12 12 12 16 16 8 16 16 16 12 20 12 16 16 16 16
20 12 8 16 16 16 16 8 16 12 16 8 8 12 20 12 16 12 8 12 16 12 12 16 16 12 12 16
16 16 20 16 16 12 16 16 8 20 8 12 12 12 16 16 8 12 12 16 12 12 16 12 12 20 12 16
12 16 16 12 16 16 16 16 12 12 16 12 8 20 16 16 16 20 12 12 8 16 12 16 20 16 12 16
12 20 12 16 12 20 12 16 12 12 16 12 12 12 16 20 16 16 12 20 12 20 16 16 16 8 16 16
12 12 16 12 16 8 12 16 12 12 8 12 12 12 16 16 16 12 16 12 8 16 16 8 16 16 16 16
12 20 12 16 16 12 12 16 12 20 16 12 16 16 16 12 16 16 16 12 16 20 16 16 16 8 12 28
12 12 20 12 20 16 12 16 16 20 8 20 8 12 20 16 12 16 16 12 12 16 16 16 12 8 16 8
12 20 20 20 16 16 12 16 12 12 12 12 12 12 16 12 16 12 20 16 12 12 20 8 20 20 16 16
12 20 12 12 16 12 16 12 12 12 8 16 12 12 16 12 16 12 16 12 16 16 20 20 16 20 16 12
12 16 20 16 16 12 16 12 12 16 16 20 20 20 12 12 16 12 16 20 16 12 20 16 16 16 16 12
12 16 12 8 16 12 16
Image Analyst
on 20 Jul 2014
Put the semicolons back. You have a grayscale image, so don't call rgb2gray or you will get the error you say. Instead of this:
IMG_ORIGINAL = read(OBJ,i);
IMG_GRAY = rgb2gray(IMG_ORIGINAL);
say this:
IMG_GRAY = read(OBJ,i);
Ulfah
on 21 Jul 2014
Dear Image Analyst,
Thank you very much for your answer. I put the semicolons back and change the command as you said, also edited other parts which mentioned image original and rgb2 gray.
Another error came: Error using imwrite (line 454) Unable to open file "C:\Users\Ulfah Rimayanti\Desktop\ulfah\Test_Normal_Right_29032012_141908\GRAY\GRAY_001.bmp" for writing. You may not have write permission.
So i think it may be better to put the whole command here: Original command: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% 2014/01/27 %%% %%% kiuchi.m %%% %%% Šá‹…•ÏˆÊ‰ð͈˗Š‚̃vƒƒOƒ‰ƒ€ %%% %%% %%% %%% 2.ƒƒCƒ“ƒtƒHƒ‹ƒ_‚ÌŽw’è %%% %%% 3.“Ç‚Ýž‚Ý“®‰æƒf[ƒ^Žw’è %%% %%% 1.‰Šú‰» %%% %%% 4.˜A”ԉ摜‚É•ÏŠ· %%% %%% 5.‰~‹ßŽ—‚Ì‚½‚ß‚ÌpixelÀ•Wƒf[ƒ^‚Ì“Ç‚Ýž‚Ý %%% %%% 6.‰~‹ßŽ—ƒAƒ‹ƒSƒŠƒYƒ€ %%% %%% 7.‹ßŽ—Œ‹‰Ê‚Ì•\Ž¦ %%% %%% 8.•ÏˆÊ—Ê‚ÌŽZo %%% %%% 9.ŽÀۂ̕ψʗʂւÌZ³ %%% %%% 10.‰ðÍŒ‹‰Ê‚Ìcsv•Û‘¶ %%% %%% 11.ƒGƒ‰[ƒJƒEƒ“ƒg‚Ì•\Ž¦ %%% %%% 12.•â‘«@ƒGƒbƒWŒŸo•û–@‚Ì‚¢‚ë‚¢‚ë %%% %%% by Shohei Uemura %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ‰Šú‰» clear; close all; tic;
errcount = 1; % ƒGƒ‰[ƒJƒEƒ“ƒg
%% ƒƒCƒ“ƒtƒHƒ‹ƒ_‚ÌŽw’è MAINFOLDER = 'C:\Users\Ulfah Rimayanti\Desktop\ulfah';
%% “Ç‚Ýž‚Ý“®‰æƒf[ƒ^Žw’è FILENAME = 'Test_Normal_Right_29032012_141908'; % “Ç‚Ýž‚Ý“®‰æ‚¨‚æ‚уTƒuƒtƒHƒ‹ƒ_–¼ LOADFILE = strcat(MAINFOLDER,'\',FILENAME,'.avi'); % “Ç‚Ýž‚Ý“®‰æ‚ÌŽw’è OBJ = VideoReader(LOADFILE); % \‘¢‘Ì,ƒ}ƒ‹ƒ`ƒƒfƒBƒAƒŠ[ƒ_ƒIƒuƒWƒFƒNƒg‚Ìì¬
%% ˜A”ԉ摜‚É•ÏŠ· SAVEFOLDER1 = strcat(MAINFOLDER,'\',FILENAME,'\ORIGINAL'); % Œ³‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER2 = strcat(MAINFOLDER,'\',FILENAME,'\GRAY'); % ƒOƒŒƒC‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER3 = strcat(MAINFOLDER,'\',FILENAME,'\BINARY'); % “ñ’l‰»‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER4 = strcat(MAINFOLDER,'\',FILENAME,'\EDGE1'); % ƒGƒbƒW’Šo‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER5 = strcat(MAINFOLDER,'\',FILENAME,'\EDGE2'); % ƒGƒbƒW’Šo‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER6 = strcat(MAINFOLDER,'\',FILENAME,'\PIXEL'); % ŠeƒtƒŒ[ƒ€‚̃GƒbƒWÀ•Wcsvƒf[ƒ^‚Ì•Û‘¶ƒtƒHƒ‹ƒ_
for i = 1: OBJ.NumberOfFrames % ƒtƒŒ[ƒ€”‚¾‚¯ŒJ‚è•Ô‚µ
NUM = sprintf('%03d',i); % ”Ô†‚𕶎š—ñ‚É•ÏŠ·
IMG_ORIGINAL = read(OBJ,i); % i”Ԗڂ̉摜‚ð“Ç‚Ýž‚Ý
IMG_GRAY = rgb2gray(IMG_ORIGINAL); % ƒOƒŒƒC‰æ‘œ‚É•ÏŠ·
IMG_BINARY = edge(IMG_GRAY,'canny',90/255); % ƒj’l‰»‰æ‘œ‚É•ÏŠ·
IMG_EDGE1 = IMG_ORIGINAL; % Œ³‰æ‘œ‚ɃGƒbƒW‚ðã‘‚«
IMG_EDGE2 = IMG_ORIGINAL; % Œ³‰æ‘œ‚ɃGƒbƒW‚ðã‘‚«
imwrite(IMG_ORIGINAL, strcat(SAVEFOLDER1,'\ORIGINAL_',NUM,'.bmp')); % ORIGINALƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
imwrite(IMG_GRAY, strcat(SAVEFOLDER2,'\GRAY_',NUM,'.bmp')); % GRAYƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
imwrite(IMG_BINARY, strcat(SAVEFOLDER3,'\BINARY_',NUM,'.bmp')); % BINARYƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
[y1,x1] = find(IMG_BINARY == 1); % “ñ’l‰»‰æ‘œ‚̃GƒbƒWÀ•W(”’F•”•ª)‚ð’Šo
for j = 1:length(x1) % ”’F•”•ª‚ðÔ‚É‚µ‚ÄŒ³‰æ‘œ‚Éã‘‚«
IMG_EDGE1(y1(j),x1(j),1) = 255; % R
IMG_EDGE1(y1(j),x1(j),2) = 0; % G
IMG_EDGE1(y1(j),x1(j),3) = 0; % B
end
imwrite(IMG_EDGE1, strcat(SAVEFOLDER4,'\EDGE1_',NUM,'.bmp')); % EDGE1ƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
% ’Tõ—̈æ‚ÌŽw’è
x_start = 50;
x_end = 565;
y_start = 50;
y_end = 175;
% ’Tõ1‰ñ–Ú(o”“_‚Ì’Tõ)
k = 1; % ƒJƒEƒ“ƒg
X = x_start; % Žn“_xÀ•W
for Y = y_start:y_end
if IMG_BINARY(Y,X) == 1 % ”’•”•ª‚Ìê‡
x2(k,1) = X; % x2‚ÉŠi”[
y2(k,1) = Y; % y2‚ÉŠi”[
break % Œ©‚‚©‚Á‚½ê‡break
end
end
% ’Tõ2‰ñ–ÚˆÈ~
k = k+1; % ƒJƒEƒ“ƒgXV
for X = x_start+1:x_end % Žn“_xÀ•W
if IMG_BINARY(y2(k-1,1)-1,X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1)-1;
elseif IMG_BINARY(y2(k-1,1),X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1);
elseif IMG_BINARY(y2(k-1,1)+1,X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1)+1;
else
x2(k,1) = X;
y2(k,1) = y2(k-1,1);
fprintf('‘O‚̃f[ƒ^‚ðŒp‘±‚µ‚Ü‚µ‚½D');
fprintf('EDGE1_%d–‡–Ú‚Ì(%d,%d)‚ðƒ`ƒFƒbƒN\n',i,y2(k,1),x2(k,1));
errcount = errcount+1; % ƒGƒ‰[ƒJƒEƒ“ƒg‚ÌXV
%return
end
k = k+1; % ƒJƒEƒ“ƒgXV
end
for j = 1:length(x2) % ‰æ‘œ‚Ìã‘‚«
IMG_EDGE2(y2(j),x2(j),1) = 255; % R
IMG_EDGE2(y2(j),x2(j),2) = 0; % G
IMG_EDGE2(y2(j),x2(j),3) = 0; % B
end
imwrite(IMG_EDGE2, strcat(SAVEFOLDER5,'\EDGE2_',NUM,'.bmp')); % EDGE2ƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
% ƒGƒbƒWÀ•W‚ÌŠi”[
csvwrite(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),[x2,y2]); % PIXELƒtƒHƒ‹ƒ_‚ÉÀ•Wƒf[ƒ^‚ð•Û‘¶
fprintf('%d\n',i);
end
%% ‰~‹ßŽ—‚Ì‚½‚ß‚ÌpixelÀ•Wƒf[ƒ^‚Ì“Ç‚Ýž‚Ý pixel = csvread(strcat(SAVEFOLDER6,'\PIXEL_001.csv')); % PIXELƒtƒHƒ‹ƒ_‚Ì1–‡–Ú x = pixel(:,1); % 1—ñ–Ú y = pixel(:,2); % 2—ñ–Ú
%% ‰~‹ßŽ—ƒAƒ‹ƒSƒŠƒYƒ€@@@ˆø—pŒ³Fhttp://www.mathworks.co.jp/support/solutions/ja/data/1-9LTS7Y/index.html?solution=1-9LTS7Y
% ‰Šú’l‚ðŽw’è a0=[x‚̉Šú’l, y‚̉Šú’l, ”¼Œa‚̉Šú’l] a0 = [mean(x),mean(y),max(x)-mean(x)];
% ‰~‚Ì•û’öŽ®‚ɃtƒBƒbƒeƒBƒ“ƒO‚·‚éŒW”a(1)Aa(2)Aa(3)‚ð‹‚ß‚é f = @(a) norm((x-a(1)).^2 + (y-a(2)).^2- a(3).^2);
% fminsearchŠÖ”‚É‚æ‚éƒtƒBƒbƒeƒBƒ“ƒO af2=[‹ßŽ—‰~xÀ•Wa, ‹ßŽ—‰~yÀ•Wb, ‹ßŽ—‰~”¼Œar] af2 = fminsearch(f, a0);
% ‰~‚Ì•û’öŽ® eq = ['(x-',num2str(af2(1)),')^2+(y-',num2str(af2(2)),')^2=',num2str(af2(3)),'^2'];
% ‰~‚Ì•`‰æ figure; ezplot(eq,[min([af2(1)-af2(3),af2(2)-af2(3)]),max([af2(1)+af2(3),af2(2)+af2(3)])]); hold on;
% ’†S“_‚ÆŒ³ƒf[ƒ^‚Ì•`‰æ plot(x,y,'*r',af2(1),af2(2),'.b'); xlim([af2(1)-af2(3)-af2(3)/10, af2(1)+af2(3)+af2(3)/10]); ylim([af2(2)-af2(3)-af2(3)/10, af2(2)+af2(3)+af2(3)/10]); axis equal; hold off;
%% ‹ßŽ—Œ‹‰Ê‚Ì•\Ž¦ a = af2(1); % ‹ßŽ—‰~xÀ•W a [pixel] b = af2(2); % ‹ßŽ—‰~yÀ•W b [pixel] r = af2(3); % ‹ßŽ—‰~”¼Œa r [pixel] fprintf('a = %10.6f, b = %10.6f, r = %10.6f\n', a, b, r); % •‚“®¬”“_Œ^
% ‰æ‘œ‚Ö‚Ìã‘‚« IMG_CIRCLE = imread(strcat(SAVEFOLDER1,'\ORIGINAL_001.bmp')); % ‘‚«ž‚݉摜‚Ì“Ç‚Ýž‚Ý x_circle = [1:OBJ.Width]'; y_circle = round(-sqrt(r.^2-(x_circle-a).^2)+b); for j = 1:length(x_circle) % ‹ßŽ—‰~‚ð—΂Ō³‰æ‘œ‚Éã‘‚« IMG_CIRCLE(y_circle(j),x_circle(j),1) = 0; % R IMG_CIRCLE(y_circle(j),x_circle(j),2) = 255; % G IMG_CIRCLE(y_circle(j),x_circle(j),3) = 0; % B end imwrite(IMG_CIRCLE, strcat(MAINFOLDER,'\',FILENAME,'\CIRCLE.bmp'));
% a = round(a); % a‚Ì®”Œ^ŠÛ‚ß % b = round(b); % b‚Ì®”Œ^ŠÛ‚ß % r = round(r); % r‚Ì®”Œ^ŠÛ‚ß % fprintf('a = %-10d, b = %-10d, r = %-10d\n', a, b, r); % ®”Œ^
%% •ÏˆÊ—Ê‚ÌŽZo
% ’Tõ“_‚Ì}10pixel‚Ì•½‹Ï‚ðŽZo
for i = 1: OBJ.NumberOfFrames % ƒtƒŒ[ƒ€”‚¾‚¯ŒJ‚è•Ô‚µ
NUM = sprintf('%03d',i); % ”Ô†‚𕶎š—ñ‚É•ÏŠ·
d_0(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.0*r+a)-x_start-10,1,[round(0.0*r+a)-x_start-10 1 round(0.1*r+a)-x_start+10 1])); % æ’[•”
d_1(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.1*r+a)-x_start-10,1,[round(0.1*r+a)-x_start-10 1 round(0.1*r+a)-x_start+10 1])); % Žü•Ó•”1
d_2(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.2*r+a)-x_start-10,1,[round(0.2*r+a)-x_start-10 1 round(0.2*r+a)-x_start+10 1])); % Žü•Ó•”2
d_3(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.3*r+a)-x_start-10,1,[round(0.3*r+a)-x_start-10 1 round(0.3*r+a)-x_start+10 1])); % Žü•Ó•”3
d_4(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.4*r+a)-x_start-10,1,[round(0.4*r+a)-x_start-10 1 round(0.4*r+a)-x_start+10 1])); % Žü•Ó•”4
d_5(i) = mean(csvread(strcat(SAVEFOLDER6,'\PIXEL_',NUM,'.csv'),round(0.5*r+a)-x_start-10,1,[round(0.5*r+a)-x_start-10 1 round(0.5*r+a)-x_start+10 1])); % Žü•Ó•”5
end
% —ñƒxƒNƒgƒ‹‚É•ÏX d_0 = d_0'; d_1 = d_1'; d_2 = d_2'; d_3 = d_3'; d_4 = d_4'; d_5 = d_5';
% •ÏˆÊ—Ê‚ÉŠ·ŽZ d_0 = d_0-d_0(1); d_1 = d_1-d_1(1); d_2 = d_2-d_2(1); d_3 = d_3-d_3(1); d_4 = d_4-d_4(1); d_5 = d_5-d_5(1);
% ƒOƒ‰ƒt•\Ž¦ t = [0.134:0.231:32.012]'; t(1)=0; figure(); plot(t,d_0,t,d_1,t,d_2,t,d_3,t,d_4,t,d_5); xlabel('Time [ms]'); ylabel('Displacement [pixel]'); legend('d0','d1','d2','d3','d4','d5'); grid;
%% ŽÀۂ̕ψʗʂւÌZ³
% Šá‹…‹ßŽ—‰~”¼Œar [pixel] = Šp–Œ‹È—¦ 7.8 [mm] ‚Æ‚·‚é cor = 7.8/r*1000; % Z³’l [ƒÊm/pixel]
% Z³ d_0 = d_0*cor; d_1 = d_1*cor; d_2 = d_2*cor; d_3 = d_3*cor; d_4 = d_4*cor; d_5 = d_5*cor;
% ƒOƒ‰ƒt•\Ž¦ figure(); plot(t,d_0,t,d_1,t,d_2,t,d_3,t,d_4,t,d_5); xlabel('Time [ms]'); ylabel('Displacement [\mum]'); legend('d0','d1','d2','d3','d4','d5'); grid;
%% ‰ðÍŒ‹‰Ê‚Ìcsv•Û‘¶
fid = fopen(strcat(MAINFOLDER,'\',FILENAME,'\result.csv'),'w'); % ‘‚«ž‚݃‚[ƒh fprintf(fid,'Time [ms],d_0 [ƒÊm],d_1 [ƒÊm],d_2 [ƒÊm],d_3 [ƒÊm],d_4 [ƒÊm],d_5 [ƒÊm]\r\n'); for l = 1:OBJ.NumberOfFrames fprintf(fid,'%6.5f,',t(l)); fprintf(fid,'%6.5f,',d_0(l)); fprintf(fid,'%6.5f,',d_1(l)); fprintf(fid,'%6.5f,',d_2(l)); fprintf(fid,'%6.5f,',d_3(l)); fprintf(fid,'%6.5f,',d_4(l)); fprintf(fid,'%6.5f\r\n',d_5(l)); end fclose(fid);
%% ƒGƒ‰[ƒJƒEƒ“ƒg‚Ì•\Ž¦
fprintf('errcount=%d\n',errcount);
toc;
%% •â‘«@ƒGƒbƒWŒŸo•û–@‚Ì‚¢‚ë‚¢‚ë
% BW1 = edge(IMG_GRAY,'sobel'); % BW2 = edge(IMG_GRAY,'prewitt'); % BW3 = edge(IMG_GRAY,'roberts'); % BW4 = edge(IMG_GRAY,'log'); % BW5 = edge(IMG_GRAY,'zerocross'); % BW6 = edge(IMG_GRAY,'canny') % figure, imshow(BW1); % figure, imshow(BW2); % figure, imshow(BW3); % figure, imshow(BW4); % figure, imshow(BW5); % figure, imshow(BW6);
Edited command: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% 2014/01/27 %%% %%% kiuchi.m %%% %%% Šá‹…•ÏˆÊ‰ð?͈˗Š‚̃vƒ?ƒOƒ‰ƒ€ %%% %%% %%% %%% 1.?‰Šú‰» %%% %%% 2.ƒ?ƒCƒ“ƒtƒHƒ‹ƒ_‚ÌŽw’è %%% %%% 3.“Ç‚Ý?ž‚Ý“®‰æƒf?[ƒ^Žw’è %%% %%% 4.˜A”ԉ摜‚É•ÏŠ· %%% %%% 5.‰~‹ßŽ—‚Ì‚½‚ß‚Ìpixel?À•Wƒf?[ƒ^‚Ì“Ç‚Ý?ž‚Ý %%% %%% 6.‰~‹ßŽ—ƒAƒ‹ƒSƒŠƒYƒ€ %%% %%% 7.‹ßŽ—Œ‹‰Ê‚Ì•\Ž¦ %%% %%% 8.•ÏˆÊ—Ê‚ÌŽZ?o %%% %%% 9.ŽÀ?ۂ̕ψʗʂւÌ?Z?³ %%% %%% 10.‰ð?ÍŒ‹‰Ê‚Ìcsv•Û‘¶ %%% %%% 11.ƒGƒ‰?[ƒJƒEƒ“ƒg‚Ì•\Ž¦ %%% %%% 12.•â‘«?@ƒGƒbƒWŒŸ?o•û–@‚Ì‚¢‚ë‚¢‚ë %%% %%% by Shohei Uemura %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ?‰Šú‰» clear; close all; tic;
errcount = 1; % ƒGƒ‰?[ƒJƒEƒ“ƒg
%% ƒ?ƒCƒ“ƒtƒHƒ‹ƒ_‚ÌŽw’è MAINFOLDER = 'C:\Users\Ulfah Rimayanti\Desktop\ulfah';
%% “Ç‚Ý?ž‚Ý“®‰æƒf?[ƒ^Žw’è FILENAME = 'Test_Normal_Right_29032012_141908'; % “Ç‚Ý?ž‚Ý“®‰æ‚¨‚æ‚уTƒuƒtƒHƒ‹ƒ_–¼ LOADFILE = strcat(MAINFOLDER,'\',FILENAME,'.avi'); % “Ç‚Ý?ž‚Ý“®‰æ‚ÌŽw’è OBJ = VideoReader(LOADFILE); % ?\‘¢‘Ì,ƒ}ƒ‹ƒ`ƒ?ƒfƒBƒAƒŠ?[ƒ_ƒIƒuƒWƒFƒNƒg‚Ì?ì?¬
%% ˜A”ԉ摜‚É•ÏŠ·
SAVEFOLDER1 = strcat(MAINFOLDER,'\',FILENAME,'\GRAY'); % ƒOƒŒƒC‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER2 = strcat(MAINFOLDER,'\',FILENAME,'\BINARY'); % “ñ’l‰»‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER3 = strcat(MAINFOLDER,'\',FILENAME,'\EDGE1'); % ƒGƒbƒW’Š?o‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER4 = strcat(MAINFOLDER,'\',FILENAME,'\EDGE2'); % ƒGƒbƒW’Š?o‰æ‘œ‚Ì•Û‘¶ƒtƒHƒ‹ƒ_ SAVEFOLDER5 = strcat(MAINFOLDER,'\',FILENAME,'\PIXEL'); % ŠeƒtƒŒ?[ƒ€‚̃GƒbƒW?À•Wcsvƒf?[ƒ^‚Ì•Û‘¶ƒtƒHƒ‹ƒ_
for i = 1: OBJ.NumberOfFrames % ƒtƒŒ?[ƒ€?”‚¾‚¯ŒJ‚è•Ô‚µ
NUM = sprintf('%03d',i); % ”Ô?†‚𕶎š—ñ‚É•ÏŠ·
IMG_GRAY = read(OBJ,i); % i”Ԗڂ̉摜‚ð“Ç‚Ý?ž‚Ý·
IMG_BINARY = edge(IMG_GRAY,'canny',90/255); % ƒj’l‰»‰æ‘œ‚É•ÏŠ·
IMG_EDGE1 = IMG_GRAY; % Œ³‰æ‘œ‚ɃGƒbƒW‚ð?ã?‘‚«
IMG_EDGE2 = IMG_GRAY; % Œ³‰æ‘œ‚ɃGƒbƒW‚ð?ã?‘‚«
imwrite(IMG_GRAY, strcat(SAVEFOLDER1,'\GRAY_',NUM,'.bmp')); % GRAYƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
imwrite(IMG_BINARY, strcat(SAVEFOLDER2,'\BINARY_',NUM,'.bmp')); % BINARYƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
[y1,x1] = find(IMG_BINARY == 1); % “ñ’l‰»‰æ‘œ‚̃GƒbƒW?À•W(”’?F•”•ª)‚ð’Š?o
for j = 1:length(x1) % ”’?F•”•ª‚ð?Ô‚É‚µ‚ÄŒ³‰æ‘œ‚É?ã?‘‚«
IMG_EDGE1(y1(j),x1(j),1) = 255; % R
IMG_EDGE1(y1(j),x1(j),2) = 0; % G
IMG_EDGE1(y1(j),x1(j),3) = 0; % B
end
imwrite(IMG_EDGE1, strcat(SAVEFOLDER3,'\EDGE1_',NUM,'.bmp')); % EDGE1ƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
% ’T?õ—̈æ‚ÌŽw’è
x_start = 50;
x_end = 565;
y_start = 50;
y_end = 175;
% ’T?õ1‰ñ–Ú(?o”“_‚Ì’T?õ)
k = 1; % ƒJƒEƒ“ƒg
X = x_start; % Žn“_x?À•W
for Y = y_start:y_end
if IMG_BINARY(Y,X) == 1 % ”’•”•ª‚Ì?ê?‡
x2(k,1) = X; % x2‚ÉŠi”[
y2(k,1) = Y; % y2‚ÉŠi”[
break % Œ©‚‚©‚Á‚½?ê?‡break
end
end
% ’T?õ2‰ñ–ÚˆÈ?~
k = k+1; % ƒJƒEƒ“ƒg?X?V
for X = x_start+1:x_end % Žn“_x?À•W
if IMG_BINARY(y2(k-1,1)-1,X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1)-1;
elseif IMG_BINARY(y2(k-1,1),X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1);
elseif IMG_BINARY(y2(k-1,1)+1,X) == 1
x2(k,1) = X;
y2(k,1) = y2(k-1,1)+1;
else
x2(k,1) = X;
y2(k,1) = y2(k-1,1);
fprintf('‘O‚̃f?[ƒ^‚ðŒp‘±‚µ‚Ü‚µ‚½?D');
fprintf('EDGE1_%d–‡–Ú‚Ì(%d,%d)‚ðƒ`ƒFƒbƒN\n',i,y2(k,1),x2(k,1));
errcount = errcount+1; % ƒGƒ‰?[ƒJƒEƒ“ƒg‚Ì?X?V
%return
end
k = k+1; % ƒJƒEƒ“ƒg?X?V
end
for j = 1:length(x2) % ‰æ‘œ‚Ì?ã?‘‚«
IMG_EDGE2(y2(j),x2(j),1) = 255; % R
IMG_EDGE2(y2(j),x2(j),2) = 0; % G
IMG_EDGE2(y2(j),x2(j),3) = 0; % B
end
imwrite(IMG_EDGE2, strcat(SAVEFOLDER4,'\EDGE2_',NUM,'.bmp')); % EDGE2ƒtƒHƒ‹ƒ_‚ɉ摜‚ð•Û‘¶
% ƒGƒbƒW?À•W‚ÌŠi”[
csvwrite(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),[x2,y2]); % PIXELƒtƒHƒ‹ƒ_‚É?À•Wƒf?[ƒ^‚ð•Û‘¶
fprintf('%d\n',i);
end
%% ‰~‹ßŽ—‚Ì‚½‚ß‚Ìpixel?À•Wƒf?[ƒ^‚Ì“Ç‚Ý?ž‚Ý pixel = csvread(strcat(SAVEFOLDER5,'\PIXEL_001.csv')); % PIXELƒtƒHƒ‹ƒ_‚Ì1–‡–Ú x = pixel(:,1); % 1—ñ–Ú y = pixel(:,2); % 2—ñ–Ú
%% ‰~‹ßŽ—ƒAƒ‹ƒSƒŠƒYƒ€?@?@?@ˆø—pŒ³?Fhttp://www.mathworks.co.jp/support/solutions/ja/data/1-9LTS7Y/index.html?solution=1-9LTS7Y
% ?‰Šú’l‚ðŽw’è a0=[x‚Ì?‰Šú’l, y‚Ì?‰Šú’l, ”¼Œa‚Ì?‰Šú’l] a0 = [mean(x),mean(y),max(x)-mean(x)];
% ‰~‚Ì•û’öŽ®‚ɃtƒBƒbƒeƒBƒ“ƒO‚·‚éŒW?”a(1)?Aa(2)?Aa(3)‚ð‹?‚ß‚é f = @(a) norm((x-a(1)).^2 + (y-a(2)).^2- a(3).^2);
% fminsearchŠÖ?”‚É‚æ‚éƒtƒBƒbƒeƒBƒ“ƒO af2=[‹ßŽ—‰~x?À•Wa, ‹ßŽ—‰~y?À•Wb, ‹ßŽ—‰~”¼Œar] af2 = fminsearch(f, a0);
% ‰~‚Ì•û’öŽ® eq = ['(x-',num2str(af2(1)),')^2+(y-',num2str(af2(2)),')^2=',num2str(af2(3)),'^2'];
% ‰~‚Ì•`‰æ figure; ezplot(eq,[min([af2(1)-af2(3),af2(2)-af2(3)]),max([af2(1)+af2(3),af2(2)+af2(3)])]); hold on;
% ’†?S“_‚ÆŒ³ƒf?[ƒ^‚Ì•`‰æ plot(x,y,'*r',af2(1),af2(2),'.b'); xlim([af2(1)-af2(3)-af2(3)/10, af2(1)+af2(3)+af2(3)/10]); ylim([af2(2)-af2(3)-af2(3)/10, af2(2)+af2(3)+af2(3)/10]); axis equal; hold off;
%% ‹ßŽ—Œ‹‰Ê‚Ì•\Ž¦ a = af2(1); % ‹ßŽ—‰~x?À•W a [pixel] b = af2(2); % ‹ßŽ—‰~y?À•W b [pixel] r = af2(3); % ‹ßŽ—‰~”¼Œa r [pixel] fprintf('a = %10.6f, b = %10.6f, r = %10.6f\n', a, b, r); % •‚“®?¬?”“_Œ^
% ‰æ‘œ‚Ö‚Ì?ã?‘‚« IMG_CIRCLE = imread(strcat(SAVEFOLDER1,'\GRAY_001.bmp')); % ?‘‚«?ž‚݉摜‚Ì“Ç‚Ý?ž‚Ý x_circle = [1:OBJ.Width]'; y_circle = round(-sqrt(r.^2-(x_circle-a).^2)+b); for j = 1:length(x_circle) % ‹ßŽ—‰~‚ð—΂Ō³‰æ‘œ‚É?ã?‘‚« IMG_CIRCLE(y_circle(j),x_circle(j),1) = 0; % R IMG_CIRCLE(y_circle(j),x_circle(j),2) = 255; % G IMG_CIRCLE(y_circle(j),x_circle(j),3) = 0; % B end imwrite(IMG_CIRCLE, strcat(MAINFOLDER,'\',FILENAME,'\CIRCLE.bmp'));
% a = round(a); % a‚Ì?®?”Œ^ŠÛ‚ß % b = round(b); % b‚Ì?®?”Œ^ŠÛ‚ß % r = round(r); % r‚Ì?®?”Œ^ŠÛ‚ß % fprintf('a = %-10d, b = %-10d, r = %-10d\n', a, b, r); % ?®?”Œ^
%% •ÏˆÊ—Ê‚ÌŽZ?o
% ’T?õ“_‚Ì?}10pixel‚Ì•½‹Ï‚ðŽZ?o
for i = 1: OBJ.NumberOfFrames % ƒtƒŒ?[ƒ€?”‚¾‚¯ŒJ‚è•Ô‚µ
NUM = sprintf('%03d',i); % ”Ô?†‚𕶎š—ñ‚É•ÏŠ·
d_0(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.0*r+a)-x_start-10,1,[round(0.0*r+a)-x_start-10 1 round(0.1*r+a)-x_start+10 1])); % ?æ’[•”
d_1(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.1*r+a)-x_start-10,1,[round(0.1*r+a)-x_start-10 1 round(0.1*r+a)-x_start+10 1])); % Žü•Ó•”1
d_2(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.2*r+a)-x_start-10,1,[round(0.2*r+a)-x_start-10 1 round(0.2*r+a)-x_start+10 1])); % Žü•Ó•”2
d_3(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.3*r+a)-x_start-10,1,[round(0.3*r+a)-x_start-10 1 round(0.3*r+a)-x_start+10 1])); % Žü•Ó•”3
d_4(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.4*r+a)-x_start-10,1,[round(0.4*r+a)-x_start-10 1 round(0.4*r+a)-x_start+10 1])); % Žü•Ó•”4
d_5(i) = mean(csvread(strcat(SAVEFOLDER5,'\PIXEL_',NUM,'.csv'),round(0.5*r+a)-x_start-10,1,[round(0.5*r+a)-x_start-10 1 round(0.5*r+a)-x_start+10 1])); % Žü•Ó•”5
end
% —ñƒxƒNƒgƒ‹‚É•Ï?X d_0 = d_0'; d_1 = d_1'; d_2 = d_2'; d_3 = d_3'; d_4 = d_4'; d_5 = d_5';
% •ÏˆÊ—Ê‚ÉŠ·ŽZ d_0 = d_0-d_0(1); d_1 = d_1-d_1(1); d_2 = d_2-d_2(1); d_3 = d_3-d_3(1); d_4 = d_4-d_4(1); d_5 = d_5-d_5(1);
% ƒOƒ‰ƒt•\Ž¦ t = [0.134:0.231:32.012]'; t(1)=0; figure(); plot(t,d_0,t,d_1,t,d_2,t,d_3,t,d_4,t,d_5); xlabel('Time [ms]'); ylabel('Displacement [pixel]'); legend('d0','d1','d2','d3','d4','d5'); grid;
%% ŽÀ?ۂ̕ψʗʂւÌ?Z?³
% Šá‹…‹ßŽ—‰~”¼Œar [pixel] = Šp–Œ‹È—¦ 7.8 [mm] ‚Æ‚·‚é cor = 7.8/r*1000; % ?Z?³’l [ƒÊm/pixel]
% ?Z?³ d_0 = d_0*cor; d_1 = d_1*cor; d_2 = d_2*cor; d_3 = d_3*cor; d_4 = d_4*cor; d_5 = d_5*cor;
% ƒOƒ‰ƒt•\Ž¦ figure(); plot(t,d_0,t,d_1,t,d_2,t,d_3,t,d_4,t,d_5); xlabel('Time [ms]'); ylabel('Displacement [\mum]'); legend('d0','d1','d2','d3','d4','d5'); grid;
%% ‰ð?ÍŒ‹‰Ê‚Ìcsv•Û‘¶
fid = fopen(strcat(MAINFOLDER,'\',FILENAME,'\result.csv'),'w'); % ?‘‚«?ž‚݃‚?[ƒh fprintf(fid,'Time [ms],d_0 [ƒÊm],d_1 [ƒÊm],d_2 [ƒÊm],d_3 [ƒÊm],d_4 [ƒÊm],d_5 [ƒÊm]\r\n'); for l = 1:OBJ.NumberOfFrames fprintf(fid,'%6.5f,',t(l)); fprintf(fid,'%6.5f,',d_0(l)); fprintf(fid,'%6.5f,',d_1(l)); fprintf(fid,'%6.5f,',d_2(l)); fprintf(fid,'%6.5f,',d_3(l)); fprintf(fid,'%6.5f,',d_4(l)); fprintf(fid,'%6.5f\r\n',d_5(l)); end fclose(fid);
%% ƒGƒ‰?[ƒJƒEƒ“ƒg‚Ì•\Ž¦
fprintf('errcount=%d\n',errcount);
toc;
%% •â‘«?@ƒGƒbƒWŒŸ?o•û–@‚Ì‚¢‚ë‚¢‚ë
% BW1 = edge(IMG_GRAY,'sobel'); % BW2 = edge(IMG_GRAY,'prewitt'); % BW3 = edge(IMG_GRAY,'roberts'); % BW4 = edge(IMG_GRAY,'log'); % BW5 = edge(IMG_GRAY,'zerocross'); % BW6 = edge(IMG_GRAY,'canny') % figure, imshow(BW1); % figure, imshow(BW2); % figure, imshow(BW3); % figure, imshow(BW4); % figure, imshow(BW5); % figure, imshow(BW6);
This command was made by a japanese, so i apologize if some signs can`t be read.
What do you think i should do about this?
Thank you.
Best regards,
Ulfah rimayanti
Image Analyst
on 21 Jul 2014
Get the properties on the folder and look at the Securities tab. Does everyone have "Full control"? If not, give them full control.
Image Analyst
on 21 Jul 2014
Can you copy any files into that folder using Windows Explorer, or does that also complain? Do you have the file open and locked in some other program, like Paint or Photoshop or something?
Ulfah
on 21 Jul 2014
Yes, I could copy or delete files into the folder. About whether the file is being locked or not, I`m not really sure, but there is no lock icon on it, and I could play it using other programs (Video, windows media player, movie maker, even photo gallery), so I think it should be ok.
What do you think I should do then?
I`m sorry for asking so much.
Thank you.
Best regards,
ulfah
Image Analyst
on 22 Jul 2014
To see if any file has a lock on it, you can use Unlocker: http://download.cnet.com/Unlocker/3000-2248_4-10493998.html
Then try using a very very simple script to simply write a line or two to a text file in that folder using fopen, fprintf() and fclose(), like
fid = fopen(fullFileName, 'wt');
fprintf('It worked');
fclose(fid);
Ulfah
on 23 Jul 2014
Dear Image analyst,
Thank you for your suggestions.
I have downloaded the application you suggested and checked the file. No locking handle found. I typed that script to open the avi file which is going to be analyzed, and surprisingly an error came out: >> fid = fopen(C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada Nobuko_Left_19022014_144138.avi, 'wt'); fprintf('It worked'); fclose(fid); fid = fopen(C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada | Error: Unexpected MATLAB operator.
I don`t understand why that unexpected MATLAB operator appeared. I registered my own name for the MATLAB license and this is my own PC.
Is there any connection of this error with the previous error? "Error using imwrite (line 454) Unable to open file "C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada Nobuko_Left_19022014_144138\GRAY\GRAY_001.bmp" for writing. You may not have write permission.
Do you have any further suggestions?
Thank you very much.
Best regards,
Ulfah
Image Analyst
on 23 Jul 2014
You need to wrap the filename in single quotes. To be specific, you can't do this:
fopen(C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada Nobuko_Left_19022014_144138.avi, 'wt');
and you must do this:
fopen('C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada Nobuko_Left_19022014_144138.avi', 'wt');
Ulfah
on 24 Jul 2014
Dear Image Analyst,
Thank you. The words below appeared when I typed what you said: >> fid = fopen('11803384_Shimada Nobuko_Left_19022014_144138.avi', 'wt'); fprintf('It worked'); fclose(fid); It worked>>
And when I typed only the first script, this appeared: >> fid = fopen('11803384_Shimada Nobuko_Left_19022014_144138.avi', 'wt')
fid =
4
What should I do next?
Thank you.
Best,
Ulfah
Image Analyst
on 24 Jul 2014
You need to use fid in fprintf():
fprintf(fid, 'It worked');
Ulfah
on 24 Jul 2014
Dear Image Analyst, Thank you for your reply.
I typed like you said:
fid = fopen('C:\Users\Ulfah Rimayanti\Desktop\ulfah\11803384_Shimada Nobuko_Left_19022014_144138.avi', 'wt'); fprintf(fid, 'It worked'); fclose(fid);
But nothing happened, nothing appeared.
Any ideas?
Thank you.
Sincerely,
Ulfah
Image Analyst
on 24 Jul 2014
Are you sure you're looking in the correct folder? A file called "11803384_Shimada Nobuko_Left_19022014_144138.avi" should have appeared (get created) and put into the folder C:\Users\Ulfah Rimayanti\Desktop\ulfah. If it didn't then it should have thrown an error message and you'd see red text. If you didn't see red text error message then look in the folder - the file should be there, and if it's there it means that you have permission to write to the folder and your problem lies somewhere else. That is, it's not a permission problem but some other kind of problem you need to figure out.
Ulfah
on 28 Aug 2014
Dear Image Analyst,
Finally i was able to analyze the data. I just need to change IMG_GRAY = rgb2gray(IMG_ORIGINAL) into IMG_GRAY = IMG_ORIGINAL
Thank you for all the discussion.
Do you mind if I ask you 1 more thing? Could you tell me how to open workspace?
Thank you.
Ulfah rimayanti
Image Analyst
on 28 Aug 2014
Edited: Image Analyst
on 28 Aug 2014
There is a function called workspace that will open and display the workspace panel if you're running the MATLAB IDE and not a compiled program.
workspace
If you want to see the Current folder panel with the files listed, issue the filebrowser command
filebrowser
If your original question is answered, can you please mark my answer as "Accepted" - thanks.
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)