Ask Your Question
1

What is the equivalent of cv::Mat in python?

asked 2016-02-10 04:27:00 -0600

Nain gravatar image

I am trying to convert a openCV c++ code in python.I want to convert the following in python.

cv::Mat skinCrCbHist = cv::Mat::zeros(cv::Size(256,256),CV_8UC1);

Please help!!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2016-02-10 05:39:07 -0600

strann gravatar image

updated 2016-02-10 05:43:15 -0600

In Python images are represented as NumPy arrays. Try this:

  import numpy as np
  import cv2

  skinCrCbHist = np.zeros((256, 256, 1), dtype = "uint8")
edit flag offensive delete link more

Comments

thanks bro ^^

hosjiu gravatar imagehosjiu ( 2017-10-17 05:28:00 -0600 )edit

thanks a lot

maksym_x gravatar imagemaksym_x ( 2018-07-22 18:05:14 -0600 )edit

Hola, ha pasado un buen tiempo dese que respondieron esta pregunta jaja. Puedes explicarme que significan los parametros dentro de np.zeros. es el tamaño de la imagen?

cristian.guancha gravatar imagecristian.guancha ( 2019-09-23 02:06:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-10 04:27:00 -0600

Seen: 48,886 times

Last updated: Feb 10 '16