История изменений
Исправление fehhner, (текущая версия) :
Всем спасибо. Мало ли кому пригодится, оставлю мой скрипт (собранный на коленке), которые свапает каналы в png:
pip install opencv-python
# import the necessary packages
import argparse
import cv2
def rgb2bgr_filter(image):
# by default, OpenCV uses BGR color scheme
# split the image into its BGR components
(B, G, R) = cv2.split(image)
# merge the channels back together in reverse order and return the image
return cv2.merge([R, G, B])
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output", required=True, help="path to output image with file extension, e.g. output.png")
args = vars(ap.parse_args())
# load the image, apply the reverse RGB filter, and show the
# output image
image = cv2.imread(args["image"])
filtered = rgb2bgr_filter(image)
cv2.imshow("Images", filtered)
cv2.imwrite(args["output"], filtered)
cv2.waitKey(0)
Исправление fehhner, :
Всем спасибо. Мало ли кому пригодится, оставлю мой скрипт (собранный на коленке), которые свапает каналы в png:
pip install opencv-python
# import the necessary packages
import argparse
import cv2
def rgb2bgr_filter(image):
# by default, OpenCV uses BGR color scheme
# split the image into its BGR components
(B, G, R) = cv2.split(image)
# merge the channels back together in reverse order and return the image
return cv2.merge([R, G, B])
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output", required=True, help="path to output image with file extension, e.g. output.png")
args = vars(ap.parse_args())
# load the image, apply the max RGB filter, and show the
# output images
image = cv2.imread(args["image"])
filtered = rgb2bgr_filter(image)
cv2.imshow("Images", filtered)
cv2.imwrite(args["output"], filtered)
cv2.waitKey(0)
Исправление fehhner, :
Всем спасибо. Мало ли кому пригодится, оставлю мой скрипт (собранный на коленке), которые свапает каналы в png:
pip install opencv-python
# import the necessary packages
import argparse
import cv2
def rgb2bgr_filter(image):
# by default, OpenCV uses BGR color scheme
# split the image into its BGR components
(B, G, R) = cv2.split(image)
# merge the channels back together in reverse order and return the image
return cv2.merge([R, G, B])
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output", required=True, help="path to output image")
args = vars(ap.parse_args())
# load the image, apply the max RGB filter, and show the
# output images
image = cv2.imread(args["image"])
filtered = rgb2bgr_filter(image)
cv2.imshow("Images", filtered)
cv2.imwrite(args["output"], filtered)
cv2.waitKey(0)
Исправление fehhner, :
Всем спасибо. Мало ли кому пригодится, оставлю мой скрипт, которые свапает каналы в png:
pip install opencv-python
# import the necessary packages
import argparse
import cv2
def rgb2bgr_filter(image):
# by default, OpenCV uses BGR color scheme
# split the image into its BGR components
(B, G, R) = cv2.split(image)
# merge the channels back together in reverse order and return the image
return cv2.merge([R, G, B])
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output", required=True, help="path to output image")
args = vars(ap.parse_args())
# load the image, apply the max RGB filter, and show the
# output images
image = cv2.imread(args["image"])
filtered = rgb2bgr_filter(image)
cv2.imshow("Images", filtered)
cv2.imwrite(args["output"], filtered)
cv2.waitKey(0)
Исходная версия fehhner, :
Всем спасибо. Мало ли кому пригодится, оставлю мой скрипт, которые свапает каналы в png:
pip install opencv-python
# import the necessary packages
import argparse
import cv2
def rgb2bgr_filter(image):
# by default, OpenCV uses BGR color scheme
# split the image into its BGR components
(B, G, R) = cv2.split(image)
# merge the channels back together in reverse order and return the image
return cv2.merge([R, G, B])
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output", required=True, help="path to output image")
args = vars(ap.parse_args())
# load the image, apply the max RGB filter, and show the
# output images
image = cv2.imread(args["image"])
filtered = rgb2bgr_filter(image)
cv2.imshow("Images", filtered)
cv2.imwrite(args["output"], filtered)
cv2.waitKey(0)