image-processing

Assigning a 2D image for every face of a 3D cube: MATLAB

為{幸葍}努か 提交于 2021-01-28 19:25:19
问题 I want to build a cube in MATLAB and assign different 2D images for its faces. I think this is called texture mapping. I've searched for such a code, but what I found is a code that is able to assign a single image to all of the cube faces, the code is available here (http://www.mathworks.com/matlabcentral/answers/32070-rgb-images-on-a-3d-cube). Here is the code, cdata = flipdim( imread('peppers.png'), 1 ); cdatar = flipdim( cdata, 2 ); % bottom surface([-1 1; -1 1], [-1 -1; 1 1], [-1 -1; -1

Fix image orientation in Jimp

不羁的心 提交于 2021-01-28 19:23:44
问题 I am using Jimp (https://www.npmjs.com/package/jimp) library to crop the image. Crop is working fine but I only have an issue with image orientation. Sometimes, user uploaded rotated images and its result rotated cropped images. I went through with https://www.npmjs.com/package/jimp documentation but couldn't find anything related to this. Here are couple of links I went through but didn't helped: https://justmarkup.com/articles/2019-10-21-image-orientation/ Accessing JPEG EXIF rotation data

OpenCV outputing odd pixel values

折月煮酒 提交于 2021-01-28 19:14:34
问题 I want to do processing on images with C++ and have been using OpenCV. I've gotten a bit stuck though when it comes to trying to access each pixel individually. I can output the whole gray scaled image just fine using: cout << image; and get the expected output of values like so: [143, 147, 164, 177, 177, 185, 196, 195, 185, 186, 178, 190, 178, 163, 183... But when I try to output one pixel at a time using: for (int y = 0; y < image.rows; ++y) { for (int x = 0;x < image.cols; ++x) { std::cout

morphological opening by reconstruction matlab code

不羁的心 提交于 2021-01-28 18:58:40
问题 I should do morphological opening by reconstruction by my own Matlab code not imreconstruct . this is my code but it is not work well: S = input('Enter the structuring element: '); Im = input('Enter the input image: '); marker = imerode(Im,S); mask = Im; Im2 = imdilate(marker,S); Im3 = min(Im2,Im); i=1; while Im3(i+1)~= Im3(i) i=i+1; Im2 = imdilate(Im3(i),S); Im3(i+1) = min(Im2,Im); end imrecon = Im3; has anyone a better code or can edit my code? please help me. Thank you in advance. 回答1: I

camera to object distance calculation using opencv and python

為{幸葍}努か 提交于 2021-01-28 18:27:37
问题 I am using Microsoft Lifecam HD 3000 on my quadcopter for autonomous landing . I wish to calculate the distance between the onboard camera on the quadcopter and a landing pad which has a rectangle printed on it. The distance can then be fed as error to the PID controller. i am using python to code this. Could anyone suggest a simple way to find the distance. PS: I don't need the exact value of distance 回答1: If the landing rectangle size is known/constant then it is doable some data to prepare

Extracting digits from image with python and OpenCV

独自空忆成欢 提交于 2021-01-28 18:10:36
问题 I am looking for some coding solution/help to extract the digits from the LCD display and then output the value from the image. Below is the code and example images and how I got so far, but I need some further help to actually extract the "digits" from the image and output the value. I have made digits lookup table from an earlier example, # import the necessary packages from imutils.perspective import four_point_transform from imutils import contours import imutils import cv2 # define the

Error parsing text-format caffe.NetParameter: 54:17: Message type “caffe.ConvolutionParameter” has no field named “sparse_ratio”

泄露秘密 提交于 2021-01-28 13:58:56
问题 i hope you are doing well, i tried to run a python code that i downloaded from here : "https://github.com/may0324/DeepCompression-caffe/tree/master/examples/mnist" i am using Ubuntu 16.04,python (2.7,3.5), import sys import os sparse_ratio_vec = [0.33, 0.8, 0.9, 0.8] #sparse ratio of each layer iters = [500, 1000, 10500, 11000, 500] #max iteration of each stage def generate_data_layer(): data_layer_str = ''' name: "LeNet" layer { name: "mnist" type: "Data" top: "data" top: "label" include {

Iterate over regions and take mean pixel value in OpenCV?

时间秒杀一切 提交于 2021-01-28 11:50:38
问题 So Im basically trying to divide up a gray scale image (in this case 32x32) by resizing the initial image. Once the "regions" are divided up, I need to take the mean pixel value of each one and then add to a string a 1, 0, or X. For example: "Region (3, 19) has a mean value of 21 so that's a 1". I think I have most of the logic down but shouldn't, in theory, the output recreate the image in the form of 1s, 0s, and Xs? I feel like my math is wrong on the for loops maybe? Remember, all Im

Read USB camera's input edit and send the output to a virtual camera on Windows

强颜欢笑 提交于 2021-01-28 10:35:53
问题 I am working on project where I need to read a USB camera's input, put some effects on it and then send that data to a virtual camera so it can be accessed by skype etc. I have compiled and used the vcam filter. I was also able to make a few changes in FillBuffer method. I now need to know that is it possible to send data to vcam filter from another application or do I need to write another filter. 回答1: The vcam project you currently have as a template is the interface to other video

OpenCV+Python getting this error when trying to run the code on bigger images

坚强是说给别人听的谎言 提交于 2021-01-28 10:04:48
问题 I am getting this error when running my code through a set of big images of 5472 x 3648 dimension(4.4mb) . The code is working fine when my images were around 1437 x 1243 dimension, I can run through all images and save it. Notice: You can see with bigger images, I still managed to run the first file and save it to 1771, it only shown error and stop the run halfway through 1772. Is there anyway which I can process my images using this algorithm without needing to resize the images dimension?