質問するログイン新規登録

質問編集履歴

3

コードの修正

2024/02/21 01:25

投稿

yyicp
yyicp

スコア78

title CHANGED
File without changes
body CHANGED
@@ -35,29 +35,28 @@
35
35
  import cv2
36
36
 
37
37
  img1 = cv2.imread('./LENNA1.png')
38
- img2 = cv2.imread('./LENNA2.png')
38
+ img2= cv2.imread('./LENNA2.png')
39
- img3 = cv2.imread('./LENNA.jpg')
39
+ img3= cv2.imread('./LENNA.jpg')
40
40
 
41
41
  img41 = img1-img3
42
- file1 = open('result41.txt', 'w')
42
+ file41 = open('result41.txt', 'w')
43
43
  for j in range(0,150):
44
44
  for i in range(0,150):
45
45
  if i==149:
46
- file1.write(str(img41[j,i,0])+"\n")
46
+ file41.write(str(img41[j,i,0])+"\n")
47
47
  else:
48
- file1.write(str(img41[j,i,0])+"\t")
48
+ file41.write(str(img41[j,i,0])+"\t")
49
- file1.close()
49
+ file41.close()
50
50
 
51
51
  img42 = img2-img3
52
- file2 = open('result42.txt', 'w')
52
+ file42 = open('result42.txt', 'w')
53
53
  for j in range(0,150):
54
54
  for i in range(0,150):
55
55
  if i==149:
56
- file2.write(str(img42[j,i,0])+"\n")
56
+ file42.write(str(img42[j,i,0])+"\n")
57
57
  else:
58
- file2.write(str(img42[j,i,0])+"\t")
58
+ file42.write(str(img42[j,i,0])+"\t")
59
- file2.close()
59
+ file42.close()
60
-
61
60
  ```
62
61
 
63
62
 

2

誤字の修正

2024/02/21 01:23

投稿

yyicp
yyicp

スコア78

title CHANGED
File without changes
body CHANGED
@@ -3,7 +3,7 @@
3
3
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-02-21/93e42cd9-5c94-432d-89cb-88d7e84646e8.jpeg)
4
4
 
5
5
  そのファイルをpngにファイルに変換するときに、
6
- ① powerpoint貼り付けて、右クリック→図として保存:LENNA1.png
6
+ ① powerpoint貼り付けて、右クリック→図として保存:LENNA1.png
7
7
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-02-21/64932660-b277-40d6-8a41-cc7e011f5d22.png)
8
8
 
9
9
  ② [こちら](https://www.iloveimg.com/ja/jpg-to-image/jpg-to-png)のページで変換:LENNA2.png

1

図の追加

2024/02/21 01:22

投稿

yyicp
yyicp

スコア78

title CHANGED
File without changes
body CHANGED
@@ -1,8 +1,14 @@
1
1
  ### 実現したいこと
2
2
  [こちら](http://www.ess.ic.kanagawa-it.ac.jp/app_images_j.html)のホームページからLENNA.jpgをダウンロードしました。
3
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-02-21/93e42cd9-5c94-432d-89cb-88d7e84646e8.jpeg)
4
+
3
5
  そのファイルをpngにファイルに変換するときに、
4
6
  ① powerpointニ貼り付けて、右クリック→図として保存:LENNA1.png
7
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-02-21/64932660-b277-40d6-8a41-cc7e011f5d22.png)
8
+
5
9
  ② [こちら](https://www.iloveimg.com/ja/jpg-to-image/jpg-to-png)のページで変換:LENNA2.png
10
+ ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2024-02-21/7c635bd9-ac7b-41f7-8d83-503e4a5eef17.png)
11
+
6
12
  という2つの方法を試したときに、①は結果がおかしくなって、②が正しい結果になります。
7
13
 
8
14
  具体的には、①の結果result41.txtは