اذهب إلى المحتوى

Ali Ismael

الأعضاء
  • المساهمات

    96
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة Ali Ismael

  1.  كيف يمكنني أن أجعل قيم المحور العمودي تبدأ من ال 0. هنا في الكود التالي:

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.linspace(-2, 2, 50)
    y1 = x**3
    y2 = x**2
    fig, ax = plt.subplots()
    ax.plot(x, y1, c = 'black',label = 'x^3')
    ax.plot(x, y2, c = 'c',label = 'x^2')
    leg = plt.legend(title="your_title")
    plt.show()



     

    • أعجبني 1
  2. استخدم الدالة createSelectiveSearchSegmentation لتنفيذ بعض عمليات البحث الانتقائي على الصور لكن ماسبب الخطأ التالي:

    import cv2 as cv
    from cv2.ximgproc.segmentation import createSelectiveSearchSegmentation
    serach = createSelectiveSearchSegmentation()
    --------------------------------------------------------------------------------------
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'cv2.cv2' has no attribute 'ximgproc'

    علماً أنني قمت بتجريب تثبيت حزمة opencv-contrib-python ولم ينجح الأمر.
     

    • أعجبني 1
  3. أريد طريقة لتغيير ألوان المحاور في Matplotlib، على سبيل المثال في الكود التالي:

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.linspace(-2, 2, 50)
    y1 = x**3
    y2 = x**2
    fig, ax = plt.subplots()
    ax.plot(x, y1, c = 'black',label = 'x^3')
    ax.plot(x, y2, c = 'c',label = 'x^2')
    leg = plt.legend(title="your_title")
    plt.show()

    1.png.3e0cdbec7bba6faae230b49641b85f13.png

     

    • أعجبني 1
  4. لدي الكود التالي، وأريد زيادة عرض خط الأسطر الموجودة ضمن ال legend:

    import numpy as np
    import matplotlib.pyplot as plt
    x = np.linspace(-2, 2, 50)
    y1 = x**3
    y2 = x**2
    fig, ax = plt.subplots()
    ax.plot(x, y1, linewidth=2.0, label='x^3')
    ax.plot(x, y2, linewidth=2.0, label='x^2')
    leg = ax.legend()
    plt.show()

    index.png.ff63d45fc0ccd3e13a4195db81f0b8c7.png
     

    • أعجبني 1
  5. أقوم بعملية تطبيع Normalizing للصورة  باستخدام الدالة cv2.normalize  لتغيير نطاق قيم كثافة البكسل (أريد جعلها بين ال 0 وال 1)، وقمت بتطبيق خوارزمية NORM_L1 لكن لم ينجح الأمر؟ وتظهر الصورة سوداء بقيم صفرية.

    import cv2
    import Image
    import numpy
    myimage = cv2.imread('/content/test5 openeye.jpg',0)
    img_normlaized=cv2.normalize(myimage,None,alpha=0,beta=1,norm_type=cv2.NORM_L1)
    image = Image.fromarray(img_normlaized)
    image.save("image.jpg")

     

    • أعجبني 1
×
×
  • أضف...