Questions tagged [image]

This tag is for questions related to the loading, formatting, saving, compression, and display of data representing pictures.

Filter by
Sorted by
Tagged with
6
votes
1answer
58 views

Automatic picture selector

I'm working on a project for digital marketing, I want to automate the upload of pictures. The program itself isn't done but here I came up with a way to keep track of which and when pictures have ...
2
votes
0answers
44 views

Generate Black and White confidence map masks for joints, same as OpenPose/Convolutional Pose Machines

Attached below is my code for generating the confidence maps for the joint locations, it is in the same vein as the maps generated for the paper Convolutional Pose Machines and OpenPose. I am ...
1
vote
1answer
55 views

Image type convertion

So I have a piece a code that, altough it does what is expected, it doesn't seam very performant to me. I just wanted to know if there's a better way to do this or if my code is alright as it is. The ...
2
votes
1answer
69 views

Flash Light Effect Windows Forms Edited

I am having performence issues with image processing task (flash light effect). I used c#, and used couple references (LockBits Method, Extension). The program has bad frame rates. Edited the code, ...
1
vote
1answer
60 views

Convert image to grayscale

To convert JPEG file, C function, bgraToGrayscale is called from Swift. Is there a better way to 1.allocate memory and 2.access pointers than the ways they have been done in code below? And ...
5
votes
1answer
35 views

Command line python script to generate image with n digits from MNIST data

A Python script to generate an image with a given number of digits from MNIST data on a single row. Via arguments, the following can be specified (all optional, with defaults if necessary): width of ...
9
votes
0answers
89 views

Generated Minecraft stone texture in R

I needed a Minecraft-like stone texture, instead of creating it using image editing software I decided to generate one using R. The idea is to create some noise and stretch it horizontally so the ...
6
votes
2answers
163 views

Image edge detection

I have a Canny Edge Detection Code written in C++. I would like to know how can I make it more robust in terms of detecting all the edges correctly and save it? Is this the best possible edge ...
4
votes
0answers
34 views

Better performance in read/write data structure + byte

I am writing a program to compress an image using Huffman encoding and I need to write the data structure and the byte file. After that, I have to read/decode it. I realize that my read and write is ...
2
votes
1answer
63 views

My custom implementation of MATLAB's imdilate

I have been assigned to implement the morphological dilation operation without using MATLAB's imdilate, and I came up with the following solution: ...
13
votes
3answers
1k views

Hough transform algorithm - Idiomatic c++

I've got some working code to compute the Hough transform for circles: ...
5
votes
3answers
112 views

Image filtering application

I'm building an image filtering application, and I'm new to the Java frameworks that I need to do so. Right now, I can apply a simple 3x3 kernel blur to my thing by overwriting the RGB values of the ...
3
votes
0answers
21 views

React.js component to lazy-load image

I'm trying to design a better solution for img srcset with lazy load. Below is the code from the component responsible for lazy load img, maybe someone has a better way to achieve this effect. Full ...
4
votes
1answer
69 views

Read JPEG dimensions properly

I need to extract the dimensions (width and height) of a jpeg file for inserting in an html document. According to the JPEG image compression FAQ, cautions against what's commonly out there, Some ...
4
votes
1answer
117 views

C# handling of images - is this best for memory usage?

I am working with a system that needs to consume product images uploaded by employees and resize them / add white padding to the sides to create square images to be consumed by our e-commerce site. I'...
3
votes
0answers
55 views

Simple vanilla JavaScript Carousel with tabs and pause button

I currently got into coding and I am completely self taught. Since I know that my code is far from being perfect, I am asking for advice and tips on how to improve. Feel free to drop in any comments ...
7
votes
1answer
65 views

Loading BitmapImages out of a Zip file

I'm working on a personal project to get better with C#, and as part of that I have a zip file with 20 or so images saved inside. I want to load those images out of the zip file and display them in my ...
4
votes
1answer
100 views

Expanding the region of interest of an image

I am solving a problem of increasing the ROI of a retinal image using the below algorithm- First, the set of pixels of the exterior border of the ROI is determined, i.e., pixels that are outside ...
3
votes
0answers
43 views

Caching image thumbnail web-application based on rocket

This is my first rocket web-app. It serves images from a directory and thumbnails from a sub-directory. if no thumbnail is found for an existing image it is created on the fly. Before I launch this ...
9
votes
1answer
285 views

Maze image solver and animator in Python

This maze solver is a continuation to the maze generator I posted here recently Maze generator & animator in Python This code takes an image containing a 2-color maze as input and solves the maze ...
14
votes
1answer
957 views

Maze generator & animator in Python

This is a follow up to this code and I still did not get the feedback on the drawing functions Maze generator in Python- Gif animator-Custom colors/sizes The code generates custom color and size ...
9
votes
1answer
294 views

Maze generator in Python- Gif animator-Custom colors/sizes

This Python code generates mazes with color and size customization. I intend to add several new maze generating algorithms(Sidewinder, Kruskal, Prim ...) to the Maze class but for now, there is only ...
1
vote
1answer
84 views

Add watermark to images

Recently, I started reading image processing via opencv library in python. I create a minio object storage and upload some photos into it. After that, I wrote a program which reads every image in ...
1
vote
0answers
37 views

Photo rename by Exif date and group into folders with a threshold

I wrote this tiny F# project yesterday, but I am a bit rusty and I would like to know if there is anything I can refactor and make more elegant. ...
5
votes
1answer
54 views

Command line utility to convert image formats of photos

Below is some code for a basic command line utility to convert image formats of photos. I'm wondering how any part of it might be written with better style, i.e. how it could be neater, clearer and ...
3
votes
1answer
80 views

Apply a sepia filter to an image

