Issue
I am working with image processing in Python. How can I transform a scalar image to colored, and then select only the red channel?
I briefly looked into OpenCV and SimpleITK but I cannot manage to find a correct answer.
Solution
I actually did this a couple of weeks ago, the pattern is something along the lines of:
import SimpleITK as sitk
image = sitk.ReadImage(image_path)
rgb = sitk.ScalarToRGB(image)
rgb_array = sito.GetArrayFromImage(rgb)
red_only = [:,:,0]
Answered By - Sala Answer Checked By - Terry (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.