1Schroeder / How-to-scale-image-with-matlab

I need help using MATLAB to scale a dimension in an image from a known dimension within the same image
0 stars 0 forks source link

Image Processing and Scaling- Enter base image, find pattern, compare to another image, and scale #1

Open 1Schroeder opened 2 years ago

1Schroeder commented 2 years ago

I want to scale A and B (shown in a picture below) from a known dimension (base of tail light) from an image of an assembled car. The purpose is to get factory dimensions prior to welding my car together because I replaced both quarters, trunk pan, and trunk drop-offs. I replaced the frame rails. I made tubular ones in an effort to make them stronger. The installation of the tail panel will tie everything together. I want to make sure it's right.

The attached image of an assembled tail panel with the lighthousing installed is what matlab should analyze. I'd like to compare an image of a tail light that I can measure in my hands to an image of a tail end of a car with the taillight installed. Matlab should find that portion of the image and then compare it with the width of the car (labeled A in one image) and then compare it with the bottom width between quarter panel flanges (B in one image). I can then compare those two dimensions to the car I have sitting on my shop floor.

Here's the sample image of a taillight housing that I would like matlab to detect in the image above (or from other images I select that are looking squarely at the rear end of a car with its bumper removed and tail light housing installed.
tail light housing

Here is my car and the two dimensions I want to scale on a factory car. I can screw the tail panel to it and put the light on if matlab will need that to compare images. my_77_TA_tailpanel_area

Here's a car with factory geometry and a tail light housing installed. This is the image matlab should search. It will look for the tail light. It will look for A and B, scale them, and output dimensions based off my car.
DSE TA Tail Panel

Yes, this scaling can be done with a ruler. I'm automating the process for learning purposes with MATLAB. How do I even begin to do this? I understand that the angle of the picture and different things will cause error and headache. I probably will keep the project scope very narrow and use only the third image to scale. Let's assume I have a picture of a tail light assembly sitting on a table. I want matlab to look for that image of a tail light housing in the image of the rear of the car and then scale.

1Schroeder commented 2 years ago

can anyone point me in the right direction?