I'm writing a simple function that applies a Sepia filter to an image. My function works, but I'm a beginner gopher. So I would like to know if there is a way to improve the code. I usually code in ...
2
votes
1answer
77 views

ViewModels for image transformations

In my project I have a chain of Fragments where each one gets a bitmap, manipulates it, then sends it to another fragment for more processing. My fragment chain looks like this: CaptureFragment -> ...
3
votes
1answer
94 views

Stereo image matching implementation in Halide

The authors of this paper compute support_points of a 900×700 image in 118 ms. I have implemented their algorithm below in Halide. In my algorithm, the nested for loops over length and width iterate ...
5
votes
1answer
83 views

Rust code of a tree fractal

I just picked up Rust recently and this is my first program (longer than 10 lines at least) so I'm looking for constructs that are more native and natural to Rust. I come from a c++/ python background....
2
votes
1answer
103 views

Image Processing - Comparing 2 images and Ranking Similarity

My code compares 2 images of any shape/dimension and ranks them in order of similarity. It starts with reading from a CSV file with columns image1, image2 which contain absolute paths and then ...
8
votes
1answer
249 views

Bilinear image interpolation

I have written a bilinear interpolant, which is working moderately well except that is painfuly slow. How can rewrite the code to make it faster? Using opencv directly isn't a valid answer. ...
1
vote
1answer
37 views

Rails controller method to show an optionally scaled image using MiniMagick

I've got below implementation for my controller and show action which implements MiniMagick gem. I've just wondering is there any better way to write it down? If ...
0
votes
1answer
32 views

Upload image with GD library

First of all I just started learning OOP. My priority is to make safe code. I think my code is safe, because I use GD to make a copy of the uploaded image and I use an image proxy to make sure nobody ...
5
votes
0answers
40 views

Interfaces and OOP Design for Image Editor software

I'm new to C++ programming, and I'm building an Image Editor software like Lightroom/CameraRaw from scratch. Apart from procedural code (actually seems that all the functions works correctly) my goal ...
6
votes
0answers
30 views

Drawing a line in any direction with pixels

I am doing an image drawing and rendering library, and would like some feedback on this code, it simply draws a line in any direction. The equation for that is: m = (y2 - y1) / (x2 - x1) b = y1 - m ...
4
votes
2answers
168 views

Edge detection in a canvas

I have one function in my code to detect edges in a canvas but it's the slowest part of my code and is used everywhere. If I could just optimise this, my whole program would speed up considerably. ...
2
votes
0answers
23 views

Create mosaic task #2

This post is a continuation of post here: Create mosaic task. I improved code readability, hopefully it'll be reviewable now. Once again, I'm asking for tips to write better code. Task: The point ...
5
votes
0answers
51 views

Tensorflow loop to analyze gradients derived from MRI and PET images

The code shown below takes the partial derivative of each pixel of the output fused image of a neural network with respect to input image of the neural network using tensorflow's ...
7
votes
1answer
49 views

Bash script to encode images in base64 and generate a CSS file from them

These are the first lines of code I've ever written. I've been interested in the idea of learning to program for quite a while, but never really pulled the trigger, and now I've been playing around ...
2
votes
0answers
23 views

jQuery code to display images served by PHP, without reloading

My php page displays a slider of images and when the user clicks on an image(.item), the div below (#team_single) changes the content without reloading the page. Content of the div changes also when ...
6
votes
1answer
69 views

Get nearest major city of an image (using EXIF GPS data)

I am writing a program that will take images in a folder, get the GPS Coordinates (from the EXIF data), then return the closest "major city". (I define a major city as one with an airport, so ...
3
votes
0answers
188 views

Converts audio files to fixed size chunks and the chunks to spectrogram images

This code takes in input as audio files (.wav or .WAV) and divides them into fixed-size (chunkSize in seconds) samples. Then these chunks are converted to spectrogram images after applying PCEN (Per-...
1
vote
0answers
59 views

Proper image sizes in WordPress

I wanted to create a set of functions that would allow me to easily implement images for multiple screen resolutions in my custom page templates. WordPress offers some functionality for implementing ...
11
votes
1answer
60 views

Visualization of the Pythagorean theorem

Background The Pythagorean theorem asserts that for a right triangle with hypotenuse \$c\$ and other sides \$a\$ and \$b\$, the area of the square placed upon \$c\$ is equal to the sum of the areas ...
5
votes
1answer
121 views

Create mosaic task

I tried to apply for software engineer - intern with this task, and there is no reply since I sent it, so I guess I failed. Can you give me a direction in what way I should improve my code? Task: The ...
1
vote
0answers
251 views

Python3 - Cropping PDF files according to coordinates

I have a python script, that is performing OCR on PDF pages. I am trying to do so I can provide coordinates to the script - so it will only select the text within the provided coordinates ...
2
votes
0answers
269 views

JavaFX lazy loading of images in TableView

This code is based off https://stackoverflow.com/questions/25711103/javafx-combobox-lazy-loading-images but modified to work with a TableCell Firstly, the model object should have an observable ...
4
votes
1answer
68 views

U-Net: A TensorFlow model

What I want to know I am writing a ML model called U-Net with Python (and TensorFlow). My question is not about the machine learning or Tensorflow, I want to know the best structure of the code. I ...
3
votes
0answers
56 views

Pygame : processing speed independant image loop displayer

I made this in order to teach myself pygame. This displays an images loop at the same speed on any computer (It will lag on a slow computer). Is my time management good or do my datetime call could ...
5
votes
1answer
99 views

Find png files in folder structure and map them to Photoshop groups and layers

I've created a heavily problematic code that works. Summary: It looks through a folder structure, for png files and tries to replicate this structure in Photoshop. Files are mapped layers and Folders ...