Giter VIP home page Giter VIP logo

matlab_imresize's People

Contributors

2006pmach avatar ahmadmughees avatar fatheral avatar timofeikornev-tomtom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

matlab_imresize's Issues

I can't get the correct result

My input image shape is [32,3,64,64], but the shape of result is [64,6,64,64] while it should be [32,3,128,128]
Did my modification cause it?
When I run the original code, a mistake happened: ValueError: operands could not be broadcast together with shapes (64,4,1,1) (64,4,3,64,64)
The mistake happens in the sentence: outimg = np.sum(weights*((inimg[indices].squeeze(axis=1)).astype(np.float64)), axis=1)

def imresizevec(inimg, weights, indices, dim):
wshape = weights.shape
if dim == 0:
weights = weights.reshape((wshape[0], wshape[2], 1, 1))
print(weights.shape)
outimg = np.sum(weights*((inimg[indices].squeeze(axis=1)).astype(np.float64)), axis=1)
print(outimg.shape)

So I change the "weights = weights.reshape((wshape[0], wshape[2], 1, 1))" to "weights = weights.reshape((wshape[0], wshape[2], 1, 1,1))"
Could you help me? Thanks a lot.

Adding LICENSE to repository

I was interested in using your library as it mimics Matlab's imresize perfectly, however I noticed that there was no license attached to the project/repo.

Github's default policy for this is (taken from https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository):

without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work

Have you considered adding a license so that others (including myself) can use your source code in our own projects?

Thanks!

skimage

since sometimes it is deprecated we can change the main file

import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
from imresize import *


img_uint8 = ndimage.imread("test\\lena_512x512.png")
plt.figure()
plt.imshow(img_uint8)
new_size = (123, 234)
new_img_uint8 = imresize(img_uint8, output_shape=new_size)

plt.figure()
plt.imshow(new_img_uint8)

plt.show()

Question about the article

I read your article posted at https://www.reddit.com/r/MachineLearning/comments/6vdo51/p_matlab_bicubic_imresize_implemented_in_python/.

I totally agree with you that using matlab enforces off-line dataset building. (bad!!!)
You commented that "Note: it is not very optimized in terms of speed, and probably the best solution is to re-compile OpenCV (there single constant for cv::resize should be changed). But it is not always appropriate for all.", I have two questions with this one.

  1. What single constant should I change to use OpenCV bicubic similar to matlab version?
  2. Does OpenCV bicubic show similar performance (e.g. PSNR) to matlab bicubic?

Thank you,
Hyunho.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.