Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8206297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:37:10+00:00 2026-06-07T08:37:10+00:00

I am creating an image so: image = np.empty(shape=(height, width, 1), dtype = np.uint16)

  • 0

I am creating an image so:

image = np.empty(shape=(height, width, 1), dtype = np.uint16)

After that I convert the image to BGR model:

image = cv2.cvtColor(image, cv2.COLOR_GRAY2BGR)

I’d like to convert the image now in a dtype = np.uint8 in order to use that image with cv2.threshold() function. I meant, I would like to convert the image to CV_8UC1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:37:11+00:00Added an answer on June 7, 2026 at 8:37 am

    You can use cv2.convertScaleAbs for this problem. See the Documentation.

    Check out the command terminal demo below :

    >>> img = np.empty((100,100,1),dtype = np.uint16)
    >>> image = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR)
    
    >>> cvuint8 = cv2.convertScaleAbs(image)
    
    >>> cvuint8.dtype
    dtype('uint8')
    

    Hope it helps!!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an Image Processing app that does two image analysis functions. One
I know that html 5 canvas will allow for paint style image creating and
I'm dynamically creating an empty movieclip inside another movieclip to load an image into
the tutorial here http://www.edumobile.org/android/android-beginner-tutorials/creating-image-gallery/ teaches how to put images from resources in gallery here's
I am creating an image (some sort of copy of another gallery image) using
I am creating an image dynamically using php. The image is being created if
I have been creating an image gallery with jQuery, all is done. The images
I'm currently having trouble creating an image from a binary string of data in
When creating a new Image element in javascript, Google Chrome's memory tool (Developer tools
I am creating a transparent image on iOS using Quartz. However, this image shows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.