Это видео недоступно.
Сожалеем об этом.

25 - Reading Images, Splitting Channels, Resizing using openCV in Python

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • openCV is a library of programming functions mainly aimed at computer vision but also very helpful for processing microscope images. This tutorial explains a few basic operations in openCV to read & resize images and to split & merge channels.
    The code from this video is available at: github.com/bns...

Комментарии • 32

  • @suwarnachoudhary8591
    @suwarnachoudhary8591 4 года назад +5

    Thank you so much for taking the hardships of bringing all the information together. Only one of a kind channel. Precious information explained o detail. I will refer it to all my friends as well. Thanks again.

    • @DigitalSreeni
      @DigitalSreeni  4 года назад +3

      Thank you very much for your kind words Suwarna. Knowing that someone benefits from my work definitely motivates me to put in more effort. Please do spread the word and help others add a new skill to their portfolio.

  • @shahabansari5201
    @shahabansari5201 3 года назад +1

    Thank you very much for explaining all these important image processing tools in a very straightforward manner!

  • @dumisilelumkwana2683
    @dumisilelumkwana2683 2 года назад

    Hi Dr. Bhattiprolu, thanks for the videos. I am trying to do a batch process to merge images with same partial name from different folders using scikit image. I have written this the following code which ran smoothly the first time, however when I repeat the same on a different folder, I get an error merge_imgs is not defined. I was wondering what library to merge images in scikit
    # import libraries
    %matplotlib inline
    import os
    import matplotlib.pyplot as plt
    from skimage import io
    import numpy as np
    import glob
    pathname1 = 'data/H3K9me3/dapi'
    pathname2 = 'data/H3K9me3/foci'
    # loop
    for f1 in os.listdir(pathname1):

    # create name d2
    f2 = f1[:-6] + 'd2.TIF'
    # create file paths
    img_blue = os.path.join(pathname1,f1)
    img_red = os.path.join(pathname2,f2)
    # read files
    img_blue_file = io.imread(img_blue)
    img_red_file = io.imread(img_red)

    # merge files
    merged = merge_imgs([img_blue_file, img_red_file])

    # create output file name
    output_name = 'data/H3K9me3/merged/' + f1[:-6] + '.TIF'

    # save merged files
    io.imsave(output_name, merged)

  • @ManojKumar-rm2cq
    @ManojKumar-rm2cq 3 года назад +1

    Thank you for your videos, you are doing a great job. So far I've only seen a couple of your videos on opencv, which made my work easier and saved lot of my time on searching. Currently I'm working on an application which uses opencv and pyqt5 to process and display some 16 bit grayscale and rgb images and it's information. Since I'm new to python gui I'm really facing a hard time displaying the opencv processed images in QLABEL after formating it using QImage 's format options. What I came through from Google search is that QImage won't support 16 bit images. So please give me some tips on this issue also please let me know if there is any other options available to display these images.

    • @DigitalSreeni
      @DigitalSreeni  3 года назад +1

      I never tried viewing non 8 bit images using libraries in python. I convert them to 8 bit for quick visualization and then export for external visualization. Do you have to view them using python? If not, there are many options outside.

    • @ManojKumar-rm2cq
      @ManojKumar-rm2cq 3 года назад

      @@DigitalSreeni If it is in python, I think I don't have to spend my time on learning new language or libraries. Considering other options is not up to me, gotta check with my client. If you don't mind, could you please tell me the most appropriate options I have.

  • @redhwanalgabri7281
    @redhwanalgabri7281 4 года назад +1

    Your videos are good for me, I watched all of them twice, my question here what meaning of 6, 11, 22, 80
    ('Top left', 6)
    ('Top right', 11)
    ('Bottom Left', 22)
    ('Bottom right', 80)
    when changing 1(color) to 0 (gray)

  • @LeilaMazaheri
    @LeilaMazaheri 3 года назад

    Hi Dr. Bhattiprolu, thanks for the videos, I get this error when I want to use cv2.imshow for merged and resized image: 'numpy.ndarray' object is not callable, not sure how to solve it

    • @DigitalSreeni
      @DigitalSreeni  3 года назад +1

      That error usually means you are trying to call a function instead of array. Please make sure your variable is not a function of other variables. Also, make sure the variable you are using to assign your image is not a built in python function.

  • @user-up1gc1kr4j
    @user-up1gc1kr4j 3 года назад

    I am interested in ai-medical image analysis.
    Is it right for me to take this lecture?

  • @khadijabarhmi3709
    @khadijabarhmi3709 Год назад

    Thank you this is was helpful, how we can apply this for the whole folder

    • @DigitalSreeni
      @DigitalSreeni  Год назад

      This may help: ruclips.net/video/QxzxLVzNfbI/видео.html

  • @samreens3365
    @samreens3365 2 года назад

    Sir how to set bit depth of an image??

  • @redhwanalgabri7281
    @redhwanalgabri7281 4 года назад

    Have you any video about how to classify multiple textures for one image using OpenCV?

    • @DigitalSreeni
      @DigitalSreeni  4 года назад +1

      Please check my video about image segmentation using traditional machine learning. With machine learning you can segment various textures easily. But, it wasn't opencv.

  • @jabedahammed7932
    @jabedahammed7932 4 года назад +1

    Awsome

  • @sushilkotwal8915
    @sushilkotwal8915 4 года назад

    Also for reading it's showing syntaxerror : (Unicode error)'unicodeescape' codec can't decide bytes in position 2-3 truncated \UXXXXXXXX escaep
    Can you please tell me what's the problem

    • @DigitalSreeni
      @DigitalSreeni  4 года назад

      Probably related to your other issue of not reading an image.

  • @sushamakhatavkar-mule253
    @sushamakhatavkar-mule253 3 года назад

    How to check image is grascale or RGB using python code

    • @DigitalSreeni
      @DigitalSreeni  3 года назад

      Just load the image using opencv or scikit image. Look at the numpy array it generates, if it has 3 channels then you know it is an RGB image.

  • @steve22996
    @steve22996 3 года назад

    how does the cv2.merge work?

  • @sushilkotwal8915
    @sushilkotwal8915 4 года назад

    Whatever code you r typing isn't working in my Spyder
    It's showing attribute error : 'NoneType' object has no attribute 'shape'
    To display the size of the image

    • @DigitalSreeni
      @DigitalSreeni  4 года назад +2

      That means there is no image, please check the path. In fact, always look at the variable explorer to see if everything is working after you type each line.

    • @sushilkotwal8915
      @sushilkotwal8915 4 года назад

      @@DigitalSreeni I tried different images from different paths but it isn't working and no variable is displayed in variable explorer...

    • @DigitalSreeni
      @DigitalSreeni  4 года назад +1

      @@sushilkotwal8915 Well, the issue is obviously with reading images. Try placing the image in your current working directory so you don't have to give the entire path to image. Also, what type of image are you trying to read, JPG, PNG?

    • @sushilkotwal8915
      @sushilkotwal8915 4 года назад

      @@DigitalSreeni I can't find out where is the directory?

    • @sushilkotwal8915
      @sushilkotwal8915 4 года назад

      Actually, I am working on a my college project and I am learning image processing from basics and I need to learn from the bottom I am using the Spyder platform first time...

  • @prashantjaiswal5260
    @prashantjaiswal5260 2 года назад

    Sir ,dont make your presentation for microscopist .It is beneficial for all im just saying this because this will bring more students to your channel and more will be benefitted...