image-processing

np.concatenate dimension problem of 1 & 3 channel image input

np.concatenate dimension problem of 1 & 3 channel image input Question: I’m trying to train a future 7days broccoli Unet model I try to concatenate images, because my input have 8 channel(51channel 13channel[index 5]) appear this error message img_batch = np.concatenate(images, axis=3)________line172 mask_batch = np.concatenate(masks, axis=2)________line173 y_int = np.argmax(mask_batch, axis=2) y_binary = to_categorical(y_int) yield (img_batch, …

Total answers: 1

How to accurately measure the contact ear orientation on a flat battery using diplib

How to accurately measure the contact ear orientation on a flat battery using diplib Question: Our production line want to automate the fabrication of flat battery, I want to accurately measure the contact ear orientation of the flat battery and send the center of the battery coordinate plus the ear orientation degrees to linuxCNC motion …

Total answers: 1

train pytorch CNN to specific image style

train pytorch CNN to specific image style Question: I’m trying to train pytorch CNN model to transform my images into specific style. I found tutorial for this at https://pytorch.org/tutorials/advanced/neural_style_tutorial.html, but this will transform the image in multiple iterations and I need to have a model that do the same thing to use it in C++ …

Total answers: 1

Displaying a RGB image in float64

Displaying a RGB image in float64 Question: I have an image with data type uint8. I want to convert it to the data type float64 and display it. I expected to see the image as I displayed it with data type uint8. But the result is this: My original image is like this: Why is …

Total answers: 1

Low Accuracy in Detecting Circles using Hough Circle open cv python

Low Accuracy in Detecting Circles using Hough Circle open cv python Question: I’m new to the Computer Vision field so this question may be fairly easy; yet I’m clueless on how to increase the Precision. I’m Trying to detect all circles in this picture. Here is the approach i took Gray Scaled the image gray …

Total answers: 1

remove stripes / vertical streaks in remote sensing images

remove stripes / vertical streaks in remote sensing images Question: I have a remote sensing photo that has bright non continuous vertical streaks or stripes as in the pic below, my question is there a way to remove them using python and opencv or any other ip library? , Asked By: gin || Source Answers: …

Total answers: 6

How to save image with same name with python?

How to save image with same name with python? Question: I have image folder as below : |——dir–| | |—- input–|– 1.jpg | | |– 2.jpg .. … … … where I want to do random rotation for input folder and save the results in output folder I tryied the fillowing script : import torch …

Total answers: 1

Convert image header information to ASCII code

Convert image header information to ASCII code Question: I got a string with image header information like pixel number for each dimension. Here the header: "1 10 10 1 4 LE". In addition to that the other image data is saved in the following base64 code: "+igSKdAm9CVoJhYnzidqKLsmnyX2JwQo9CYhJgMmaCb5Jo0nMSevJmAnwibIJuEmnyZRJpomNicxJ9gmfSeoJkcmySZAJ/Am2CZZJ78nOSeUJ7km+CWVJpMnyCebJ6UnoiclJ7UmPyY3JgsnwyfGJ7cniSdlJ3oneSajJi8n3ye5Jz4nvCeMJ1onYSdAJ3QnsScLKHsnTCfuJ6MnGCdaJ2onECfUJmcnhicEKAko9yZPJjYn0SY7JmkmKid3J1goDyhOJrIldic=". I tried to combine these two strings to …

Total answers: 1

How to detect pits on smart card contact pins using diplib

How to detect pits on smart card contact pins using diplib Question: During the smart card manufacture process, a probe stucks could leave pits on contact pins. I try to use dip.tophat and dip.HysteresisThreshold to extract the pits, this works but found more local height outside or near the edge of the contact pins. How …

Total answers: 2

AttributeError: EagerTensor object has no attribute 'astype'

AttributeError: EagerTensor object has no attribute 'astype' Question: I am trying to do a GradCAM Heatmap in Google Colab like so: import tensorflow as tf from tensorflow.keras import backend as K from tf_keras_vis.activation_maximization import ActivationMaximization from tf_keras_vis.utils.callbacks import Print def model_modifier(m): m.layers[-1].activation = tf.keras.activations.linear activation_maximization = ActivationMaximization(model, model_modifier) loss = lambda x: K.mean(x[:, 1]) activation …

Total answers: 1