程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python image processing combat reading notes

編輯:Python

While reading the book "Image Processing, Analysis and Machine Vision", I use the book "Python Image Processing Practice" as a code-assisted reference book.During the reading process, I found that some codes in "Python Image Processing Practice" had some mismatches in actual use, as well as some findings that I thought were useful, so I made some notes to help me remember.
The version of the book "Python Image Processing Practice" in my hand is: the first edition in December 2020, and the second printing in Hebei in January 2021.

  1. Section 1.4.3 of the book, Section 2. Read and display multiple images at once (14 pages), my solution is as follows:
ic = imread_collection(ic = imread_collection(['images/69015.jpg','images/210088.jpg', 'images/cat1.png'])imshow_collection(ic)show()
  1. In section 1.5.2 of the book, section 1. (page 21) uses slices of numpy arrays for image processing, the code applies a circular mask to the lena image, but in the actual code, the mask is addedWhen the object is in a read-only state, it cannot be modified successfully.An invalid solution is to set lena.flags.writable=True, which will report cannot set WRITEABLE flag to True of this array.A valid solution is to construct a new object based on the original lena object.lena = np.array(lena).
  2. It is also section 1.5.2 (page 21). In practice, it is found that the ndarray image obtained after the .png image is read in is of type float, and the .jpg image is of type uint8 after being read in. Its internal mechanismThe principles will be experienced in the future learning process.

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved